Update QwenLLMService docstrings

This commit is contained in:
Mark Backman
2025-06-26 10:57:42 -04:00
parent d7bfe54b7c
commit c018eb2f0e

View File

@@ -4,6 +4,8 @@
# SPDX-License-Identifier: BSD 2-Clause License
#
"""Qwen LLM service implementation using OpenAI-compatible interface."""
from loguru import logger
from pipecat.services.openai.llm import OpenAILLMService
@@ -16,10 +18,10 @@ class QwenLLMService(OpenAILLMService):
maintaining full compatibility with OpenAI's interface and functionality.
Args:
api_key (str): The API key for accessing Qwen's API (DashScope API key)
base_url (str, optional): Base URL for Qwen API. Defaults to "https://dashscope-intl.aliyuncs.com/compatible-mode/v1"
model (str, optional): The model identifier to use. Defaults to "qwen-plus".
**kwargs: Additional keyword arguments passed to OpenAILLMService
api_key: The API key for accessing Qwen's API (DashScope API key).
base_url: Base URL for Qwen API. Defaults to "https://dashscope-intl.aliyuncs.com/compatible-mode/v1".
model: The model identifier to use. Defaults to "qwen-plus".
**kwargs: Additional keyword arguments passed to OpenAILLMService.
"""
def __init__(
@@ -34,6 +36,15 @@ class QwenLLMService(OpenAILLMService):
logger.info(f"Initialized Qwen LLM service with model: {model}")
def create_client(self, api_key=None, base_url=None, **kwargs):
"""Create OpenAI-compatible client for Qwen API endpoint."""
"""Create OpenAI-compatible client for Qwen API endpoint.
Args:
api_key: API key for authentication. If None, uses instance default.
base_url: Base URL for the API. If None, uses instance default.
**kwargs: Additional arguments passed to the parent client creation.
Returns:
An OpenAI-compatible client configured for Qwen's API.
"""
logger.debug(f"Creating Qwen client with base URL: {base_url}")
return super().create_client(api_key, base_url, **kwargs)