Skip to content

Commit 496e62a

Browse files
bug: fix gpt4, but now break mistral
1 parent 9e7a3ff commit 496e62a

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

pkg/openai/client.go

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
"sort"
1111
"strings"
1212

13-
"github.com/getkin/kin-openapi/openapi3"
1413
openai "github.com/gptscript-ai/chat-completion-client"
1514
"github.com/gptscript-ai/gptscript/pkg/cache"
1615
"github.com/gptscript-ai/gptscript/pkg/counter"
@@ -330,20 +329,12 @@ func (c *Client) Call(ctx context.Context, messageRequest types.CompletionReques
330329
}
331330

332331
for _, tool := range messageRequest.Tools {
333-
params := tool.Function.Parameters
334-
if params == nil {
335-
params = &openapi3.Schema{
336-
Type: "object",
337-
Properties: openapi3.Schemas{},
338-
}
339-
}
340-
341332
request.Tools = append(request.Tools, openai.Tool{
342333
Type: openai.ToolTypeFunction,
343334
Function: &openai.FunctionDefinition{
344335
Name: tool.Function.Name,
345336
Description: tool.Function.Description,
346-
Parameters: params,
337+
Parameters: tool.Function.Parameters,
347338
},
348339
})
349340
}

0 commit comments

Comments
 (0)