#Assistants API

1 messages · Page 1 of 1 (latest)

merry lava
#

Hello, I'm having some problems with assistants API. I have an assistant connected through twilio to a whatsapp number. The assistant responds to the user message and is able to call functions perfectly. Sometimes, like today and not for every interaction, the message is shown in the thread through the playground but it's not being sent to the user. Today, for example, I'm finding this issue without any change in my code. It has been working smoothly for the entire past week. Is it because assistants are in beta or may I be missing something or doing something wrong?
I just found a delay of 10 min between the message in the playground thread and the message coming out through the twilio API

tardy rootBOT
#

Hi @merry lava. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Based on the information provided in the extracts, it's difficult to pinpoint the exact cause of the delay you're experiencing between the message appearing in the playground thread and being sent out via the Twilio API. However, there are a few possibilities that could be causing this issue:

  1. API Queuing: As mentioned in the forum post (https://community.openai.com/t/544443), some users have reported that their assistant runs remain queued for a long time. This could potentially cause a delay in the message being sent out.

  2. API Errors: In another forum post (https://community.openai.com/t/556428), a user mentioned that the quality and ability of the instruction or user message can cause a failure, which might result in a delay.

  3. Timeout Issues: As discussed in the forum post (https://community.openai.com/t/583579), if you're only giving a certain amount of time for the assistant and retrieving messages, your thread might need more than that time to add a message to thread messages.

  4. Network Issues: There could be network issues either on the server-side or client-side causing the delay.

Since the Assistants API is still in beta, it's possible that there could be some unexpected behavior or issues. If the problem persists, it would be best to reach out to OpenAI support or post a detailed question on the OpenAI community forum with specific details about your implementation and the issues you're facing. They might be able to provide more targeted assistance.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@merry lava kapa.ai is still learning and improving, please let us know how it did by reacting below

merry lava
#

How can I increment the time for the assitant to retrieve messages?

sturdy garnet
#

@tardy root How can I increment the time for the assitant to retrieve messages?

tardy rootBOT
#

Let me check the knowledge base for you. One moment! :books:

#

Based on the information provided in the extracts, you can control the time for the assistant to retrieve messages by using a loop that checks the status of the run and pauses for a certain amount of time before checking again. Here's an example of how you can do this:

run_in_progress = True
while run_in_progress:
    run = openai_client.beta.threads.runs.retrieve(thread_id=thread_id, run_id=run.id)
    if run.status == "completed":
        run_in_progress = False
    else:
        time.sleep(3)  # This is where you control the time between checks

In this code snippet, the time.sleep(3) line is where you control the time between checks. This line of code will pause the execution of the script for 3 seconds before the next check. If you want to increase the time for the assistant to retrieve messages, you can increase this number.

Please note that this is just an example and the actual implementation may vary depending on your specific use case and requirements. You can find more details in the forum post (https://community.openai.com/t/504127) from where this extract was taken.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@pliant marsh kapa.ai is still learning and improving, please let us know how it did by reacting below

sturdy garnet
#

@merry lava ^

merry lava