class documentation

class AnthropicProvider(LLMProvider): (source)

Constructor: AnthropicProvider(context)

View In Hierarchy

Anthropic Claude Messages API provider (normalized to OpenAI format).

Method chat Send a request to Anthropic's /v1/messages API.
Static Method _prepare_anthropic_tool_choice Undocumented
Static Method _prepare_anthropic_tools Translate OpenAI function tool schemas to Anthropic's tool schema.
Method _prepare_anthropic_messages Translate OpenAI-style conversation history to Anthropic Messages format.

Inherited from LLMProvider:

Method __init__ Undocumented
Instance Variable context Undocumented
Method _prepare_messages Convert string message to proper messages array
def chat(self, messages, **kwargs): (source)

Send a request to Anthropic's /v1/messages API.

@staticmethod
def _prepare_anthropic_tool_choice(tool_choice): (source)

Undocumented

@staticmethod
def _prepare_anthropic_tools(tools): (source)

Translate OpenAI function tool schemas to Anthropic's tool schema.

def _prepare_anthropic_messages(self, messages): (source)

Translate OpenAI-style conversation history to Anthropic Messages format.