This commit is contained in:
Cyberes 2023-03-18 14:50:10 -06:00
parent 1e5f82c5c7
commit e3e14181ac
1 changed files with 4 additions and 1 deletions

View File

@ -206,7 +206,10 @@ async def process_chat(client, room, event, command, store, openai, thread_root_
temperature=0, temperature=0,
) )
text_response = response["choices"][0]["message"]["content"].strip().strip('\n') text_response = response["choices"][0]["message"]["content"].strip().strip('\n')
if isinstance(command, str):
x = command.replace("\n", "\\n") x = command.replace("\n", "\\n")
else:
x = command
z = text_response.replace("\n", "\\n") z = text_response.replace("\n", "\\n")
logger.info(f'Reply to {event.event_id} --> "{x}" and bot responded with "{z}"') logger.info(f'Reply to {event.event_id} --> "{x}" and bot responded with "{z}"')
resp = await send_text_to_room(client, room.room_id, text_response, reply_to_event_id=event.event_id, thread=True, thread_root_id=thread_root_id if thread_root_id else event.event_id) resp = await send_text_to_room(client, room.room_id, text_response, reply_to_event_id=event.event_id, thread=True, thread_root_id=thread_root_id if thread_root_id else event.event_id)