Files
deepset-ai--haystack/docs-website/reference_versioned_docs/version-2.20/integrations-api/cometapi.md
T
wehub-resource-sync c56bef871b
Sync docs with Docusaurus / sync (push) Waiting to run
Tests / Check if changed (push) Waiting to run
Tests / format (push) Blocked by required conditions
Tests / check-imports (push) Blocked by required conditions
Tests / Unit / macos-latest (push) Blocked by required conditions
Tests / Unit / ubuntu-latest (push) Blocked by required conditions
Tests / Unit / windows-latest (push) Blocked by required conditions
Tests / mypy (push) Blocked by required conditions
Tests / Integration / ubuntu-latest (push) Blocked by required conditions
Tests / Integration / macos-latest (push) Blocked by required conditions
Tests / Integration / windows-latest (push) Blocked by required conditions
Tests / notify-slack-on-failure (push) Blocked by required conditions
Tests / Mark tests as completed (push) Blocked by required conditions
Docker image release / Build base image (push) Waiting to run
CodeQL / Analyze (python) (push) Has been cancelled
Update Platform Components Table / update (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:22:28 +08:00

1.6 KiB

title, id, description, slug
title id description slug
Comet API integrations-cometapi Comet API integration for Haystack /integrations-cometapi

Module haystack_integrations.components.generators.cometapi.chat.chat_generator

CometAPIChatGenerator

A chat generator that uses the CometAPI for generating chat responses.

This class extends Haystack's OpenAIChatGenerator to specifically interact with the CometAPI. It sets the api_base_url to the CometAPI endpoint and allows for all the standard configurations available in the OpenAIChatGenerator.

Arguments:

  • api_key: The API key for authenticating with the CometAPI. Defaults to loading from the "COMET_API_KEY" environment variable.
  • model: The name of the model to use for chat generation (e.g., "gpt-5-mini", "grok-3-mini"). Defaults to "gpt-5-mini".
  • streaming_callback: An optional callable that will be called with each chunk of a streaming response.
  • generation_kwargs: Optional keyword arguments to pass to the underlying generation API call.
  • timeout: The maximum time in seconds to wait for a response from the API.
  • max_retries: The maximum number of times to retry a failed API request.
  • tools: An optional list of tool definitions that the model can use.
  • tools_strict: If True, the model is forced to use one of the provided tools if a tool call is made.
  • http_client_kwargs: Optional keyword arguments to pass to the HTTP client.