Socket
Socket
Sign inDemoInstall

@langchain/openai

Package Overview
Dependencies
Maintainers
5
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@langchain/openai - npm Package Compare versions

Comparing version 0.0.21 to 0.0.22

12

dist/chat_models.js

@@ -648,5 +648,11 @@ import { OpenAI as OpenAIClient } from "openai";

if (openAIMessage.additional_kwargs.function_call?.arguments) {
count += await this.getNumTokens(
// Remove newlines and spaces
JSON.stringify(JSON.parse(openAIMessage.additional_kwargs.function_call?.arguments)));
try {
count += await this.getNumTokens(
// Remove newlines and spaces
JSON.stringify(JSON.parse(openAIMessage.additional_kwargs.function_call?.arguments)));
}
catch (error) {
console.error("Error parsing function arguments", error, JSON.stringify(openAIMessage.additional_kwargs.function_call));
count += await this.getNumTokens(openAIMessage.additional_kwargs.function_call?.arguments);
}
}

@@ -653,0 +659,0 @@ totalCount += count;

@@ -524,2 +524,3 @@ import { test, jest, expect } from "@jest/globals";

}).bind({
seed: 42,
functions: [extractionFunctionSchema],

@@ -547,2 +548,3 @@ function_call: { name: "extractor" },

}).bind({
seed: 42,
functions: [extractionFunctionSchema],

@@ -549,0 +551,0 @@ function_call: { name: "extractor" },

{
"name": "@langchain/openai",
"version": "0.0.21",
"version": "0.0.22",
"description": "OpenAI integrations for LangChain.js",

@@ -5,0 +5,0 @@ "type": "module",

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