Skip to main content

Module translate

Module translate 

Source
Expand description

Anthropic ↔ OpenAI translation layer.

Structs§

ToolNameMap

Functions§

messages_to_oai
Convert Anthropic-shaped message list + optional system prompt into an OpenAI ChatMessage stream.
oai_event_to_llm
Translate an OaiEvent into a synaps StreamEvent.
tool_calls_to_content_blocks
Convert an OpenAI tool-call list into Anthropic-shaped tool_use content blocks.
tools_to_oai
Convert Anthropic tool schema entries to OpenAI ToolDefinitions.
tools_to_responses
Responses endpoints may normalize omitted strict to strict schemas, promoting optional properties to required ones. These are ordinary Synaps schemas (including extensions), not transformed strict-output schemas. Opt out explicitly rather than making the model invent optional argument values. Chat Completions keeps its existing wire shape.