From cd4ad59a382ade33a0eec8bb8242a01b305d876b Mon Sep 17 00:00:00 2001 From: Steve Dudenhoeffer Date: Sat, 9 Nov 2024 19:50:14 -0500 Subject: [PATCH] sync of changes --- anthropic.go | 2 +- google.go | 2 +- llm.go | 1 - openai.go | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/anthropic.go b/anthropic.go index 0543b1c..fb881a0 100644 --- a/anthropic.go +++ b/anthropic.go @@ -87,7 +87,7 @@ func (a anthropic) requestToAnthropicRequest(req Request) anth.MessagesRequest { } } - for _, tool := range req.Toolbox { + for _, tool := range req.Toolbox.funcs { res.Tools = append(res.Tools, anth.ToolDefinition{ Name: tool.Name, Description: tool.Description, diff --git a/google.go b/google.go index 778f389..3829ec2 100644 --- a/google.go +++ b/google.go @@ -30,7 +30,7 @@ func (g google) requestToGoogleRequest(in Request, model *genai.GenerativeModel) res = append(res, genai.Text(c.Text)) } - for _, tool := range in.Toolbox { + for _, tool := range in.Toolbox.funcs { panic("google ToolBox is todo" + tool.Name) /* diff --git a/llm.go b/llm.go index cb4b99a..fee880f 100644 --- a/llm.go +++ b/llm.go @@ -50,7 +50,6 @@ type Response struct { type ChatCompletion interface { ChatComplete(ctx context.Context, req Request) (Response, error) - SplitLongString(ctx context.Context, input string) ([]string, error) } type LLM interface { diff --git a/openai.go b/openai.go index 21ad71b..d228c57 100644 --- a/openai.go +++ b/openai.go @@ -57,7 +57,7 @@ func (o openaiImpl) requestToOpenAIRequest(request Request) oai.ChatCompletionRe res.Messages = append(res.Messages, m) } - for _, tool := range request.Toolbox { + for _, tool := range request.Toolbox.funcs { res.Tools = append(res.Tools, oai.Tool{ Type: "function", Function: &oai.FunctionDefinition{