UNPKG

@langchain/anthropic

Version:
1 lines 31.2 kB
{"version":3,"file":"chat_models.d.cts","names":["Anthropic","ClientOptions","Stream","CallbackManagerForLLMRun","AIMessageChunk","BaseMessage","ChatGenerationChunk","ChatResult","BaseChatModel","BaseChatModelCallOptions","LangSmithParams","BaseChatModelParams","StructuredOutputMethodOptions","BaseLanguageModelInput","ModelProfile","Runnable","InteropZodType","AnthropicContextManagementConfigParam","AnthropicInvocationParams","AnthropicMessageCreateParams","AnthropicMessageStreamEvent","AnthropicRequestOptions","AnthropicStreamingMessageCreateParams","AnthropicThinkingConfigParam","AnthropicToolChoice","ChatAnthropicOutputFormat","ChatAnthropicToolType","AnthropicMCPServerURLDefinition","Kwargs","AnthropicBeta","ChatAnthropicCallOptions","AnthropicInput","Record","Pick","AnthropicMessagesModelId","Model","NonNullable","ChatAnthropicInput","ChatAnthropicMessages","RunOutput","CallOptions","Messages","ToolUnion","Partial","Metadata","TextBlockParam","ThinkingConfigParam","ToolChoice","AsyncGenerator","MessageCreateParamsNonStreaming","MessageCreateParamsStreaming","Omit","_langchain_core_outputs0","ChatGeneration","StopReason","Usage","Promise","Message","ChatAnthropic"],"sources":["../src/chat_models.d.ts"],"sourcesContent":["import { Anthropic, type ClientOptions } from \"@anthropic-ai/sdk\";\nimport type { Stream } from \"@anthropic-ai/sdk/streaming\";\nimport { CallbackManagerForLLMRun } from \"@langchain/core/callbacks/manager\";\nimport { AIMessageChunk, type BaseMessage } from \"@langchain/core/messages\";\nimport { ChatGenerationChunk, type ChatResult } from \"@langchain/core/outputs\";\nimport { BaseChatModel, BaseChatModelCallOptions, LangSmithParams, type BaseChatModelParams } from \"@langchain/core/language_models/chat_models\";\nimport { type StructuredOutputMethodOptions, type BaseLanguageModelInput } from \"@langchain/core/language_models/base\";\nimport { ModelProfile } from \"@langchain/core/language_models/profile\";\nimport { Runnable } from \"@langchain/core/runnables\";\nimport { InteropZodType } from \"@langchain/core/utils/types\";\nimport { AnthropicContextManagementConfigParam, AnthropicInvocationParams, AnthropicMessageCreateParams, AnthropicMessageStreamEvent, AnthropicRequestOptions, AnthropicStreamingMessageCreateParams, AnthropicThinkingConfigParam, AnthropicToolChoice, ChatAnthropicOutputFormat, ChatAnthropicToolType, AnthropicMCPServerURLDefinition, Kwargs } from \"./types.js\";\nimport { AnthropicBeta } from \"@anthropic-ai/sdk/resources\";\nexport interface ChatAnthropicCallOptions extends BaseChatModelCallOptions, Pick<AnthropicInput, \"streamUsage\"> {\n tools?: ChatAnthropicToolType[];\n /**\n * Whether or not to specify what tool the model should use\n * @default \"auto\"\n */\n tool_choice?: AnthropicToolChoice;\n /**\n * Custom headers to pass to the Anthropic API\n * when making a request.\n */\n headers?: Record<string, string>;\n /**\n * Container ID for file persistence across turns with code execution.\n * Used with the code_execution_20250825 tool.\n */\n container?: string;\n /**\n * Output format to use for the response.\n */\n output_format?: ChatAnthropicOutputFormat;\n /**\n * Optional array of beta features to enable for the Anthropic API.\n * Beta features are experimental capabilities that may change or be removed.\n * See https://docs.anthropic.com/en/api/versioning for available beta features.\n */\n betas?: AnthropicBeta[];\n /**\n * Array of MCP server URLs to use for the request.\n */\n mcp_servers?: AnthropicMCPServerURLDefinition[];\n}\n/**\n * @see https://docs.anthropic.com/claude/docs/models-overview\n */\nexport type AnthropicMessagesModelId = Anthropic.Model | (string & NonNullable<unknown>);\n/**\n * Input to AnthropicChat class.\n */\nexport interface AnthropicInput {\n /**\n * Amount of randomness injected into the response. Ranges\n * from 0 to 1. Use temperature closer to 0 for analytical /\n * multiple choice, and temperature closer to 1 for creative\n * and generative tasks.\n */\n temperature?: number;\n /**\n * Only sample from the top K options for each subsequent\n * token. Used to remove \"long tail\" low probability\n * responses.\n */\n topK?: number;\n /**\n * Does nucleus sampling, in which we compute the\n * cumulative distribution over all the options for each\n * subsequent token in decreasing probability order and\n * cut it off once it reaches a particular probability\n * specified by top_p. Note that you should either alter\n * temperature or top_p, but not both.\n */\n topP?: number | null;\n /** A maximum number of tokens to generate before stopping. */\n maxTokens?: number;\n /**\n * A list of strings upon which to stop generating.\n * You probably want `[\"\\n\\nHuman:\"]`, as that's the cue for\n * the next turn in the dialog agent.\n */\n stopSequences?: string[];\n /** Whether to stream the results or not */\n streaming?: boolean;\n /** Anthropic API key */\n anthropicApiKey?: string;\n /** Anthropic API key */\n apiKey?: string;\n /** Anthropic API URL */\n anthropicApiUrl?: string;\n /** @deprecated Use \"model\" instead */\n modelName?: AnthropicMessagesModelId;\n /** Model name to use */\n model?: AnthropicMessagesModelId;\n /** Overridable Anthropic ClientOptions */\n clientOptions?: ClientOptions;\n /** Holds any additional parameters that are valid to pass to {@link\n * https://console.anthropic.com/docs/api/reference |\n * `anthropic.messages`} that are not explicitly specified on this class.\n */\n invocationKwargs?: Kwargs;\n /**\n * Whether or not to include token usage data in streamed chunks.\n * @default true\n */\n streamUsage?: boolean;\n /**\n * Optional method that returns an initialized underlying Anthropic client.\n * Useful for accessing Anthropic models hosted on other cloud services\n * such as Google Vertex.\n */\n createClient?: (options: ClientOptions) => any;\n /**\n * Options for extended thinking.\n */\n thinking?: AnthropicThinkingConfigParam;\n /**\n * Configuration for context management. See https://docs.claude.com/en/docs/build-with-claude/context-editing\n */\n contextManagement?: AnthropicContextManagementConfigParam;\n /**\n * Optional array of beta features to enable for the Anthropic API.\n * Beta features are experimental capabilities that may change or be removed.\n * See https://docs.claude.com/en/api/beta-headers for available beta features.\n */\n betas?: AnthropicBeta[];\n}\n/**\n * Input to ChatAnthropic class.\n */\nexport type ChatAnthropicInput = AnthropicInput & BaseChatModelParams;\n/**\n * Anthropic chat model integration.\n *\n * Setup:\n * Install `@langchain/anthropic` and set an environment variable named `ANTHROPIC_API_KEY`.\n *\n * ```bash\n * npm install @langchain/anthropic\n * export ANTHROPIC_API_KEY=\"your-api-key\"\n * ```\n *\n * ## [Constructor args](https://api.js.langchain.com/classes/langchain_anthropic.ChatAnthropic.html#constructor)\n *\n * ## [Runtime args](https://api.js.langchain.com/interfaces/langchain_anthropic.ChatAnthropicCallOptions.html)\n *\n * Runtime args can be passed as the second argument to any of the base runnable methods `.invoke`. `.stream`, `.batch`, etc.\n * They can also be passed via `.bind`, or the second arg in `.bindTools`, like shown in the examples below:\n *\n * ```typescript\n * // When calling `.bind`, call options should be passed via the first argument\n * const llmWithArgsBound = llm.bindTools([...]).withConfig({\n * stop: [\"\\n\"],\n * });\n *\n * // When calling `.bindTools`, call options should be passed via the second argument\n * const llmWithTools = llm.bindTools(\n * [...],\n * {\n * tool_choice: \"auto\",\n * }\n * );\n * ```\n *\n * ## Examples\n *\n * <details open>\n * <summary><strong>Instantiate</strong></summary>\n *\n * ```typescript\n * import { ChatAnthropic } from '@langchain/anthropic';\n *\n * const llm = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\",\n * temperature: 0,\n * maxTokens: undefined,\n * maxRetries: 2,\n * // apiKey: \"...\",\n * // baseUrl: \"...\",\n * // other params...\n * });\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Invoking</strong></summary>\n *\n * ```typescript\n * const input = `Translate \"I love programming\" into French.`;\n *\n * // Models also accept a list of chat messages or a formatted prompt\n * const result = await llm.invoke(input);\n * console.log(result);\n * ```\n *\n * ```txt\n * AIMessage {\n * \"id\": \"msg_01QDpd78JUHpRP6bRRNyzbW3\",\n * \"content\": \"Here's the translation to French:\\n\\nJ'adore la programmation.\",\n * \"response_metadata\": {\n * \"id\": \"msg_01QDpd78JUHpRP6bRRNyzbW3\",\n * \"model\": \"claude-sonnet-4-5-20250929\",\n * \"stop_reason\": \"end_turn\",\n * \"stop_sequence\": null,\n * \"usage\": {\n * \"input_tokens\": 25,\n * \"output_tokens\": 19\n * },\n * \"type\": \"message\",\n * \"role\": \"assistant\"\n * },\n * \"usage_metadata\": {\n * \"input_tokens\": 25,\n * \"output_tokens\": 19,\n * \"total_tokens\": 44\n * }\n * }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Streaming Chunks</strong></summary>\n *\n * ```typescript\n * for await (const chunk of await llm.stream(input)) {\n * console.log(chunk);\n * }\n * ```\n *\n * ```txt\n * AIMessageChunk {\n * \"id\": \"msg_01N8MwoYxiKo9w4chE4gXUs4\",\n * \"content\": \"\",\n * \"additional_kwargs\": {\n * \"id\": \"msg_01N8MwoYxiKo9w4chE4gXUs4\",\n * \"type\": \"message\",\n * \"role\": \"assistant\",\n * \"model\": \"claude-sonnet-4-5-20250929\"\n * },\n * \"usage_metadata\": {\n * \"input_tokens\": 25,\n * \"output_tokens\": 1,\n * \"total_tokens\": 26\n * }\n * }\n * AIMessageChunk {\n * \"content\": \"\",\n * }\n * AIMessageChunk {\n * \"content\": \"Here\",\n * }\n * AIMessageChunk {\n * \"content\": \"'s\",\n * }\n * AIMessageChunk {\n * \"content\": \" the translation to\",\n * }\n * AIMessageChunk {\n * \"content\": \" French:\\n\\nJ\",\n * }\n * AIMessageChunk {\n * \"content\": \"'adore la programmation\",\n * }\n * AIMessageChunk {\n * \"content\": \".\",\n * }\n * AIMessageChunk {\n * \"content\": \"\",\n * \"additional_kwargs\": {\n * \"stop_reason\": \"end_turn\",\n * \"stop_sequence\": null\n * },\n * \"usage_metadata\": {\n * \"input_tokens\": 0,\n * \"output_tokens\": 19,\n * \"total_tokens\": 19\n * }\n * }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Aggregate Streamed Chunks</strong></summary>\n *\n * ```typescript\n * import { AIMessageChunk } from '@langchain/core/messages';\n * import { concat } from '@langchain/core/utils/stream';\n *\n * const stream = await llm.stream(input);\n * let full: AIMessageChunk | undefined;\n * for await (const chunk of stream) {\n * full = !full ? chunk : concat(full, chunk);\n * }\n * console.log(full);\n * ```\n *\n * ```txt\n * AIMessageChunk {\n * \"id\": \"msg_01SBTb5zSGXfjUc7yQ8EKEEA\",\n * \"content\": \"Here's the translation to French:\\n\\nJ'adore la programmation.\",\n * \"additional_kwargs\": {\n * \"id\": \"msg_01SBTb5zSGXfjUc7yQ8EKEEA\",\n * \"type\": \"message\",\n * \"role\": \"assistant\",\n * \"model\": \"claude-sonnet-4-5-20250929\",\n * \"stop_reason\": \"end_turn\",\n * \"stop_sequence\": null\n * },\n * \"usage_metadata\": {\n * \"input_tokens\": 25,\n * \"output_tokens\": 20,\n * \"total_tokens\": 45\n * }\n * }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Bind tools</strong></summary>\n *\n * ```typescript\n * import { z } from 'zod';\n *\n * const GetWeather = {\n * name: \"GetWeather\",\n * description: \"Get the current weather in a given location\",\n * schema: z.object({\n * location: z.string().describe(\"The city and state, e.g. San Francisco, CA\")\n * }),\n * }\n *\n * const GetPopulation = {\n * name: \"GetPopulation\",\n * description: \"Get the current population in a given location\",\n * schema: z.object({\n * location: z.string().describe(\"The city and state, e.g. San Francisco, CA\")\n * }),\n * }\n *\n * const llmWithTools = llm.bindTools([GetWeather, GetPopulation]);\n * const aiMsg = await llmWithTools.invoke(\n * \"Which city is hotter today and which is bigger: LA or NY?\"\n * );\n * console.log(aiMsg.tool_calls);\n * ```\n *\n * ```txt\n * [\n * {\n * name: 'GetWeather',\n * args: { location: 'Los Angeles, CA' },\n * id: 'toolu_01WjW3Dann6BPJVtLhovdBD5',\n * type: 'tool_call'\n * },\n * {\n * name: 'GetWeather',\n * args: { location: 'New York, NY' },\n * id: 'toolu_01G6wfJgqi5zRmJomsmkyZXe',\n * type: 'tool_call'\n * },\n * {\n * name: 'GetPopulation',\n * args: { location: 'Los Angeles, CA' },\n * id: 'toolu_0165qYWBA2VFyUst5RA18zew',\n * type: 'tool_call'\n * },\n * {\n * name: 'GetPopulation',\n * args: { location: 'New York, NY' },\n * id: 'toolu_01PGNyP33vxr13tGqr7i3rDo',\n * type: 'tool_call'\n * }\n * ]\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Tool Search</strong></summary>\n *\n * Tool search enables Claude to dynamically discover and load tools on-demand\n * instead of loading all tool definitions upfront. This is useful when you have\n * many tools but want to avoid the overhead of sending all definitions with every request.\n *\n * ```typescript\n * import { ChatAnthropic } from \"@langchain/anthropic\";\n *\n * const model = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\",\n * });\n *\n * const tools = [\n * // Tool search server tool\n * {\n * type: \"tool_search_tool_regex_20251119\",\n * name: \"tool_search_tool_regex\",\n * },\n * // Tools with defer_loading are loaded on-demand\n * {\n * name: \"get_weather\",\n * description: \"Get the current weather for a location\",\n * input_schema: {\n * type: \"object\",\n * properties: {\n * location: { type: \"string\", description: \"City name\" },\n * unit: {\n * type: \"string\",\n * enum: [\"celsius\", \"fahrenheit\"],\n * },\n * },\n * required: [\"location\"],\n * },\n * defer_loading: true, // Tool is loaded on-demand\n * },\n * {\n * name: \"search_files\",\n * description: \"Search through files in the workspace\",\n * input_schema: {\n * type: \"object\",\n * properties: {\n * query: { type: \"string\" },\n * },\n * required: [\"query\"],\n * },\n * defer_loading: true, // Tool is loaded on-demand\n * },\n * ];\n *\n * const modelWithTools = model.bindTools(tools);\n * const response = await modelWithTools.invoke(\"What's the weather in San Francisco?\");\n * ```\n *\n * You can also use the `tool()` helper with the `extras` field:\n *\n * ```typescript\n * import { tool } from \"@langchain/core/tools\";\n * import { z } from \"zod\";\n *\n * const getWeather = tool(\n * async (input) => `Weather in ${input.location}`,\n * {\n * name: \"get_weather\",\n * description: \"Get weather for a location\",\n * schema: z.object({ location: z.string() }),\n * extras: { defer_loading: true },\n * }\n * );\n * ```\n *\n * **Note:** The required `advanced-tool-use-2025-11-20` beta header is automatically\n * appended to the request when using tool search tools.\n *\n * **Best practices:**\n * - Tools with `defer_loading: true` are only loaded when Claude discovers them via search\n * - Keep your 3-5 most frequently used tools as non-deferred for optimal performance\n * - Both regex and bm25 variants search tool names, descriptions, and argument info\n *\n * See the {@link https://platform.claude.com/docs/en/agents-and-tools/tool-use/tool-search-tool | Claude docs}\n * for more information.\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Structured Output</strong></summary>\n *\n * ChatAnthropic supports structured output through two main approaches:\n *\n * 1. **Function Calling with `withStructuredOutput()`**: Uses Anthropic's tool calling\n * under the hood to constrain outputs to a specific schema.\n * 2. **JSON Schema Mode**: Uses Anthropic's native JSON schema support for direct\n * structured output without tool calling overhead.\n *\n * **Using withStructuredOutput (Function Calling)**\n *\n * This method leverages Anthropic's tool calling capabilities to ensure the model\n * returns data matching your schema:\n *\n * ```typescript\n * import { z } from 'zod';\n *\n * const Joke = z.object({\n * setup: z.string().describe(\"The setup of the joke\"),\n * punchline: z.string().describe(\"The punchline to the joke\"),\n * rating: z.number().optional().describe(\"How funny the joke is, from 1 to 10\")\n * }).describe('Joke to tell user.');\n *\n * const structuredLlm = llm.withStructuredOutput(Joke, { name: \"Joke\" });\n * const jokeResult = await structuredLlm.invoke(\"Tell me a joke about cats\");\n * console.log(jokeResult);\n * ```\n *\n * ```txt\n * {\n * setup: \"Why don't cats play poker in the jungle?\",\n * punchline: 'Too many cheetahs!',\n * rating: 7\n * }\n * ```\n *\n * **Using JSON Schema Mode**\n *\n * For more direct control, you can use Anthropic's native JSON schema support by\n * passing `method: \"jsonSchema\"`:\n *\n * ```typescript\n * import { z } from 'zod';\n *\n * const RecipeSchema = z.object({\n * recipeName: z.string().describe(\"Name of the recipe\"),\n * ingredients: z.array(z.string()).describe(\"List of ingredients needed\"),\n * steps: z.array(z.string()).describe(\"Cooking steps in order\"),\n * prepTime: z.number().describe(\"Preparation time in minutes\")\n * });\n *\n * const structuredLlm = llm.withStructuredOutput(RecipeSchema, {\n * method: \"jsonSchema\"\n * });\n *\n * const recipe = await structuredLlm.invoke(\n * \"Give me a simple recipe for chocolate chip cookies\"\n * );\n * console.log(recipe);\n * ```\n *\n * ```txt\n * {\n * recipeName: 'Classic Chocolate Chip Cookies',\n * ingredients: [\n * '2 1/4 cups all-purpose flour',\n * '1 cup butter, softened',\n * ...\n * ],\n * steps: [\n * 'Preheat oven to 375°F',\n * 'Mix butter and sugars until creamy',\n * ...\n * ],\n * prepTime: 15\n * }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Multimodal</strong></summary>\n *\n * ```typescript\n * import { HumanMessage } from '@langchain/core/messages';\n *\n * const imageUrl = \"https://example.com/image.jpg\";\n * const imageData = await fetch(imageUrl).then(res => res.arrayBuffer());\n * const base64Image = Buffer.from(imageData).toString('base64');\n *\n * const message = new HumanMessage({\n * content: [\n * { type: \"text\", text: \"describe the weather in this image\" },\n * {\n * type: \"image_url\",\n * image_url: { url: `data:image/jpeg;base64,${base64Image}` },\n * },\n * ]\n * });\n *\n * const imageDescriptionAiMsg = await llm.invoke([message]);\n * console.log(imageDescriptionAiMsg.content);\n * ```\n *\n * ```txt\n * The weather in this image appears to be beautiful and clear. The sky is a vibrant blue with scattered white clouds, suggesting a sunny and pleasant day. The clouds are wispy and light, indicating calm conditions without any signs of storms or heavy weather. The bright green grass on the rolling hills looks lush and well-watered, which could mean recent rainfall or good growing conditions. Overall, the scene depicts a perfect spring or early summer day with mild temperatures, plenty of sunshine, and gentle breezes - ideal weather for enjoying the outdoors or for plant growth.\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Usage Metadata</strong></summary>\n *\n * ```typescript\n * const aiMsgForMetadata = await llm.invoke(input);\n * console.log(aiMsgForMetadata.usage_metadata);\n * ```\n *\n * ```txt\n * { input_tokens: 25, output_tokens: 19, total_tokens: 44 }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Stream Usage Metadata</strong></summary>\n *\n * ```typescript\n * const streamForMetadata = await llm.stream(\n * input,\n * {\n * streamUsage: true\n * }\n * );\n * let fullForMetadata: AIMessageChunk | undefined;\n * for await (const chunk of streamForMetadata) {\n * fullForMetadata = !fullForMetadata ? chunk : concat(fullForMetadata, chunk);\n * }\n * console.log(fullForMetadata?.usage_metadata);\n * ```\n *\n * ```txt\n * { input_tokens: 25, output_tokens: 20, total_tokens: 45 }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Response Metadata</strong></summary>\n *\n * ```typescript\n * const aiMsgForResponseMetadata = await llm.invoke(input);\n * console.log(aiMsgForResponseMetadata.response_metadata);\n * ```\n *\n * ```txt\n * {\n * id: 'msg_01STxeQxJmp4sCSpioD6vK3L',\n * model: 'claude-sonnet-4-5-20250929',\n * stop_reason: 'end_turn',\n * stop_sequence: null,\n * usage: { input_tokens: 25, output_tokens: 19 },\n * type: 'message',\n * role: 'assistant'\n * }\n * ```\n * </details>\n *\n * <br />\n */\nexport declare class ChatAnthropicMessages<CallOptions extends ChatAnthropicCallOptions = ChatAnthropicCallOptions> extends BaseChatModel<CallOptions, AIMessageChunk> implements AnthropicInput {\n static lc_name(): string;\n get lc_secrets(): {\n [key: string]: string;\n } | undefined;\n get lc_aliases(): Record<string, string>;\n lc_serializable: boolean;\n anthropicApiKey?: string;\n apiKey?: string;\n apiUrl?: string;\n temperature?: number;\n topK?: number;\n topP?: number;\n maxTokens: number;\n modelName: string;\n model: string;\n invocationKwargs?: Kwargs;\n stopSequences?: string[];\n streaming: boolean;\n clientOptions: ClientOptions;\n thinking: AnthropicThinkingConfigParam;\n contextManagement?: AnthropicContextManagementConfigParam;\n protected batchClient: Anthropic;\n protected streamingClient: Anthropic;\n streamUsage: boolean;\n betas?: AnthropicBeta[];\n /**\n * Optional method that returns an initialized underlying Anthropic client.\n * Useful for accessing Anthropic models hosted on other cloud services\n * such as Google Vertex.\n */\n createClient: (options: ClientOptions) => Anthropic;\n constructor(fields?: ChatAnthropicInput);\n getLsParams(options: this[\"ParsedCallOptions\"]): LangSmithParams;\n /**\n * Formats LangChain StructuredTools to AnthropicTools.\n *\n * @param {ChatAnthropicCallOptions[\"tools\"]} tools The tools to format\n * @returns {AnthropicTool[] | undefined} The formatted tools, or undefined if none are passed.\n */\n formatStructuredToolToAnthropic(tools: ChatAnthropicCallOptions[\"tools\"]): Anthropic.Messages.ToolUnion[] | undefined;\n bindTools(tools: ChatAnthropicToolType[], kwargs?: Partial<CallOptions>): Runnable<BaseLanguageModelInput, AIMessageChunk, CallOptions>;\n /**\n * Get the parameters used to invoke the model\n */\n invocationParams(options?: this[\"ParsedCallOptions\"]): AnthropicInvocationParams;\n /** @ignore */\n _identifyingParams(): {\n max_tokens: number;\n model: Anthropic.Model;\n metadata?: Anthropic.Metadata | undefined;\n service_tier?: \"auto\" | \"standard_only\" | undefined;\n stop_sequences?: string[] | undefined;\n system?: string | Anthropic.TextBlockParam[] | undefined;\n temperature?: number | undefined;\n thinking?: Anthropic.ThinkingConfigParam | undefined;\n tool_choice?: Anthropic.ToolChoice | undefined;\n tools?: Anthropic.ToolUnion[] | undefined;\n top_k?: number | undefined;\n top_p?: number | undefined;\n stream?: boolean | undefined;\n model_name: string;\n };\n /**\n * Get the identifying parameters for the model\n */\n identifyingParams(): {\n max_tokens: number;\n model: Anthropic.Model;\n metadata?: Anthropic.Metadata | undefined;\n service_tier?: \"auto\" | \"standard_only\" | undefined;\n stop_sequences?: string[] | undefined;\n system?: string | Anthropic.TextBlockParam[] | undefined;\n temperature?: number | undefined;\n thinking?: Anthropic.ThinkingConfigParam | undefined;\n tool_choice?: Anthropic.ToolChoice | undefined;\n tools?: Anthropic.ToolUnion[] | undefined;\n top_k?: number | undefined;\n top_p?: number | undefined;\n stream?: boolean | undefined;\n model_name: string;\n };\n _streamResponseChunks(messages: BaseMessage[], options: this[\"ParsedCallOptions\"], runManager?: CallbackManagerForLLMRun): AsyncGenerator<ChatGenerationChunk>;\n /** @ignore */\n _generateNonStreaming(messages: BaseMessage[], params: Omit<Anthropic.Messages.MessageCreateParamsNonStreaming | Anthropic.Messages.MessageCreateParamsStreaming, \"messages\"> & Kwargs, requestOptions: AnthropicRequestOptions): Promise<{\n generations: import(\"@langchain/core/outputs\").ChatGeneration[];\n llmOutput: {\n id: string;\n model: Anthropic.Model;\n stop_reason: Anthropic.StopReason | null;\n stop_sequence: string | null;\n usage: Anthropic.Usage;\n };\n }>;\n /** @ignore */\n _generate(messages: BaseMessage[], options: this[\"ParsedCallOptions\"], runManager?: CallbackManagerForLLMRun): Promise<ChatResult>;\n /**\n * Creates a streaming request with retry.\n * @param request The parameters for creating a completion.\n * @param options\n * @returns A streaming request.\n */\n protected createStreamWithRetry(request: AnthropicStreamingMessageCreateParams & Kwargs, options?: AnthropicRequestOptions): Promise<Stream<AnthropicMessageStreamEvent>>;\n /** @ignore */\n protected completionWithRetry(request: AnthropicMessageCreateParams & Kwargs, options: AnthropicRequestOptions): Promise<Anthropic.Message>;\n _llmType(): string;\n /**\n * Return profiling information for the model.\n *\n * Provides information about the model's capabilities and constraints,\n * including token limits, multimodal support, and advanced features like\n * tool calling and structured output.\n *\n * @returns {ModelProfile} An object describing the model's capabilities and constraints\n *\n * @example\n * ```typescript\n * const model = new ChatAnthropic({ model: \"claude-opus-4-0\" });\n * const profile = model.profile;\n * console.log(profile.maxInputTokens); // 200000\n * console.log(profile.imageInputs); // true\n * ```\n */\n get profile(): ModelProfile;\n withStructuredOutput<RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: InteropZodType<RunOutput> | Record<string, any>, config?: StructuredOutputMethodOptions<false>): Runnable<BaseLanguageModelInput, RunOutput>;\n withStructuredOutput<RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: InteropZodType<RunOutput> | Record<string, any>, config?: StructuredOutputMethodOptions<true>): Runnable<BaseLanguageModelInput, {\n raw: BaseMessage;\n parsed: RunOutput;\n }>;\n}\nexport declare class ChatAnthropic extends ChatAnthropicMessages {\n}\n//# sourceMappingURL=chat_models.d.ts.map"],"mappings":";;;;;;;;;;;;;;;UAYiB8B,wBAAAA,SAAiCrB,0BAA0BwB,KAAKF;UACrEL;;AADZ;;;EAMkBF,WAAAA,CAAAA,EAAAA,mBAAAA;EAKJQ;;;;EAXoCvB,OAAAA,CAAAA,EAWpCuB,MAXoCvB,CAAAA,MAAAA,EAAAA,MAAAA,CAAAA;EAA0BwB;AAAI;AAmChF;AAIA;EAwCgBC,SAAAA,CAAAA,EAAAA,MAAAA;EAEJA;;;EAkBiBjC,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