praval.providers.anthropic๏ƒ

Anthropic provider implementation for Praval framework.

Provides integration with Anthropicโ€™s Claude models through the Messages API with support for conversation history and system messages.

Classes

AnthropicProvider(config)

Anthropic provider for LLM interactions.

class praval.providers.anthropic.AnthropicProvider(config)[source]๏ƒ

Bases: object

Anthropic provider for LLM interactions.

Handles communication with Anthropicโ€™s Claude models through the Messages API with proper system message handling.

__init__(config)[source]๏ƒ

Initialize Anthropic provider.

Parameters:

config โ€“ AgentConfig object with provider settings

Raises:

ProviderError โ€“ If Anthropic client initialization fails

generate(messages, tools=None)[source]๏ƒ

Generate a response using Anthropicโ€™s Messages API.

Parameters:
  • messages (List[Dict[str, str]]) โ€“ Conversation history as list of message dictionaries

  • tools (Optional[List[Dict[str, Any]]]) โ€“ Optional list of available tools (not fully supported yet)

Return type:

str

Returns:

Generated response as a string

Raises:

ProviderError โ€“ If API call fails