@langchain/anthropic
Advanced tools
Comparing version 0.3.1 to 0.3.2-rc.0
@@ -13,3 +13,3 @@ import { Anthropic } from "@anthropic-ai/sdk"; | ||
import { extractToolCallChunk, handleToolChoice } from "./utils/tools.js"; | ||
import { _formatMessagesForAnthropic } from "./utils/message_inputs.js"; | ||
import { _convertMessagesToAnthropic } from "./utils/message_inputs.js"; | ||
import { _makeMessageChunkFromAnthropicEvent, anthropicResponseToChatMessages, } from "./utils/message_outputs.js"; | ||
@@ -662,3 +662,3 @@ function _toolsInParams(params) { | ||
const params = this.invocationParams(options); | ||
const formattedMessages = _formatMessagesForAnthropic(messages); | ||
const formattedMessages = _convertMessagesToAnthropic(messages); | ||
const coerceContentToString = !_toolsInParams({ | ||
@@ -714,3 +714,3 @@ ...params, | ||
stream: false, | ||
..._formatMessagesForAnthropic(messages), | ||
..._convertMessagesToAnthropic(messages), | ||
}, requestOptions); | ||
@@ -717,0 +717,0 @@ const { content, ...additionalKwargs } = response; |
export * from "./chat_models.js"; | ||
export { _convertMessagesToAnthropic } from "./utils/message_inputs.js"; |
export * from "./chat_models.js"; | ||
export { _convertMessagesToAnthropic } from "./utils/message_inputs.js"; |
@@ -10,5 +10,6 @@ /** | ||
* Formats messages as a prompt for the model. | ||
* Used in LangSmith, export is important here. | ||
* @param messages The base messages to format as a prompt. | ||
* @returns The formatted prompt. | ||
*/ | ||
export declare function _formatMessagesForAnthropic(messages: BaseMessage[]): AnthropicMessageCreateParams; | ||
export declare function _convertMessagesToAnthropic(messages: BaseMessage[]): AnthropicMessageCreateParams; |
@@ -162,6 +162,7 @@ /** | ||
* Formats messages as a prompt for the model. | ||
* Used in LangSmith, export is important here. | ||
* @param messages The base messages to format as a prompt. | ||
* @returns The formatted prompt. | ||
*/ | ||
export function _formatMessagesForAnthropic(messages) { | ||
export function _convertMessagesToAnthropic(messages) { | ||
const mergedMessages = _mergeMessages(messages); | ||
@@ -168,0 +169,0 @@ let system; |
{ | ||
"name": "@langchain/anthropic", | ||
"version": "0.3.1", | ||
"version": "0.3.2-rc.0", | ||
"description": "Anthropic integrations for LangChain.js", | ||
@@ -5,0 +5,0 @@ "type": "module", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
180613
4711