Merge pull request #28 from h1ddenpr0cess20/dev

bug fix
This commit is contained in:
Dustin 2024-08-24 19:38:11 -04:00 committed by GitHub
commit 361827815c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 28 additions and 11 deletions

View File

@ -37,31 +37,48 @@ python3 ollamarama.py
**.ai _message_** or **botname: _message_** **.ai _message_** or **botname: _message_**
 Basic usage.  Basic usage.
**.x _user_ _message_** **.x _user_ _message_**
 This allows you to talk to another user's chat history.  This allows you to talk to another user's chat history.
 _user_ is the display name of the user whose history you want to use  _user_ is the display name of the user whose history you want to use
**.persona _personality_** **.persona _personality_**
 Changes the personality. It can be a character, personality type, object, idea, whatever. Use your imagination.  Changes the personality. It can be a character, personality type, object, idea, whatever. Use your imagination.
**.custom _prompt_** **.custom _prompt_**
 Allows use of a custom system prompt instead of the roleplaying prompt  Allows use of a custom system prompt instead of the roleplaying prompt
**.reset** **.reset**
 Clear history and reset to preset personality  Clear history and reset to preset personality
**.stock** **.stock**
 Clear history and use without a system prompt  Clear history and use without a system prompt
**Admin only commands** **Admin only commands**
**.model _model_** **.model _model_**
 Omit model name to show current model and available models  Omit model name to show current model and available models
 Include model name to change model  Include model name to change model
**.clear** **.clear**
 Reset bot for everyone  Reset bot for everyone

View File

@ -129,10 +129,10 @@ class ollamarama:
self.messages[channel][sender].clear() self.messages[channel][sender].clear()
except: except:
pass pass
if persona != None: if persona != None and persona != "":
# combine personality with prompt parts # combine personality with prompt parts
prompt = self.prompt[0] + persona + self.prompt[1] prompt = self.prompt[0] + persona + self.prompt[1]
if custom != None: if custom != None and custom != "":
prompt = custom prompt = custom
await self.add_history("system", channel, sender, prompt) await self.add_history("system", channel, sender, prompt)
if respond: if respond: