Class AnthropicToolConverter
The framework's ToolSchemaGenerator emits tools in an
OpenAI-flavoured intermediate form: each tool is
{"type":"function","function":{name,description,parameters,examples}}.
Anthropic's tool definition is flatter — name, description,
input_schema, optional input_examples — and splits
@ToolExample handling across two surfaces:
input_examplescarries flat positive input objects.descriptionabsorbs negative examples (Claude has no native negative-examples surface).
Used by AnthropicClient for direct Claude calls and by
BedrockClient for Bedrock-hosted Anthropic Claude models —
the on-wire tool contract is identical between the two. Bedrock
documents the same Messages-API tool schema for anthropic.*
model IDs.
- See Also:
-
Method Summary
-
Method Details
-
convertToClaudeTools
Convert an OpenAI-flavoured tool list into Anthropic's tool list.Tools whose
typeis not"function", or whosefunctionobject is missing, are skipped silently — the intermediate schema only emitsfunction-typed entries today.- Parameters:
tools- intermediate tools (OpenAI shape); nevernull- Returns:
- Anthropic-shaped tools; empty list if the input is empty
-