@@ -191,20 +191,45 @@ type KnowledgeQARequest struct {
191191 DisableTitle bool `json:"disable_title"` // Whether to disable auto title generation
192192}
193193
194+ // LLMToolCall represents a function/tool call from the LLM
195+ type LLMToolCall struct {
196+ ID string `json:"id"`
197+ Type string `json:"type"` // "function"
198+ Function FunctionCall `json:"function"`
199+ }
200+
201+ // FunctionCall represents the function details
202+ type FunctionCall struct {
203+ Name string `json:"name"`
204+ Arguments string `json:"arguments"` // JSON string
205+ }
206+
194207type ResponseType string
195208
196209const (
197- ResponseTypeAnswer ResponseType = "answer"
198- ResponseTypeReferences ResponseType = "references"
210+ ResponseTypeAnswer ResponseType = "answer"
211+ ResponseTypeReferences ResponseType = "references"
212+ ResponseTypeThinking ResponseType = "thinking"
213+ ResponseTypeToolCall ResponseType = "tool_call"
214+ ResponseTypeToolResult ResponseType = "tool_result"
215+ ResponseTypeError ResponseType = "error"
216+ ResponseTypeReflection ResponseType = "reflection"
217+ ResponseTypeSessionTitle ResponseType = "session_title"
218+ ResponseTypeAgentQuery ResponseType = "agent_query"
219+ ResponseTypeComplete ResponseType = "complete"
199220)
200221
201222// StreamResponse streaming response
202223type StreamResponse struct {
203- ID string `json:"id"` // Unique identifier
204- ResponseType ResponseType `json:"response_type"` // Response type
205- Content string `json:"content"` // Current content fragment
206- Done bool `json:"done"` // Whether completed
207- KnowledgeReferences []* SearchResult `json:"knowledge_references"` // Knowledge references
224+ ID string `json:"id"` // Unique identifier
225+ ResponseType ResponseType `json:"response_type"` // Response type
226+ Content string `json:"content"` // Current content fragment
227+ Done bool `json:"done"` // Whether completed
228+ KnowledgeReferences []* SearchResult `json:"knowledge_references,omitempty"` // Knowledge references
229+ SessionID string `json:"session_id,omitempty"` // Session ID (for agent_query event)
230+ AssistantMessageID string `json:"assistant_message_id,omitempty"` // Assistant Message ID (for agent_query event)
231+ ToolCalls []LLMToolCall `json:"tool_calls,omitempty"` // Tool calls for streaming (partial)
232+ Data map [string ]interface {} `json:"data,omitempty"` // Additional metadata for enhanced display
208233}
209234
210235// KnowledgeQAStream knowledge Q&A streaming API
0 commit comments