Skip to content

Commit

Permalink
Fix ai name removal
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashesh3 committed Apr 18, 2024
1 parent 713afed commit 55a526d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ayushma/utils/openaiapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 55a526d

Please sign in to comment.