mirror of
https://github.com/danielmiessler/Fabric.git
synced 2026-01-11 07:18:03 -05:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf618f4a25 | ||
|
|
e4617190d8 | ||
|
|
49fe59f403 | ||
|
|
821faa0894 | ||
|
|
af39e38394 | ||
|
|
8774971b98 | ||
|
|
1286afeb76 | ||
|
|
e9e6549528 | ||
|
|
f1550e1d1d | ||
|
|
1fe00633c4 | ||
|
|
bb1d4f9ca4 | ||
|
|
bebc8c20b5 | ||
|
|
9a1a46e203 | ||
|
|
a5ab81b5c8 |
@@ -13,6 +13,7 @@ permissions:
|
||||
|
||||
jobs:
|
||||
update-version:
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
|
||||
@@ -66,9 +66,9 @@
|
||||
## Updates
|
||||
|
||||
> [!NOTE]
|
||||
> February 5, 2025
|
||||
> February 24, 2025
|
||||
>
|
||||
> - Remember that `fabric` supports `o1` and `o3` models, but you need to 1) not use `-s`, and 2) use the `--raw` flag because the o1 and o3 models don't support the `--stream` option or temperature settings.
|
||||
> - Fabric now supports Sonnet 3.7! Update and use `-S` to select it as your default if you want, or just use the shortcut `-m claude-3-7-sonnet-latest`. Enjoy!
|
||||
|
||||
## What and why
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
# Enhanced Pattern Selection, Pattern Descriptions, New Pattern TAG System, Language Support and other WEB UI Improvements V3
|
||||
https://youtu.be/bhwtWXoMASA# Enhanced Pattern Selection,
|
||||
Pattern Descriptions, New
|
||||
Pattern TAG System, Language Support and other WEB UI Improvements V3
|
||||
|
||||
This Cummulative PR adds several Web UI and functionality improvements to make pattern selection more intuitive (pattern descriptions), ability to save favorite patterns, powerful multilingual capabilities, a Pattern TAG system, a help reference section, more robust Youtube processing and a variety of ui improvements.
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
"1.4.138"
|
||||
"1.4.140"
|
||||
|
||||
@@ -55,6 +55,7 @@ func (h *ChatHandler) HandleChat(c *gin.Context) {
|
||||
|
||||
if err := c.BindJSON(&request); err != nil {
|
||||
log.Printf("Error binding JSON: %v", err)
|
||||
c.Writer.Header().Set("Strict-Transport-Security", "max-age=63072000; includeSubDomains")
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": fmt.Sprintf("Invalid request format: %v", err)})
|
||||
return
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ func (h *ConfigHandler) UpdateConfig(c *gin.Context) {
|
||||
LMStudioURL string `json:"lm_studio_base_url"`
|
||||
}
|
||||
|
||||
if err := c.BindJSON(&config); err != nil {
|
||||
if err := c.ShouldBindJSON(&config); err != nil {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
|
||||
@@ -5,18 +5,32 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/danielmiessler/fabric/core"
|
||||
"github.com/gin-gonic/gin"
|
||||
"io"
|
||||
"log"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/danielmiessler/fabric/core"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type OllamaModel struct {
|
||||
Models []Model `json:"models"`
|
||||
}
|
||||
|
||||
func isValidOllamaRequestBody(body OllamaRequestBody) bool {
|
||||
if body.Model == "" || len(body.Messages) == 0 {
|
||||
return false
|
||||
}
|
||||
for _, msg := range body.Messages {
|
||||
if msg.Content == "" || msg.Role == "" {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
type Model struct {
|
||||
Details ModelDetails `json:"details"`
|
||||
Digest string `json:"digest"`
|
||||
@@ -142,12 +156,16 @@ func (f APIConvert) ollamaTags(c *gin.Context) {
|
||||
})
|
||||
}
|
||||
|
||||
c.JSON(200, response)
|
||||
|
||||
}
|
||||
|
||||
func (f APIConvert) ollamaChat(c *gin.Context) {
|
||||
body, err := io.ReadAll(c.Request.Body)
|
||||
if !isValidOllamaRequestBody(prompt) {
|
||||
log.Printf("Invalid request body: %v", prompt)
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": "invalid request body"})
|
||||
return
|
||||
}
|
||||
if !isValidOllamaRequestBody(prompt) {
|
||||
log.Printf("Invalid request body: %v", prompt)
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": "invalid request body"})
|
||||
return
|
||||
}
|
||||
if err != nil {
|
||||
log.Printf("Error reading body: %v", err)
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": "testing endpoint"})
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
package main
|
||||
|
||||
var version = "v1.4.138"
|
||||
var version = "v1.4.140"
|
||||
|
||||
Reference in New Issue
Block a user