Skip to main content

transform_messages

Function transform_messages 

Source
pub fn transform_messages(
    messages: &[Message],
    target_model: &Model,
    normalize_tool_call_id: Option<fn(&str) -> String>,
) -> Vec<Message>
Expand description

Transform messages for cross-provider compatibility.

This handles:

  • Thinking block conversion between providers
  • ToolCall ID normalization
  • Orphan tool call handling