orkes.services.AnthropicStrategy#
- class orkes.services.AnthropicStrategy[source]#
A strategy for interacting with the Anthropic API (Claude).
- __init__()#
Methods
__init__()get_headers(api_key)Returns the headers required for authentication with the Anthropic API.
get_messages_payload(messages)Converts an OrkesMessagesSchema into the format expected by the Anthropic API.
get_tools_payload(tools)Converts a list of OrkesToolSchema objects into the format expected by the Anthropic API.
parse_response(response_data)Parses a response from the Anthropic API.
parse_stream_chunk(line)Parses a single chunk of a streaming response from the Anthropic API.
prepare_payload(model, messages, stream, ...)Prepares the full payload for a request to the Anthropic API.