I have an app with an assistant and am trying to figure out best practices for handling adding messages as the user talks with the assistant. My first thought was to just add a message to the thread I already created and create new run. When I look at the docs though, (https://platform.openai.com/docs/api-reference/threads/modifyThread) , it says " The ID of the thread to modify. Only the metadata
can be modified." . Should I just be creating a new thread and running that every time?
1 Like
You just have to create a message on the thread and then create a run on the thread with an assistant.
3 Likes
Since you mentioned “as the user talks with the assistant” I also suggest you get the run status to check is over.
I’ve had issues with assistants connected to WhatsApp or Instagram and in those apps people sometimes send a sentence broken in different lines and send each line to the assistant. You may also want to add a buffer to prevent multiple calls.
By broken in lines I mean, instead of saying:
Hi, I want a pizza
they write:
Hi
I
want
a pizza
1 Like