Skip to content

XAIClient

autogen.beta.config.xai.xai_client.XAIClient #

XAIClient(*, api_key=None, api_host='api.x.ai', timeout=None, metadata=None, channel_options=None, streaming=False, create_options=None)

Bases: LLMClient

Source code in autogen/beta/config/xai/xai_client.py
def __init__(
    self,
    *,
    api_key: str | None = None,
    api_host: str = "api.x.ai",
    timeout: float | None = None,
    metadata: tuple[tuple[str, str], ...] | None = None,
    channel_options: list[tuple[str, Any]] | None = None,
    streaming: bool = False,
    create_options: CreateOptions | None = None,
) -> None:
    self._client = AsyncClient(
        api_key=api_key,
        api_host=api_host,
        timeout=timeout,
        metadata=metadata,
        channel_options=channel_options,
    )
    self._create_options: dict[str, Any] = {k: v for k, v in (create_options or {}).items() if v is not None}
    self._streaming = streaming