|
|
@ -86,7 +86,6 @@ class Callbacks(object): |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
api_endpoint = "pygmalion-6b" |
|
|
|
await self.client.room_read_markers(room.room_id, event.event_id, event.event_id) |
|
|
|
# Ignore messages when disabled |
|
|
|
if "disabled" in self.bot.room_config[room.room_id] and self.bot.room_config[room.room_id]["disabled"] == True and not event.body.startswith('!start'): |
|
|
@ -225,9 +224,6 @@ class Callbacks(object): |
|
|
|
new_answer = event.body.removeprefix('!replace').strip() |
|
|
|
await self.bot.send_message(self.client, room.room_id, new_answer, reply_to=chat_history_item.relates_to_event) |
|
|
|
return |
|
|
|
elif event.body.startswith('!2'): |
|
|
|
chat_message.updateText( event.body.removeprefix('!2').strip() ) |
|
|
|
api_endpoint = "ynznznpn6qz6yh" |
|
|
|
elif event.body.startswith('!'): |
|
|
|
await self.bot.send_message(self.client, room.room_id, "<ERROR> UNKNOWN COMMAND") |
|
|
|
return |
|
|
@ -258,7 +254,7 @@ class Callbacks(object): |
|
|
|
# print("") |
|
|
|
try: |
|
|
|
typing = lambda : self.client.room_typing(room.room_id, True, 15000) |
|
|
|
answer = await self.bot.text_ai.generate_sync(full_prompt, self.bot.runpod_api_key, self.bot, typing, api_endpoint) |
|
|
|
answer = await self.bot.text_ai.generate_sync(full_prompt, self.bot.runpod_api_key, self.bot, typing) |
|
|
|
answer = answer.strip() |
|
|
|
await self.client.room_typing(room.room_id, False) |
|
|
|
if not (self.bot.translate is None): |
|
|
@ -308,6 +304,7 @@ class ChatBot(object): |
|
|
|
self.service_image = "other" |
|
|
|
self.model = "other" |
|
|
|
self.runpod_api_key = None |
|
|
|
self.runpod_text_endpoint = "pygmalion-6b" |
|
|
|
self.text_ai = None |
|
|
|
self.image_ai = None |
|
|
|
|
|
|
@ -552,6 +549,8 @@ async def main() -> None: |
|
|
|
bot.model = config[section]['model'] |
|
|
|
if config.has_option('DEFAULT', 'runpod_api_key'): |
|
|
|
bot.runpod_api_key = config['DEFAULT']['runpod_api_key'] |
|
|
|
if config.has_option('DEFAULT', 'runpod_text_endpoint'): |
|
|
|
bot.runpod_text_endpoint = config['DEFAULT']['runpod_text_endpoint'] |
|
|
|
if config.has_option('DEFAULT', 'stablehorde_api_key'): |
|
|
|
bot.stablehorde_api_key = config['DEFAULT']['stablehorde_api_key'] |
|
|
|
await bot.read_conf2(section) |
|
|
|