free-claude-code/providers/deepseek/client.py
Alishahryar1 f3a7528d49
Some checks are pending
CI / checks (push) Waiting to run
Major refactor: API, providers, messaging, and Anthropic protocol
Consolidates the incremental refactor work into a single change set: modular web tools (api/web_tools), native Anthropic request building and SSE block policy, OpenAI conversion and error handling, provider transports and rate limiting, messaging handler and tree queue, safe logging, smoke tests, and broad test coverage.
2026-04-26 03:01:14 -07:00

30 lines
936 B
Python

"""DeepSeek provider implementation."""
from typing import Any
from providers.base import ProviderConfig
from providers.defaults import DEEPSEEK_DEFAULT_BASE
from providers.openai_compat import OpenAIChatTransport
from .request import build_request_body
class DeepSeekProvider(OpenAIChatTransport):
"""DeepSeek provider using OpenAI-compatible chat completions."""
def __init__(self, config: ProviderConfig):
super().__init__(
config,
provider_name="DEEPSEEK",
base_url=config.base_url or DEEPSEEK_DEFAULT_BASE,
api_key=config.api_key,
)
def _build_request_body(
self, request: Any, thinking_enabled: bool | None = None
) -> dict:
"""Internal helper for tests and shared building."""
return build_request_body(
request,
thinking_enabled=self._is_thinking_enabled(request, thinking_enabled),
)