/** * ChatDatabricks - LangChain chat model integration for Databricks Model Serving * * Uses the Databricks AI SDK Provider internally to support multiple endpoint APIs: * - chat-completions: OpenAI-compatible chat completions API * - chat-agent: Databricks agent chat completion * - responses: Rich output with reasoning, citations, function calls */ import { BaseChatModel, BaseChatModelParams, BaseChatModelCallOptions, BindToolsInput } from "@langchain/core/language_models/chat_models"; import { BaseMessage } from "@langchain/core/messages"; import { ChatResult, ChatGenerationChunk } from "@langchain/core/outputs"; import { CallbackManagerForLLMRun } from "@langchain/core/callbacks/manager"; import { Config } from "@databricks/sdk-experimental"; /** * Endpoint API determines which Databricks API protocol to use */ export type EndpointAPI = "responses" | "chat-completions" | "chat-agent"; /** * Authentication options for Databricks */ type DatabricksSdkConfig = ConstructorParams[0]; type ConstructorParams = T extends new (...args: infer A) => any ? A : never; /** * Options that can be passed at call time */ export interface ChatDatabricksCallOptions extends BaseChatModelCallOptions { /** Temperature (0.0 - 2.0) */ temperature?: number; /** Max tokens to generate */ maxTokens?: number; /** Stop sequences */ stop?: string[]; /** Tools to use for this call */ tools?: BindToolsInput[]; /** Tool choice for this call */ toolChoice?: "auto" | "none" | "required" | "any" | string; /** Extra parameters to pass to the model */ extraParams?: Record; } /** * Input parameters for ChatDatabricks constructor */ export interface ChatDatabricksInput extends BaseChatModelParams { /** Model serving endpoint name */ model: string; /** * Whether to use the Responses API or Chat Completions API * * - Chat Completions: See https://docs.databricks.com/aws/en/machine-learning/foundation-model-apis/api-reference#chat-completions-api * - Responses: See https://docs.databricks.com/aws/en/machine-learning/foundation-model-apis/api-reference#responses-api * * @default false */ useResponsesApi?: boolean; /** * Authentication credentials for Databricks SDK. * If not provided Databricks SDK with automatically * attempt authentication using environment variables or CLI */ auth?: DatabricksSdkConfig; /** Temperature (0.0 - 2.0) */ temperature?: number; /** Max tokens to generate */ maxTokens?: number; /** Stop sequences */ stop?: string[]; /** Extra parameters to pass to the model */ extraParams?: Record; } /** * ChatDatabricks - Chat model integration for Databricks Model Serving * * Supports Chat Completions or Responses via `useResponsesApi`: * * @example Chat Completions * ```typescript * const llm = new ChatDatabricks({ * model: "databricks-claude-sonnet-4-5", * useResponsesApi: false, // can be omitted * }); * const response = await llm.invoke("Hello!"); * ``` * * @example Responses * ```typescript * const llm = new ChatDatabricks({ * model: "databricks-gpt-5-2", * useResponsesApi: true, * }); * const response = await llm.invoke("Hello!"); * ``` * * @example With explicit authentication * ```typescript * const llm = new ChatDatabricks({ * model: "databricks-claude-sonnet-4-5", * auth: { * host: "https://your-workspace.databricks.com", * token: "dapi...", * }, * }); * ``` */ export declare class ChatDatabricks extends BaseChatModel { static lc_name(): string; lc_serializable: boolean; /** Model serving endpoint name */ model: string; /** Whether to use the Responses API or Chat Completions API */ useResponsesApi?: boolean; /** Temperature (0.0 - 2.0) */ temperature?: number; /** Max tokens to generate */ maxTokens?: number; /** Stop sequences */ stop?: string[]; /** Extra parameters */ extraParams?: Record; /** Authentication credentials */ private auth?; /** Databricks AI SDK Provider */ private provider; /** AI SDK Language Model */ private languageModel; /** Bound tools */ private boundTools?; /** Bound tool choice */ private boundToolChoice?; constructor(fields: ChatDatabricksInput); /** * Create the Databricks AI SDK Provider with authentication */ private createProvider; private getLanguageModel; _llmType(): string; /** * Non-streaming chat completion */ _generate(messages: BaseMessage[], options: this["ParsedCallOptions"], runManager?: CallbackManagerForLLMRun): Promise; /** * Streaming chat completion */ _streamResponseChunks(messages: BaseMessage[], options: this["ParsedCallOptions"], runManager?: CallbackManagerForLLMRun): AsyncGenerator; /** * Bind tools to this model for function calling */ bindTools(tools: BindToolsInput[], kwargs?: Partial): InstanceType; /** * Get the identifying parameters for this model */ get identifyingParams(): Record; get lc_secrets(): { [key: string]: string; }; get lc_aliases(): { [key: string]: string; }; } export {};