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.

provider_name = 'cohere'
capabilities = ProviderCapabilities(text=True, chat_completions=False, responses_api=False, tools=True, streaming=False, native_streaming=False, tool_streaming=False, structured_outputs=False, json_schema_mode=None, multimodal=False, image_input=False, file_input=False, audio_input=False, video_input=False, audio_transcription=False, speech_generation=False, reasoning=False, reasoning_effort=False, reasoning_budget=False, embeddings=False, local=False, server_tools=False, mcp=False, computer_use=False)
__init__(config)[source]
generate(messages, tools=None, *args, **kwargs)
invoke(request, tools=None)[source]

Invoke Cohere through the provider-neutral adapter surface.

Return type:

ModelResponse

Parameters:
  • request (ModelRequest)

  • tools (List[Dict[str, Any]] | None)

continue_with_tool_results(request, response, tool_results)[source]

Submit runtime-executed tool results to Cohere.

Return type:

ModelResponse

Parameters:
stream(request)[source]

Streaming adapter placeholder with non-streaming fallback.

Parameters:

request (ModelRequest)

close()[source]

Close the underlying SDK client when supported.

Return type:

None

resume_tool_flow(suspended_state, tools, hitl_context=None)[source]

Resume an interrupted Cohere tool-call flow from persisted state.

Return type:

str

Parameters:
  • suspended_state (Dict[str, Any])

  • tools (List[Dict[str, Any]] | None)

  • hitl_context (Dict[str, Any] | None)