From 55a526d8d3a28e63693556001b744c72886df380 Mon Sep 17 00:00:00 2001 From: Ashesh3 <3626859+Ashesh3@users.noreply.github.com> Date: Fri, 19 Apr 2024 01:05:25 +0530 Subject: [PATCH] Fix ai name removal --- ayushma/utils/openaiapi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ayushma/utils/openaiapi.py b/ayushma/utils/openaiapi.py index 8f83e48..c82da95 100644 --- a/ayushma/utils/openaiapi.py +++ b/ayushma/utils/openaiapi.py @@ -345,7 +345,7 @@ def converse( response = lang_chain_helper.get_response( english_text, reference, chat_history, documents ) - chat_response = response.replace("Ayushma:", "").lstrip() + chat_response = response.replace(f"{AI_NAME}:", "").lstrip() stats["response_end_time"] = time.time() translated_chat_response, url, chat_message = handle_post_response( chat_response, @@ -427,7 +427,7 @@ def converse( break chat_response += next_token[0] - chat_response = chat_response.replace(f"{AI_NAME}: ", "") + chat_response = chat_response.replace(f"{AI_NAME}:", "").lstrip() yield create_json_response( local_translated_text, chat.external_id,