Struggling with “Thread” logic for OpenAI Assistant in Telegram bot

Hey community!

Maybe it’s a silly question, but how to implement chatting with Assistant via Telegram in the same thread for one user?

I do know how to set Thread ID in Assistant module. My question is how to build TG bot that allows user to chat in one specific Thread that being set at the beginning of every new conversation.

What I could do now:

  • If Thread ID not set up, then every new message starts a new Thread. That’s not a case I am looking for.

  • If Thread ID hardwired (set with providing fixed Thread ID), then all conversation for all users goes at the same Thread. That’s not what I am looking for too.

So is it possible to build a logic, that allows me to do the following:

  • User starts conversation with TG bot and all his conversation goes in particular Thread, that being set up on the first message?

  • In other words how could I get initial message from the user, get the new Thread ID and only after that continue conversation in the particular Thread that been previously created?

Thanks in advance!

Welcome to the Make community!

I think I’ve answered this before, do take a look at some of my previous posts:

Thanks,

samliewrequest private consultation

3 Likes