deepseek_client#

Classes

DeepSeekClient([api_key, ...])

A component wrapper for the DeepSeek API client.

class DeepSeekClient(api_key: str | None = None, chat_completion_parser: Callable[[Completion], Any] = None, input_type: Literal['text', 'messages'] = 'messages', base_url: str = 'https://api.deepseek.com/v1/', env_api_key_name: str = 'DEEPSEEK_API_KEY')[source]#

Bases: OpenAIClient

A component wrapper for the DeepSeek API client.

DeepSeek’s API is compatible with OpenAI’s API, making it possible to use OpenAI SDKs or OpenAI-compatible software with DeepSeek by adjusting the API base URL.

This client extends OpenAIClient but modifies the default base_url to use DeepSeek’s API.

Documentation: https://api-docs.deepseek.com/guides/reasoning_model

Parameters:
  • api_key (Optional[str], optional) – DeepSeek API key. Defaults to None.

  • chat_completion_parser (Callable[[Completion], Any], optional) – A function to parse API responses.

  • input_type (Literal["text", "messages"], optional) – Defines how input is handled. Defaults to “text”.

  • base_url (str, optional) – API base URL, defaults to “https://api.deepseek.com/v1/”.