add claude proxy
This commit is contained in:
@@ -83,6 +83,10 @@ func (p *Proxy) HandleProxy(c *gin.Context) {
|
|||||||
p.ChatHandler(c)
|
p.ChatHandler(c)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if strings.HasPrefix(c.Request.URL.Path, "/v1/messages") {
|
||||||
|
p.ProxyClaude(c)
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *Proxy) SendUsage(usage *llm.TokenUsage) {
|
func (p *Proxy) SendUsage(usage *llm.TokenUsage) {
|
||||||
|
|||||||
14
internal/controller/proxy/proxy_claude.go
Normal file
14
internal/controller/proxy/proxy_claude.go
Normal 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))
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user