WIP: adding tool fields into stream resp struct

This commit is contained in:
Grail Finder
2025-08-08 10:22:22 +03:00
parent 3c23ff2403
commit 14558f98cd
2 changed files with 43 additions and 17 deletions

View File

@@ -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"`