Update DeepSeekLLMService docstrings

This commit is contained in:
Mark Backman
2025-06-26 10:27:36 -04:00
parent 3828df8cf9
commit 65234ae41a

View File

@@ -4,6 +4,7 @@
# SPDX-License-Identifier: BSD 2-Clause License
#
"""DeepSeek LLM service implementation using OpenAI-compatible interface."""
from typing import List
@@ -22,10 +23,10 @@ class DeepSeekLLMService(OpenAILLMService):
maintaining full compatibility with OpenAI's interface and functionality.
Args:
api_key (str): The API key for accessing DeepSeek's API
base_url (str, optional): The base URL for DeepSeek API. Defaults to "https://api.deepseek.com/v1"
model (str, optional): The model identifier to use. Defaults to "deepseek-chat"
**kwargs: Additional keyword arguments passed to OpenAILLMService
api_key: The API key for accessing DeepSeek's API.
base_url: The base URL for DeepSeek API. Defaults to "https://api.deepseek.com/v1".
model: The model identifier to use. Defaults to "deepseek-chat".
**kwargs: Additional keyword arguments passed to OpenAILLMService.
"""
def __init__(
@@ -39,24 +40,33 @@ class DeepSeekLLMService(OpenAILLMService):
super().__init__(api_key=api_key, base_url=base_url, model=model, **kwargs)
def create_client(self, api_key=None, base_url=None, **kwargs):
"""Create OpenAI-compatible client for DeepSeek API endpoint."""
"""Create OpenAI-compatible client for DeepSeek API endpoint.
Args:
api_key: The API key for authentication. If None, uses instance default.
base_url: The base URL for the API. If None, uses instance default.
**kwargs: Additional keyword arguments for client configuration.
Returns:
An OpenAI-compatible client configured for DeepSeek's API.
"""
logger.debug(f"Creating DeepSeek client with api {base_url}")
return super().create_client(api_key, base_url, **kwargs)
async def get_chat_completions(
self, context: OpenAILLMContext, messages: List[ChatCompletionMessageParam]
) -> AsyncStream[ChatCompletionChunk]:
"""Create a streaming chat completion using Cerebras's API.
"""Create a streaming chat completion using DeepSeek's API.
Args:
context (OpenAILLMContext): The context object containing tools configuration
and other settings for the chat completion.
messages (List[ChatCompletionMessageParam]): The list of messages comprising
the conversation history and current request.
context: The context object containing tools configuration
and other settings for the chat completion.
messages: The list of messages comprising the conversation
history and current request.
Returns:
AsyncStream[ChatCompletionChunk]: A streaming response of chat completion
chunks that can be processed asynchronously.
A streaming response of chat completion chunks that can be
processed asynchronously.
"""
params = {
"model": self.model_name,