Browse Source

user_name derps

master
Hendrik Langer 2 years ago
parent
commit
5d7fb04ad6
  1. 2
      matrix_pygmalion_bot/bot/ai/langchain.py
  2. 2
      matrix_pygmalion_bot/bot/core.py

2
matrix_pygmalion_bot/bot/ai/langchain.py

@ -266,6 +266,8 @@ class AI(object):
# output = llm_chain(inputs={"ai_name": self.bot.name, "persona": self.bot.persona, "scenario": self.bot.scenario, "human_name": chat_human_name, "ai_name_chat": self.bot.name, "chat_history": "", "input": message.content})['results'][0]['text']
stop = ['<|endoftext|>', f"\n{chat_human_name}"]
if chat_human_name != message.additional_kwargs['user_name']:
stop.append(f"\n{message.additional_kwargs['user_name']}")
#print(f"Message is: \"{message.content}\"")
await asyncio.sleep(0)
output = await chain.arun({"input":message.content, "stop": stop})

2
matrix_pygmalion_bot/bot/core.py

@ -135,7 +135,7 @@ class ChatBot(object):
typing_fn = lambda : self.connection.room_typing(room.room_id, True, 15000)
message.user_name = message.user_name.title()
if self.name.casefold() == message.user_name.casefold():
if self.name.casefold() == message.user_name.casefold() and not message.is_from(self.connection.user_id):
"""Bot and user have the same name"""
message.user_name += " 2" # or simply "You"
if message.is_from(self.connection.user_id):

Loading…
Cancel
Save