Fixes, readme
This commit is contained in:
@@ -10,12 +10,10 @@ import (
|
||||
"github.com/tidwall/gjson"
|
||||
|
||||
"github.com/fujin/anthropic-proxy/internal/auth"
|
||||
"github.com/fujin/anthropic-proxy/internal/config"
|
||||
)
|
||||
|
||||
func HandleMessages(pool *auth.Pool, profile *SniffedProfile, sanitizeCfg config.SanitizeConfig) gin.HandlerFunc {
|
||||
func HandleMessages(pool *auth.Pool, profile *SniffedProfile, getSanitizer func() *Sanitizer) gin.HandlerFunc {
|
||||
upstream := NewUpstreamClient(profile)
|
||||
san := NewSanitizer(sanitizeCfg)
|
||||
|
||||
return func(c *gin.Context) {
|
||||
body, err := io.ReadAll(c.Request.Body)
|
||||
@@ -26,6 +24,7 @@ func HandleMessages(pool *auth.Pool, profile *SniffedProfile, sanitizeCfg config
|
||||
|
||||
log.Printf("incoming: %s %s (%d bytes) model=%s", c.Request.Method, c.Request.URL.Path, len(body), gjson.GetBytes(body, "model").String())
|
||||
|
||||
san := getSanitizer()
|
||||
body = san.SanitizeRequest(body)
|
||||
|
||||
cred, err := pool.Pick()
|
||||
|
||||
Reference in New Issue
Block a user