Compare commits

...

14 Commits

Author SHA1 Message Date
github-actions[bot]
bf618f4a25 Update version to v1.4.140 and commit 2025-02-25 21:21:32 +00:00
Eugen Eisler
e4617190d8 Merge pull request #1313 from CXKswain/main
Updated ollama.go to fix a couple of potential DoS issues
2025-02-25 22:20:27 +01:00
Eugen Eisler
49fe59f403 Merge branch 'main' into main 2025-02-25 22:20:13 +01:00
github-actions[bot]
821faa0894 Update version to v1.4.139 and commit 2025-02-25 21:18:10 +00:00
Eugen Eisler
af39e38394 Don't trigger on PRs 2025-02-25 22:17:21 +01:00
Eugen Eisler
8774971b98 Merge pull request #1321 from jmd1010/youtube-link-only
Update demo video link in PR-1309 documentation
2025-02-25 22:07:47 +01:00
jmd1010
1286afeb76 Update demo video link in PR-1284 documentation 2025-02-25 00:13:02 -05:00
github-actions[bot]
e9e6549528 Update version to v..1 and commit 2025-02-24 22:29:21 +00:00
CXKswain
f1550e1d1d Delete version.go 2025-02-24 16:28:34 -06:00
CXKswain
1fe00633c4 Delete pkgs/fabric/version.nix 2025-02-24 16:28:13 -06:00
Daniel Miessler
bb1d4f9ca4 Update README.md 2025-02-24 13:48:56 -08:00
“CXKswain”
bebc8c20b5 Resolving a couple of more medium vulnerabilites 2025-02-21 14:52:03 -06:00
“CXKswain”
9a1a46e203 Updated to fix security issues with ollama.go 2025-02-21 14:39:05 -06:00
github-actions[bot]
a5ab81b5c8 Update version to v..1 and commit 2025-02-21 20:30:21 +00:00
8 changed files with 36 additions and 14 deletions

View File

@@ -13,6 +13,7 @@ permissions:
jobs:
update-version:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:

View File

@@ -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

View File

@@ -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.

View File

@@ -1 +1 @@
"1.4.138"
"1.4.140"

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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"})

View File

@@ -1,3 +1,3 @@
package main
var version = "v1.4.138"
var version = "v1.4.140"