Skip to main content

Module history

Module history 

Source

Structs§

ToolResultHistory
Output of tool_result_to_messages: messages that go in tool role, plus optional follow-up user messages (e.g. for an image attachment).

Functions§

decode_string_output
Extract std_msgs/String.data from a tool’s JSON output. Accepts either raw text (returned verbatim) or {"data": "..."}.
sanitize_for_vlm
Filter history to a form OpenAI-compatible endpoints accept: every tool message must be preceded by an assistant whose tool_calls lists its tool_call_id. Orphans (e.g. left over from a trim that dropped the assistant) are quietly removed.
tool_result_to_messages
Build history messages from one executor tool result.
trim
Drop the oldest messages so history.len() <= max. No-op if already short.