@@ -18,20 +18,6 @@ class CometAPIChatGenerator(OpenAIChatGenerator):
1818 This class extends Haystack's OpenAIChatGenerator to specifically interact with the CometAPI.
1919 It sets the `api_base_url` to the CometAPI endpoint and allows for all the
2020 standard configurations available in the OpenAIChatGenerator.
21-
22- :param api_key: The API key for authenticating with the CometAPI. Defaults to
23- loading from the "COMET_API_KEY" environment variable.
24- :param model: The name of the model to use for chat generation (e.g., "gpt-5-mini", "grok-3-mini").
25- Defaults to "gpt-5-mini".
26- :param streaming_callback: An optional callable that will be called with each chunk of
27- a streaming response.
28- :param generation_kwargs: Optional keyword arguments to pass to the underlying generation
29- API call.
30- :param timeout: The maximum time in seconds to wait for a response from the API.
31- :param max_retries: The maximum number of times to retry a failed API request.
32- :param tools: An optional list of tool definitions that the model can use.
33- :param tools_strict: If True, the model is forced to use one of the provided tools if a tool call is made.
34- :param http_client_kwargs: Optional keyword arguments to pass to the HTTP client.
3521 """
3622
3723 def __init__ (
@@ -46,7 +32,20 @@ def __init__(
4632 tools : list [Tool | Toolset ] | Toolset | None = None ,
4733 tools_strict : bool = False ,
4834 http_client_kwargs : dict [str , Any ] | None = None ,
49- ):
35+ ) -> None :
36+ """
37+ Creates a `CometAPIChatGenerator` instance.
38+
39+ :param api_key: The API key for authenticating with the CometAPI.
40+ :param model: The name of the model to use for chat generation (e.g., `"gpt-5-mini"`, `"grok-3-mini"`).
41+ :param streaming_callback: An optional callable invoked with each chunk of a streaming response.
42+ :param generation_kwargs: Optional keyword arguments passed to the underlying generation API call.
43+ :param timeout: The maximum time in seconds to wait for a response from the API.
44+ :param max_retries: The maximum number of times to retry a failed API request.
45+ :param tools: An optional list of tools the model can use.
46+ :param tools_strict: If `True`, the model is forced to use one of the provided tools.
47+ :param http_client_kwargs: Optional keyword arguments passed to the HTTP client.
48+ """
5049 api_base_url = "https://api.cometapi.com/v1"
5150
5251 super ().__init__ (
0 commit comments