praval.providers.cohere๏ƒ

Cohere provider implementation for Praval framework.

Provides integration with Cohereโ€™s chat models through their Chat API with support for conversation history.

Classes

CohereProvider(config)

Cohere provider for LLM interactions.

class praval.providers.cohere.CohereProvider(config)[source]๏ƒ

Bases: object

Cohere provider for LLM interactions.

Handles communication with Cohereโ€™s chat models through the Chat API with conversation history support.

__init__(config)[source]๏ƒ

Initialize Cohere provider.

Parameters:

config โ€“ AgentConfig object with provider settings

Raises:

ProviderError โ€“ If Cohere client initialization fails

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

Generate a response using Cohereโ€™s Chat 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