|
@ -222,7 +222,7 @@ class Callbacks(object): |
|
|
# answer = answer.strip() |
|
|
# answer = answer.strip() |
|
|
# print("") |
|
|
# print("") |
|
|
await self.client.room_typing(room.room_id, True, 15000) |
|
|
await self.client.room_typing(room.room_id, True, 15000) |
|
|
answer = await ai.generate_sync(full_prompt, self.bot.runpod_api_key, self.bot.name) |
|
|
answer = await ai.generate_sync(full_prompt, self.bot.runpod_api_key, self.bot) |
|
|
answer = answer.strip() |
|
|
answer = answer.strip() |
|
|
await self.client.room_typing(room.room_id, False) |
|
|
await self.client.room_typing(room.room_id, False) |
|
|
if not (self.bot.translate is None): |
|
|
if not (self.bot.translate is None): |
|
@ -266,6 +266,7 @@ class ChatBot(object): |
|
|
self.persona = None |
|
|
self.persona = None |
|
|
self.scenario = None |
|
|
self.scenario = None |
|
|
self.greeting = None |
|
|
self.greeting = None |
|
|
|
|
|
self.temperature = 0.80 |
|
|
self.events = [] |
|
|
self.events = [] |
|
|
self.global_tick = 0 |
|
|
self.global_tick = 0 |
|
|
self.chat_history = None |
|
|
self.chat_history = None |
|
@ -418,6 +419,8 @@ async def main() -> None: |
|
|
device_name = "matrix-nio" |
|
|
device_name = "matrix-nio" |
|
|
bot = ChatBot(homeserver, user_id, password, device_name) |
|
|
bot = ChatBot(homeserver, user_id, password, device_name) |
|
|
bot.character_init(botname, config[section]['persona'], config[section]['scenario'], config[section]['greeting']) |
|
|
bot.character_init(botname, config[section]['persona'], config[section]['scenario'], config[section]['greeting']) |
|
|
|
|
|
if config.has_option(section, 'temperature'): |
|
|
|
|
|
bot.temperature = config[section]['temperature'] |
|
|
if config.has_option(section, 'owner'): |
|
|
if config.has_option(section, 'owner'): |
|
|
bot.owner = config[section]['owner'] |
|
|
bot.owner = config[section]['owner'] |
|
|
if config.has_option(section, 'translate'): |
|
|
if config.has_option(section, 'translate'): |
|
|