Call options for ChatXAIResponses.
interface ChatXAIResponsesCallOptionsCallbacks for this call and any sub-calls (eg. a Chain calling an LLM). Tags are passed to all callbacks, metadata is passed to handle*Start callbacks.
Runtime values for attributes previously made configurable on this Runnable, or sub-Runnables.
Specify additional output data to include in the model response.
Describes the format of structured outputs. This should be provided if an output is considered to be structured
Maximum number of parallel calls to make.
Version of AIMessage output format to store in message content.
AIMessage.contentBlocks will lazily parse the contents of content into a
standard format. This flag can be used to additionally store the standard format
as the message content, e.g., for serialization purposes.
.contentBlocks).contentBlocks)You can also set LC_OUTPUT_VERSION as an environment variable to "v1" to
enable this by default.
Whether to allow the model to run parallel tool calls.
The unique ID of the previous response to the model. Use this to create multi-turn conversations.
Reasoning configuration for reasoning models.
Maximum number of times a call can recurse. If not provided, defaults to 25.
Unique identifier for the tracer run for this call. If not provided, a new UUID will be generated.
Name for the tracer run for this call. Defaults to the name of the class.
Search parameters for xAI's search capabilities.
Abort signal for this call. If provided, the call will be aborted when the signal is aborted.
Stop tokens to use for this call. If not provided, the default stop tokens for the model will be used.
Configuration options for a text response from the model.
Timeout for this call in milliseconds.
Controls which tool is called by the model.
A list of tools the model may call. Includes built-in tools (web_search, x_search, code_interpreter, file_search) and custom function tools.
import { tools } from "@langchain/xai";
const result = await llm.invoke("What's happening on X?", {
tools: [tools.xaiWebSearch(), tools.xaiXSearch()],
});