#Assistand API not finding the channel

1 messages · Page 1 of 1 (latest)

high compass
#

I am following the documentation of the docs to retrieve the created thread with the following code:

thread = await chatgptclient.beta.threads.create()

            message = await chatgptclient.beta.threads.messages.create(
                thread_id=thread.id,
                role="user",
                content=prompt_description
            )

            run =  await chatgptclient.beta.threads.runs.create(
            thread_id=thread.id,
            assistant_id=ASSISTANT_ID
            )

            messages = await chatgptclient.beta.threads.messages.list(thread_id=thread.id)

Is there a known issue to this method? I am encountering a 404 on the /runs part

peak steepleBOT
#

Hi @high compass. 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, there doesn't seem to be a known issue with the method you're using to create and run threads with the Assistant API. However, a 404 error typically indicates that the server couldn't find the requested resource. In this context, it could mean that the thread.id or ASSISTANT_ID you're using doesn't correspond to an existing thread or assistant.

Here are a few things you could check:

  1. Ensure that the thread.id and ASSISTANT_ID are correct and correspond to existing resources. You can verify this by checking the responses when you create the thread and the assistant.

  2. Make sure that the thread and the assistant were created successfully before you try to create a run. You can do this by checking the responses when you create these resources.

  3. Check if there's a delay or latency issue. Creating a run is an asynchronous operation, and the status of the run is initially set to queued. It's possible that you're trying to retrieve the run before it has been fully processed. You can handle this by implementing a polling mechanism to wait for the run to complete before trying to retrieve it.

If you're still encountering issues, it might be helpful to look at the full error message or stack trace for more details about what's causing the 404 error.

Sources:


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

#

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

high compass
#

@peak steeple I found the error or at least know what's wrong:

An error occurred: Error code: 404 - {'error': {'message': "No assistant found with id 'BLURRED'.", 'type': 'invalid_request_error', 'param': None, 'code': None}}

I assume that's because I am not the owner of the Assistant? Or are they publicly accessible if I have the ID?

peak steepleBOT
#

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

#

The error message you're seeing indicates that the Assistant API couldn't find an assistant with the ID you provided. This could be due to a few reasons:

  1. The ASSISTANT_ID is incorrect: Make sure that the ASSISTANT_ID you're using is correct and corresponds to an existing assistant. You can verify this by checking the response when you create the assistant.

  2. The assistant doesn't exist: If the ASSISTANT_ID is correct, it's possible that the assistant it refers to doesn't exist. This could happen if the assistant was deleted after it was created.

  3. You don't have access to the assistant: Assistants, threads, messages, and files created via the API are scoped to the entire organization. Any person with API key access to the organization is able to read or write assistants, threads, messages, and files in the organization. If you're not the owner of the assistant and you don't have API key access to the organization that owns the assistant, you won't be able to access it.

To resolve this issue, you could try the following:

  • Verify the ASSISTANT_ID and make sure it's correct.
  • Check if the assistant exists and hasn't been deleted.
  • If you're not the owner of the assistant, check if you have API key access to the organization that owns the assistant.

If you're still encountering issues, it might be helpful to look at the full error message or stack trace for more details about what's causing the 404 error.

Sources:


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

#

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

high compass
#

@peak steeple The GPT however is public and available in the stores as well. Should I not be able to access it then?

peak steepleBOT
#

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

#

Based on the information provided in the extracts, the GPT Store is a marketplace where users can search for and access various GPTs. However, access to the GPT Store is limited to paying ChatGPT members only. Even if a GPT is public and available in the store, users still need to have a ChatGPT subscription to access it.

Furthermore, while a GPT developer can make a GPT public, they cannot make it free for everyone. If a developer wants to make an Assistant (which is essentially the same as a GPT) available for everyone, they would need to host the communicative layer and pay for usage.

So, even if a GPT is public and available in the GPT Store, you would not be able to access it unless you have a ChatGPT subscription. If you're a developer and you want to make a GPT available for everyone, you would need to host the communicative layer and pay for usage.

Sources:


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

#

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

high compass
#

@peak steeple Does the developer itself need to enable something in order for me to retrieve and work with things? Like making Threads and stuff

peak steepleBOT
#

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

#

Yes, the developer or the organization owner needs to enable certain settings for you to retrieve and work with threads and other resources.

For instance, the threads page on the OpenAI platform can be enabled or disabled, and access can be limited to organization owners. This means that if you're not an organization owner, you might not be able to access the threads page unless the owner has enabled access for you. You can find more information about this in the OpenAI Documentation (https://platform.openai.com/docs/assistants/overview/step-2-create-a-thread).

In addition, the developer or organization owner can control various security settings for the workspace, such as who can share chats and GPTs, and which capabilities are enabled for standard GPTs. These settings can be managed from the Settings page (https://chat.openai.com/admin/settings) on the OpenAI platform.

So, if you're encountering issues with retrieving and working with threads or other resources, it might be worth checking with the developer or organization owner to make sure the necessary settings have been enabled.

Sources:


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

#

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

full stratus