xAI Responses API chat model integration.
This class provides access to xAI's Responses API, which offers enhanced capabilities including built-in tools, reasoning, and search.
class ChatXAIResponsesBaseChatModel<CallOptions>import { ChatXAIResponses } from "@langchain/xai";
const llm = new ChatXAIResponses({
model: "grok-3",
temperature: 0.7,
});
const result = await llm.invoke("What is the capital of France?");
console.log(result.content);The async caller should be used by subclasses to make any async calls, which will thus benefit from the concurrency and retry logic.
Whether to print out response text.