mekb-turtle / discord-ai-bot

Discord AI chatbot using Ollama
https://github.com/jmorganca/ollama
235 stars 57 forks source link

Identify users on channel requests #27

Open Darkhub opened 1 month ago

Darkhub commented 1 month ago

Describe the feature Bot should be able to identify which user makes a request in a channel.

Why do you think this feature should be implemented? Bot could be added to a channel and adapt answers to different users, for example it would be perfect in gdr play with bot playing a specific part between more users.

Additional context I think it could be implemented like a sort of table in .env file, for example with the following format: RECOGNISE_USERS = 1 USERID1 Username1 USERID2 Username2 ...

Then when the bot receives a request in a channel, if RECOGNISE_USERS is set it should check the table and if a correspondency is found the request to Ollama could be formatted like "Username1 says..." In the SYSYEM prompt Ollama could be instructed to adapt answers if user prompts contain that specific "Username1 says".

238SAMIxD commented 1 month ago

I do not understand it exactly but the bot is already creating chat history and provides its context to the llms until you use reset/clear command

Darkhub commented 1 month ago

I've checked Ollama's debug log and to me it seems that no user information is passed to Ollama as prompt. So, for example, if on a channel 2 users talk to the bot it would not be able to distinguish the 2 users.

Can you please tell me where the string to send to Ollama as prompt is built in code? I've checked but I was not able to find where this happens.

Thanks.