From d7d432b8a1dbea9e18f78d835112fa074051f587 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Fri, 8 Aug 2025 13:03:37 +0300 Subject: Enha: /chat /completions tool calls to live in peace --- models/models.go | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'models') diff --git a/models/models.go b/models/models.go index 9ca12d9..69d812b 100644 --- a/models/models.go +++ b/models/models.go @@ -5,9 +5,14 @@ import ( "strings" ) +// type FuncCall struct { +// Name string `json:"name"` +// Args []string `json:"args"` +// } + type FuncCall struct { - Name string `json:"name"` - Args []string `json:"args"` + Name string `json:"name"` + Args map[string]string `json:"args"` } type LLMResp struct { @@ -30,11 +35,14 @@ type LLMResp struct { ID string `json:"id"` } +type ToolDeltaFunc struct { + Name string `json:"name"` + Arguments string `json:"arguments"` +} + type ToolDeltaResp struct { - Index int `json:"index"` - Function struct { - Arguments string `json:"arguments"` - } `json:"function"` + Index int `json:"index"` + Function ToolDeltaFunc `json:"function"` } // for streaming @@ -63,6 +71,7 @@ type TextChunk struct { ToolChunk string Finished bool ToolResp bool + FuncName string } type RoleMsg struct { -- cgit v1.2.3