wireMessage is the outbound OpenAI request shape; responses parse via streamChunk. Content has no omitempty: silent bash commands (e.g. heredoc writes) yield an empty tool-result string, and omitting the field makes Ollama's /v1 shim 400 with "invalid message content type: ". Always send an ex
| 50 | // Content has no omitempty: silent bash commands (e.g. heredoc writes) yield an |
| 51 | // empty tool-result string, and omitting the field makes Ollama's /v1 shim 400 |
| 52 | // with "invalid message content type: <nil>". Always send an explicit string. |
| 53 | type wireMessage struct { |
| 54 | Role string `json:"role"` |
| 55 | Content string `json:"content"` |
| 56 | Name string `json:"name,omitempty"` // tool name |
| 57 | ToolCallID string `json:"tool_call_id,omitempty"` // tool role |
| 58 | ToolCalls []toolCall `json:"tool_calls,omitempty"` |
| 59 | } |
| 60 | |
| 61 | type toolCall struct { |
nothing calls this directly
no outgoing calls
no test coverage detected