Comparing version 0.7.5 to 0.7.6
@@ -189,3 +189,3 @@ import OpenAI from 'openai'; | ||
}; | ||
declare function returnFunctionCall(baseUrl: string, apiKey: string): (functionCallId: string, functionReturn: any) => Promise<void>; | ||
declare function returnFunctionCall(baseUrl: string, apiKey: string): (functionCallId: string, functionReturn: string) => Promise<void>; | ||
type NextMessageRes = ChatFunctionCall | ChatText | undefined; | ||
@@ -192,0 +192,0 @@ declare function nextMessage(baseUrl: string, apiKey: string): (workflowId: string) => Promise<NextMessageRes>; |
@@ -65,3 +65,3 @@ "use strict"; | ||
functionCallId, | ||
functionReturn: JSON.stringify(functionReturn) | ||
functionReturn | ||
}; | ||
@@ -276,4 +276,4 @@ return fetch(baseUrl + "/function_calls/" + functionCallId + "/return", { | ||
const callId = lastMessage.tool_call_id; | ||
const functionReturn = lastMessage.content; | ||
const functionCallRes = returnFunctionCall(this.baseUrl, this.apiKey)(callId, functionReturn); | ||
const functionReturn = lastMessage.content || ""; | ||
const functionCallRes = returnFunctionCall(this.baseUrl, this.apiKey)(callId, String(functionReturn)); | ||
const nextMessageRes = functionCallRes.then(() => poll(nextMessage(this.baseUrl, this.apiKey), [workflowId])); | ||
@@ -280,0 +280,0 @@ return nextMessageRes.then((r) => { |
{ | ||
"name": "iudex", | ||
"version": "0.7.5", | ||
"version": "0.7.6", | ||
"description": "Iudex client", | ||
"scripts": { | ||
"build": "tsup", | ||
"test": "jest" | ||
}, | ||
"main": "./dist/index.js", | ||
@@ -45,3 +41,7 @@ "module": "./dist/index.mjs", | ||
"zod": "^3.21.4" | ||
}, | ||
"scripts": { | ||
"build": "tsup", | ||
"test": "jest" | ||
} | ||
} | ||
} |
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
Sorry, the diff of this file is not supported yet
184981
9
2613
9
12