Hi All
I want to create a assistant which calls a tool. the Tool will send a email and wait for email response . This whole process of waiting for email response can take more then 20 minutes to 1 hour.
There is a limitation on openai tools output that it can only wait for 10 min .
How can i handle the flow where tool send email and wait for response so it continues execution where it left off
here’s a possible implementation:
- trigger the send email tool
- send email and in the submit tools output, tell user you sent the email and reply will take more than 20mins to 1 hour.
- somewhere in your app, you have some timer for long polling or websocket or server sent function that handles events triggered by the server such as when it receives the response to your email.
- when such trigger is received, send a message to your thread to trigger another tool, received_email and supply the info you just received from the server. this means you might need to distinguish a user sent message and a “system” send message.
this way, you do not have to wait for the response when you send the email and you can immediately submit a standard tool output. you are no longer dealing with the expiry time of the run. threads can last for 60 days.
1 Like