Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: "Do I know you?" #5

Open
kamil-malinski opened this issue Nov 15, 2023 · 7 comments
Open

Error: "Do I know you?" #5

kamil-malinski opened this issue Nov 15, 2023 · 7 comments

Comments

@kamil-malinski
Copy link

Hi!

I tried your bot and I ended up getting an error when I message the bot:

  Error: Do I know you? #xxxxxxxxxx
       at assistantThreadIdUpsert (/root/bubby/packages/core/src/3rdparty/openai/assistant_thread.ts:46:11)
       at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
       at sendReplies (/root/bubby/packages/core/src/handlers/reply_to_chat.ts:31:20)
       at allReplies (/root/bubby/packages/core/src/3rdparty/telegram/webhook.ts:59:3)
       at <anonymous> (/root/bubby/packages/core/src/3rdparty/telegram/webhook.ts:26:5)
       at execute (/root/bubby/node_modules/.pnpm/[email protected]/node_modules/telegraf/lib/composer.js:501:17)
       at <anonymous> (/root/bubby/node_modules/.pnpm/[email protected]/node_modules/telegraf/lib/composer.js:502:21)
       at execute (/root/bubby/node_modules/.pnpm/[email protected]/node_modules/telegraf/lib/composer.js:501:17)
       at execute (/root/bubby/node_modules/.pnpm/[email protected]/node_modules/telegraf/lib/composer.js:501:17)
       at <anonymous> (/root/bubby/node_modules/.pnpm/[email protected]/node_modules/p-timeout/index.js:50:13)

Where do I configure the whitelist of users, that are allowed to use the bot?

Thanks!

Kamil

@daohoangson
Copy link
Owner

You will need to change this line before deploying your bot:

if (userId !== "552046506") {
// https://t.me/daohoangson
throw new AssistantError(`Do I know you? #${userId}`);
}
.

@kamil-malinski
Copy link
Author

thanks, it worked!

@daohoangson
Copy link
Owner

That's great to hear. How was the conversation with the bot?

@kamil-malinski
Copy link
Author

the conversation works great! I really like your bot, thanks a lot! I have just a few suggestions:

  • please add the initial prompt into a config variable so one doesn't have to edit the source file
  • enable streaming of the response

by the way, how does the memory feature work? could you please explain it briefly?

Cheers

Kamil

@daohoangson
Copy link
Owner

please add the initial prompt into a config variable so one doesn't have to edit the source file

I see, that makes sense.

enable streaming of the response

That's not possible with OpenAI assistant API right now, maybe soon.

by the way, how does the memory feature work? could you please explain it briefly?

You can ask the bot to remember something and it will use function call to do that. The memory is persisted across threads / conversations. Something like this:

Screenshot_20231116_194012_Telegram

@kamil-malinski
Copy link
Author

I see, thank you for the explanation!

maybe you could add "New thread." (and other commands?) as a command to the bot:

https://core.telegram.org/bots/features#commands

@daohoangson
Copy link
Owner

Yep, that makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants