From 03e3e9fae93b39191dfd31c45a9fb8590ef6baf9 Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Thu, 26 Jun 2025 10:28:35 -0400 Subject: [PATCH] Update FireworksLLMService docstrings --- src/pipecat/services/fireworks/llm.py | 30 +++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/src/pipecat/services/fireworks/llm.py b/src/pipecat/services/fireworks/llm.py index d4003f86f..cccfb5556 100644 --- a/src/pipecat/services/fireworks/llm.py +++ b/src/pipecat/services/fireworks/llm.py @@ -4,6 +4,7 @@ # SPDX-License-Identifier: BSD 2-Clause License # +"""Fireworks AI service implementation using OpenAI-compatible interface.""" from typing import List @@ -21,10 +22,10 @@ class FireworksLLMService(OpenAILLMService): maintaining full compatibility with OpenAI's interface and functionality. Args: - api_key (str): The API key for accessing Fireworks AI - model (str, optional): The model identifier to use. Defaults to "accounts/fireworks/models/firefunction-v2" - base_url (str, optional): The base URL for Fireworks API. Defaults to "https://api.fireworks.ai/inference/v1" - **kwargs: Additional keyword arguments passed to OpenAILLMService + api_key: The API key for accessing Fireworks AI. + model: The model identifier to use. Defaults to "accounts/fireworks/models/firefunction-v2". + base_url: The base URL for Fireworks API. Defaults to "https://api.fireworks.ai/inference/v1". + **kwargs: Additional keyword arguments passed to OpenAILLMService. """ def __init__( @@ -38,7 +39,16 @@ class FireworksLLMService(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 Fireworks API endpoint.""" + """Create OpenAI-compatible client for Fireworks 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 client constructor. + + Returns: + Configured OpenAI client instance for Fireworks API. + """ logger.debug(f"Creating Fireworks client with api {base_url}") return super().create_client(api_key, base_url, **kwargs) @@ -47,7 +57,15 @@ class FireworksLLMService(OpenAILLMService): ): """Get chat completions from Fireworks API. - Removes OpenAI-specific parameters not supported by Fireworks. + Removes OpenAI-specific parameters not supported by Fireworks and + configures the request with Fireworks-compatible settings. + + Args: + context: The OpenAI LLM context containing tools and settings. + messages: List of chat completion message parameters. + + Returns: + Async generator yielding chat completion chunks from Fireworks API. """ params = { "model": self.model_name,