A simple Discord bot example that uses PaLM2 Api.
Open botConfig.py
and replace the default text with your Discord Bot Token and your PaLM2 API Key
Getting your Discord Bot Token -https://discordpy.readthedocs.io/en/stable/discord.html
DISCORD_BOT_TOKEN = "DISCORD TOKEN""
Getting your PaLM2 Key - https://makersuite.google.com/waitlist
PALM2_API_KEY = "PALM API KEY"
pip install -r requirements.txt
python RunDiscordBotPaLM2.py
The bot will respond a persons DM's and mention in any channel it has access to.
UPDATED
Memory now is done per user! so you can use it on a discord server easily to carry on a conversation.
This Bot has a simple memory system it is off by default and can be enabled by HAS_MEMORY
= True It keeps track of the MESSAGE_MAX_HISTORY
and can be reset by typing COM Reset
It is best to disable this if you are going to use it with many people as the memor
The bot is defaulted to text generation, this gives much faster generation and sets everything to default. changing the bot to chat mode will allow you to give it a personality and alter it. You can enable the chat mode by changing USE_CHAT
to true.
The bots personlity can be adjusted here forcing all text to go through this filter like a lense. change BOT_CONTEXT
Roleplay as AI that speaks like Shakespeare
Everything is answered in fancy english
Given a topic, you will use emoji's while answering
Adds Emoji's to everything it says
More examples can be found at https://developers.generativeai.google/prompt-gallery?type=chat
Example messages allow you to even further fine tune responses these examples are at https://makersuite.google.com/app/prompts/new_multiturn