Ironclad / rivet

The open-source visual AI programming environment and TypeScript library
https://rivet.ironcladapp.com
MIT License
2.71k stars 237 forks source link

[Bug]: OpenAI Plugin - Tool/Function Calls #298

Closed jasper-one closed 8 months ago

jasper-one commented 9 months ago

What happened?

Tool/Function Calls are not working on the OpenAI Built-in Plugin

When there is a function call in a thread, the thread run completed before status = complete.

Steps to reproduce:

  1. Create an Assistant with a Function
  2. Create a Thread
  3. Run Thread with Function

You will receive the output before it's done, meaning that there:

A) Is no assistant response yet B) Is an assistant response where the text.value = "" because it is yet to complete.

But in each case the status of the run !== complete and the node Run Thread Node still seems to output to early.

Example Output that is too early: image

Example Graph I tried to upload the Graph here, but GitHub won't allow the extension so if you change this from "txt" to "rivet-graph" it hopefully imports: Example_of_OpenAI_Threads_Function_Call.txt

What was the expected functionality?

I expected Rivet to poll using the existing Run Thread Node code until the Run was status = complete. Meaning that there would be a response from the assistant.

Instead, depending on timing I will receive no message from the assistant or a blank response from the assistant.

When I open the same thread in OpenAI later, it has a completed status and full response from the assistant as expected. So it seems to be simply not waiting until completion.

Describe your environment

Windows 11 Pro Node v20.5.1

Replicated by other users on Discord

Relevant log output

No response

Relevant screenshots

Full Flow

image

Run Output where the status is still queued

image

Showing no last assistant message

image

Code of Conduct

abrenneke commented 8 months ago

Fixed in 4e308640569d66d89facc5c34bd9bd524a0f0027