From 0a7654c747082c512e7ac39ec1fc967a943957b3 Mon Sep 17 00:00:00 2001 From: Kevin Hu Date: Mon, 30 Sep 2024 17:54:27 +0800 Subject: [PATCH] fix error in exception (#2694) ### What problem does this PR solve? #2670 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- rag/llm/chat_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rag/llm/chat_model.py b/rag/llm/chat_model.py index 479f6fe6..11956ad8 100644 --- a/rag/llm/chat_model.py +++ b/rag/llm/chat_model.py @@ -1340,7 +1340,7 @@ class GoogleChat(Base): + response["usage"]["output_tokens"], ) except Exception as e: - return ans + "\n**ERROR**: " + str(e), 0 + return "\n**ERROR**: " + str(e), 0 else: self.client._system_instruction = self.system if "max_tokens" in gen_conf: