Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@langchain/anthropic

Package Overview
Dependencies
Maintainers
11
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@langchain/anthropic - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2-rc.0

6

dist/chat_models.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc