WIP: adding tool fields into stream resp struct
This commit is contained in:
@@ -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"`
|
||||
|
||||
Reference in New Issue
Block a user