New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@re-ai/openai-like-api

Package Overview
Dependencies
Maintainers
0
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@re-ai/openai-like-api - npm Package Compare versions

Comparing version 0.2.11 to 0.2.12

14

dist/utils/stream.d.ts

@@ -23,5 +23,6 @@ import { Transform } from "stream";

onToolCall?: (data: {
name: string;
arguments: {
[key: string]: any;
id: string;
function: {
name: string;
arguments?: Record<string, any>;
};

@@ -69,5 +70,6 @@ }) => void;

onToolCall?: (data: {
name: string;
arguments: {
[key: string]: any;
id: string;
function: {
name: string;
arguments?: Record<string, any>;
};

@@ -74,0 +76,0 @@ }) => void;

@@ -145,25 +145,11 @@ "use strict";

delta.tool_calls?.forEach((toolCall, i) => {
if (!functionCalls[i]) {
functionCalls[i] = {
name: "",
arguments: ""
};
}
functionCalls[i].name += (toolCall.function?.name || "");
functionCalls[i].arguments += (toolCall.function?.arguments || "");
callbacks?.onToolCall && callbacks.onToolCall({
id: toolCall.id || "",
function: {
name: toolCall.function?.name || "",
arguments: toolCall.function?.arguments ? JSON.parse(toolCall.function?.arguments || "") : {}
}
});
});
}
functionCalls.map((functionCall) => {
try {
if (callbacks?.onToolCall) {
callbacks.onToolCall({
name: functionCall.name,
arguments: JSON.parse(functionCall.arguments)
});
}
}
catch (err) {
Logger_1.Logger.debug("parse arguments error", err);
}
});
return;

@@ -170,0 +156,0 @@ };

{
"name": "@re-ai/openai-like-api",
"version": "0.2.11",
"version": "0.2.12",
"description": "reai openai like api",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -149,5 +149,6 @@ import { Transform } from "stream";

onToolCall?: (data: {
name: string,
arguments: {
[key: string]: any
id: string,
function: {
name: string,
arguments?: Record<string, any>
}

@@ -186,27 +187,12 @@ }) => void,

delta.tool_calls?.forEach((toolCall, i) => {
if (!functionCalls[i]) {
functionCalls[i] = {
name: "",
arguments: ""
callbacks?.onToolCall && callbacks.onToolCall({
id: toolCall.id || "",
function: {
name: toolCall.function?.name || "",
arguments: toolCall.function?.arguments ? JSON.parse(toolCall.function?.arguments || "") : {}
}
}
functionCalls[i].name += (toolCall.function?.name || "")
functionCalls[i].arguments += (toolCall.function?.arguments || "")
})
})
}
functionCalls.map((functionCall) => {
try {
if (callbacks?.onToolCall) {
callbacks.onToolCall({
name: functionCall.name,
arguments: JSON.parse(functionCall.arguments)
})
}
} catch (err) {
Logger.debug("parse arguments error", err)
}
})
return

@@ -213,0 +199,0 @@ }

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