X
Properties used to connect to xAI.
x
- Type: {
chat?: Chat,images?: Images} - Default: {chat: true}
Service Types
Chat
- Type:
true| {
model?: string,
max_tokens?: number,
temperature?: number,
system_prompt?: string
} - Default: {model: "grok-3-latest"}
Connect to X's chat API. You can set this property to true or configure it using an object:
model is the name of the X model to be used by the API.
max_tokens limits the maximum number of tokens in the generated response.
temperature controls the randomness of responses. Higher values produce more creative outputs.
system_prompt provides behavioral context and instructions to the model.
Example
- Sample code
- Full code
<deep-chat
directConnection='{
"x": {
"key": "placeholder key",
"chat": {"system_prompt": "You are a helpful assistant.", "temperature": 0.7}
}
}'
></deep-chat>
<!-- This example is for Vanilla JS and should be tailored to your framework (see Examples) -->
<deep-chat
directConnection='{
"x": {
"key": "placeholder key",
"chat": {"system_prompt": "You are a helpful assistant.", "temperature": 0.7}
}
}'
style="border-radius: 8px"
></deep-chat>
info
Use stream to stream the AI responses.
Images
- Type:
true| {model?: string,n?: number} - Default: {model: "grok-2-image"}
Connect to X's image generation API. You can set this property to true or configure it using an object:
model is the name of the image generation model.
n is the number of images to generate.
Example
- Sample code
- Full code
<deep-chat
directConnection='{
"x": {
"key": "placeholder key",
"images": true
}
}'
></deep-chat>
<!-- This example is for Vanilla JS and should be tailored to your framework (see Examples) -->
<deep-chat
directConnection='{
"x": {
"key": "placeholder key",
"images": true
}
}'
style="border-radius: 8px"
></deep-chat>