|
@ -67,6 +67,7 @@ class Callbacks(object): |
|
|
) |
|
|
) |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
api_endpoint = "pygmalion-6b" |
|
|
await self.client.room_read_markers(room.room_id, event.event_id, event.event_id) |
|
|
await self.client.room_read_markers(room.room_id, event.event_id, event.event_id) |
|
|
# Ignore messages when disabled |
|
|
# 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'): |
|
|
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'): |
|
@ -202,6 +203,9 @@ class Callbacks(object): |
|
|
new_answer = event.body.removeprefix('!replace').strip() |
|
|
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) |
|
|
await self.bot.send_message(self.client, room.room_id, new_answer, reply_to=chat_history_item.relates_to_event) |
|
|
return |
|
|
return |
|
|
|
|
|
elif event.body.startswith('!2'): |
|
|
|
|
|
chat_message.updateText( event.body.removeprefix('!2').strip() ) |
|
|
|
|
|
api_endpoint = "ynznznpn6qz6yh" |
|
|
elif event.body.startswith('!'): |
|
|
elif event.body.startswith('!'): |
|
|
await self.bot.send_message(self.client, room.room_id, "UNKNOWN COMMAND") |
|
|
await self.bot.send_message(self.client, room.room_id, "UNKNOWN COMMAND") |
|
|
return |
|
|
return |
|
@ -232,7 +236,7 @@ class Callbacks(object): |
|
|
# print("") |
|
|
# print("") |
|
|
try: |
|
|
try: |
|
|
typing = lambda : self.client.room_typing(room.room_id, True, 15000) |
|
|
typing = lambda : self.client.room_typing(room.room_id, True, 15000) |
|
|
answer = await ai.generate_sync(full_prompt, self.bot.runpod_api_key, self.bot, typing) |
|
|
answer = await ai.generate_sync(full_prompt, self.bot.runpod_api_key, self.bot, typing, api_endpoint) |
|
|
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): |
|
|