etkecc / baibot

🤖 A Matrix bot for using diffent capabilities (text-generation, text-to-speech, speech-to-text, image-generation, etc.) of AI / Large Language Models (OpenAI, Anthropic, etc.)
GNU Affero General Public License v3.0
48 stars 4 forks source link

Whole (or most recent part of) room chat as context #20

Open CybotTM opened 1 month ago

CybotTM commented 1 month ago

Hi,

i got that baibot get reply-chains and threads as context.

But i couldn't figure out, if it is possible to configure the bot to also have the room conversation (or X last messages/events) as context? But from what I understood, this is currently not possible via given config options, right?

2 use cases:

User do not use reply-chains or threads as they should :-( ... users

I want to have the option that the bot stays in the channel, not opening threads. For rooms with a very specific topic there is no need for threads or reply-chains. But this requires the bot to know the past room chat messages.

Thanks for your work. Love it.

spantaleev commented 4 weeks ago

This is possible, but somewhat tricky.

Perhaps it could use a different invocation syntax (e.g. !bai weigh-in 10 What do you think?) which:

This special command should only be invokable by authorized bot users.

Another question that remains to be answered is: should the bot consider messages from non-bot-users (like it does for on-demand mentions in threads and reply-chains - see on-demand involvement) or should it only consider messages from bot users? Or should this behavior be configurable?

The tentative syntax above (e.g. !bai weigh-in 10 What do you think?) is somewhat complex and cryptic though (reminding of BASIC), I think.

Perhaps the limit parameter (the 10 value in the example above) could be made optional and default to something reasonable if it's missing. The simpler syntax could then become !bai weight-in What do you think?)


Alternatives to the weigh-in word (as proposed by baibot itself and reviewed by me) are:

For now, I'm leaning toward thoughts, because it seems relatively short, lacks dashes, is descriptive enough and easy-to-use (no need for a prompt question even).

While !bai weigh-in or !bai weigh-in ^15 (or !bai weigh-in 15) are equally good, I'm not sure I like that dash there. We could get rid of the dash (weighin) as well, but this seems wrong.


I have also not looked into how the implementation would look like and and how efficient it could be made to be.

CybotTM commented 3 weeks ago

Using a specific command seems reasonable. There may even more commands which may take the chat history into context.

About the history length, I also think it should be optional to add the length, and have a default value configured.

About the command name, for my usecase, "thoughts" would be a good option. With an optional question/query behind it.

Maybe it would also be possible to let the bot decide, whether he has something valuable to add or not - of course configurable. ("You are a helpful assistant, which listens in the background, and adds information or help if they are required") ;-)