Skip to main content

tool_result_to_messages

Function tool_result_to_messages 

Source
pub fn tool_result_to_messages(call_id: &str, output: &str) -> ToolResultHistory
Expand description

Build history messages from one executor tool result.

Normal path: a single Message with role: "tool" and tool_call_id = call_id, carrying output (or a short placeholder) in content.

Image path: OpenAI-compatible APIs do not accept image payloads on tool messages. We still emit a tool line with a text placeholder, then add a synthetic user message with image_base64 so build_openai_messages can attach a vision part.