Using assistants whitout thread

Hello. I am trying to send my request to the gpt assitants I created and get a response from them. The gpt assitants has my instruction.

Can I send my request without creating a thread ?
For example as it happens when using @com/v2/chat/completions@, where I send a request and in the body of the response I get what I need.

1 Like

I have not seen that you can use the assistant without a thread yet. As far as the documentation goes, you must use threads.

I wanted something like that previously in one of my use cases.

To do so, my solution was to (1) create a thread, (2) send it to the assistant with the thread, and after receiving the answer, (3) delete the thread.

I have something like that (pseudo-code):

def get_response_from_assistant(prompt='do something for me'):
    thread_id = create_thread()
    
    response = assistant_call(prompt=prompt, thread_id)

    delete_thread(thread_id)

    return response

Welcome @junga2249
A thread serves as the repository for messages that constitute the conversation history.

To my knowledge, utilizing the Assistants API without a thread is not feasible, as runs are executed on threads.

If you are not inclined to utilize threads, it is unlikely that you would also wish to employ assistants.

Therefore, I recommend directly utilizing the chat completion endpoint.