From 14558f98cd5621e9c5019ba1ba957f06e86d2cc6 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Fri, 8 Aug 2025 10:22:22 +0300 Subject: WIP: adding tool fields into stream resp struct --- models/models.go | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'models') diff --git a/models/models.go b/models/models.go index c88417f..9ca12d9 100644 --- a/models/models.go +++ b/models/models.go @@ -30,13 +30,21 @@ type LLMResp struct { ID string `json:"id"` } +type ToolDeltaResp struct { + Index int `json:"index"` + Function struct { + Arguments string `json:"arguments"` + } `json:"function"` +} + // for streaming type LLMRespChunk struct { Choices []struct { FinishReason string `json:"finish_reason"` Index int `json:"index"` Delta struct { - Content string `json:"content"` + Content string `json:"content"` + ToolCalls []ToolDeltaResp `json:"tool_calls"` } `json:"delta"` } `json:"choices"` Created int `json:"created"` @@ -50,6 +58,13 @@ type LLMRespChunk struct { } `json:"usage"` } +type TextChunk struct { + Chunk string + ToolChunk string + Finished bool + ToolResp bool +} + type RoleMsg struct { Role string `json:"role"` Content string `json:"content"` -- cgit v1.2.3