How can we trigger Assistant reply when there is no user messages?

Is there an endpoint that triggers an Assistant reply based on current Thread state?

openai.beta.threads.runs.create only triggers a reply from Assistant if there is a User message.

I’m specifically trying to get the Assistant to start the conversation, based on the Assistant instructions, before the User creates a message.

I thought openai.beta.threads.createAndRun might work, but it does not.

Thanks for any help!

I tested, just create a run on the thread did work.

run = client.beta.threads.runs.create(thread_id=thread_id, assistant_id=assistant_id)

To get the “thread_id”, create a new thread first, initial message is not a require.

You may need to set assistant instructions to tell the bot to provide certain welcome messages when there’s no user input in thread’s message list.

2 Likes

Why would you pay for something that is almost the same every time?

You can send a user message like “introduce yourself”, which is what I do at startup of some of my script bots to ensure connection and key is working and the right identity is chosen.

An assistant will likely say “hi” with 15k of document context from retrieval.

Thank you. I’ll try that :slight_smile:

  1. Ask ChatGPT to build you an array of x number fun, formal, and informal greetings.
  2. Have your program pick one from the array at random and send it to the user the same way you send GPT responses.
  3. ???
  4. Profit