-
Hi! I used to achieve recursive function calls like this: const stream = OpenAIStream(initialResponse, {
async experimental_onFunctionCall({name, arguments: args}, createFunctionCallMessages) {
console.log('function call needed:', name, args)
const functionResult = await runFunction(name, args);
console.log('function result:', functionResult)
const newMessages = createFunctionCallMessages(functionResult);
return openai.chat.completions.create({
model: GPT_MODEL,
stream: true,
messages: [...messages, ...newMessages],
functions,
function_call: 'auto'
})
},
// ...
}) Now I am testing the new Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
olegkorol
Oct 3, 2024
Replies: 2 comments
-
Related: #2666 |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
olegkorol
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@lgrammel: