Optionalfields: Partial<ChatXAIInput>Return profiling information for the model.
Provides information about the model's capabilities and constraints, including token limits, multimodal support, and advanced features like tool calling and structured output.
An object describing the model's capabilities and constraints
Protected_OptionaldefaultRole: "function" | "user" | "system" | "developer" | "assistant" | "tool"Protected_Optionaloptions: RequestOptionsOptionaloptions: RequestOptionsOptionalconfig: anyOptionalconfig: anyOptionalconfig: anyStaticlc_
xAI chat model integration.
The xAI API is compatible to the OpenAI API with some limitations.
Setup: Install
@langchain/xaiand set an environment variable namedXAI_API_KEY.Constructor args
Runtime args
Runtime args can be passed as the second argument to any of the base runnable methods
.invoke..stream,.batch, etc. They can also be passed via.withConfig, or the second arg in.bindTools, like shown in the examples below:Examples
Instantiate
Invoking
Streaming Chunks
Aggregate Streamed Chunks
Bind tools
Structured Output