Update FireworksLLMService docstrings
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
# SPDX-License-Identifier: BSD 2-Clause License
|
# SPDX-License-Identifier: BSD 2-Clause License
|
||||||
#
|
#
|
||||||
|
|
||||||
|
"""Fireworks AI service implementation using OpenAI-compatible interface."""
|
||||||
|
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
@@ -21,10 +22,10 @@ class FireworksLLMService(OpenAILLMService):
|
|||||||
maintaining full compatibility with OpenAI's interface and functionality.
|
maintaining full compatibility with OpenAI's interface and functionality.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
api_key (str): The API key for accessing Fireworks AI
|
api_key: The API key for accessing Fireworks AI.
|
||||||
model (str, optional): The model identifier to use. Defaults to "accounts/fireworks/models/firefunction-v2"
|
model: 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"
|
base_url: The base URL for Fireworks API. Defaults to "https://api.fireworks.ai/inference/v1".
|
||||||
**kwargs: Additional keyword arguments passed to OpenAILLMService
|
**kwargs: Additional keyword arguments passed to OpenAILLMService.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
@@ -38,7 +39,16 @@ class FireworksLLMService(OpenAILLMService):
|
|||||||
super().__init__(api_key=api_key, base_url=base_url, model=model, **kwargs)
|
super().__init__(api_key=api_key, base_url=base_url, model=model, **kwargs)
|
||||||
|
|
||||||
def create_client(self, api_key=None, base_url=None, **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}")
|
logger.debug(f"Creating Fireworks client with api {base_url}")
|
||||||
return super().create_client(api_key, base_url, **kwargs)
|
return super().create_client(api_key, base_url, **kwargs)
|
||||||
|
|
||||||
@@ -47,7 +57,15 @@ class FireworksLLMService(OpenAILLMService):
|
|||||||
):
|
):
|
||||||
"""Get chat completions from Fireworks API.
|
"""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 = {
|
params = {
|
||||||
"model": self.model_name,
|
"model": self.model_name,
|
||||||
|
|||||||
Reference in New Issue
Block a user