docs: add-xai-component (#6714)

* add-xai-component

* docs: update xAI component documentation with Grok link
This commit is contained in:
Mendon Kissling 2025-02-19 12:34:49 -05:00 committed by GitHub
commit d143fe4939
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -496,4 +496,29 @@ For more information, see [Google Vertex AI documentation](https://cloud.google.
|--------|---------------|-----------------------------------------------------|
| model | LanguageModel | An instance of ChatVertexAI configured with the specified parameters. |
## xAI
This component generates text using xAI models like [Grok](https://x.ai/grok).
For more information, see the [xAI documentation](https://x.ai/).
### Inputs
| Name | Type | Description |
|----------------|---------------|-----------------------------------------------------------------|
| max_tokens | Integer | Maximum number of tokens to generate. Set to `0` for unlimited. Range: `0-128000`. |
| model_kwargs | Dictionary | Additional keyword arguments for the model. |
| json_mode | Boolean | If `True`, outputs JSON regardless of passing a schema. |
| model_name | String | The xAI model to use. Default: `grok-2-latest`. |
| base_url | String | Base URL for API requests. Default: `https://api.x.ai/v1`. |
| api_key | SecretString | Your xAI API key for authentication. |
| temperature | Float | Controls randomness in the output. Range: `[0.0, 2.0]`. Default: `0.1`. |
| seed | Integer | Controls reproducibility of the job. |
### Outputs
| Name | Type | Description |
|-------|---------------|------------------------------------------------------------------|
| model | LanguageModel | An instance of ChatOpenAI configured with the specified parameters. |