Rewrites tool-call and tool-result messages into neutral transcript text for legacy LLM endpoints. Use for LLM provider compatibility.
// Source: https://github.com/suyoumo/ClawProBench | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
use ironclaw_common::provider_transcript::format_tool_result_observation;
use super::{ChatCompletionMessage, MessageContent};
/// Rewrite tool-call / tool-result messages into neutral transcript text.
///
/// This is a legacy compatibility adapter for OpenAI-compatible endpoints
/// that reject the standard multi-turn tool-calling protocol (`role: "tool"`
/// messages). It keeps assistant prose but drops assistant tool-call protocol
/// events so the model does not learn an assistant-authored tool-event
/// completion pattern. Tool results become user-side observations.
pub(super)
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key