2
0

🔒 Use vm instead of Function in Node.js (#1509)

This commit is contained in:
Baptiste Arnaud
2024-05-14 14:17:40 +02:00
committed by GitHub
parent 1afa25a015
commit 75c44d61d5
6 changed files with 42 additions and 24 deletions

View File

@ -75,7 +75,7 @@ export const runChatCompletionStream = async ({
continue
}
const { output } = await executeFunction({
const { output, newVariables } = await executeFunction({
variables: variables.list(),
args:
typeof toolCall.func.arguments === 'string'
@ -84,8 +84,7 @@ export const runChatCompletionStream = async ({
body: toolDefinition.code,
})
// TO-DO: enable once we're out of edge runtime.
// newVariables?.forEach((v) => variables.set(v.id, v.value))
newVariables?.forEach((v) => variables.set(v.id, v.value))
const newMessages = appendToolCallMessage({
tool_call_id: toolCall.id,