ChatMessageToolResult builds a tool-result chat message part. The isMedia flag marks the result as carrying binary media content (e.g. a screenshot) so that round-trip reconstruction preserves the media type instead of sending raw base64 as text tokens.
(toolCallID, toolName string, result json.RawMessage, isError bool, isMedia bool)
| 389 | // (e.g. a screenshot) so that round-trip reconstruction preserves |
| 390 | // the media type instead of sending raw base64 as text tokens. |
| 391 | func ChatMessageToolResult(toolCallID, toolName string, result json.RawMessage, isError bool, isMedia bool) ChatMessagePart { |
| 392 | return ChatMessagePart{ |
| 393 | Type: ChatMessagePartTypeToolResult, |
| 394 | ToolCallID: toolCallID, |
| 395 | ToolName: toolName, |
| 396 | Result: result, |
| 397 | IsError: isError, |
| 398 | IsMedia: isMedia, |
| 399 | } |
| 400 | } |
| 401 | |
| 402 | // ChatMessageFile builds a file chat message part. |
| 403 | func ChatMessageFile(fileID uuid.UUID, mediaType string, name string) ChatMessagePart { |
no outgoing calls