add claude proxy

This commit is contained in:
Sakurasan
2025-07-30 11:18:47 +08:00
parent 6b2d78fe56
commit 4a68ff6162
2 changed files with 18 additions and 0 deletions

View File

@@ -83,6 +83,10 @@ func (p *Proxy) HandleProxy(c *gin.Context) {
p.ChatHandler(c)
return
}
if strings.HasPrefix(c.Request.URL.Path, "/v1/messages") {
p.ProxyClaude(c)
return
}
}
func (p *Proxy) SendUsage(usage *llm.TokenUsage) {

View File

@@ -0,0 +1,14 @@
package controller
import (
"fmt"
"io"
"github.com/gin-gonic/gin"
)
func (p *Proxy) ProxyClaude(c *gin.Context) {
fmt.Println(c.Request.URL.String())
data, _ := io.ReadAll(c.Request.Body)
fmt.Println(string(data))
}