From 29f022c91ccd42990fc0c5dd629079270cd3a9b0 Mon Sep 17 00:00:00 2001 From: Kevin Hu Date: Thu, 10 Oct 2024 09:13:35 +0800 Subject: [PATCH] fix bedrock issue (#2776) ### What problem does this PR solve? #2722 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- rag/llm/chat_model.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rag/llm/chat_model.py b/rag/llm/chat_model.py index 6e552999c..fb9c6e224 100644 --- a/rag/llm/chat_model.py +++ b/rag/llm/chat_model.py @@ -661,7 +661,7 @@ class BedrockChat(Base): modelId=self.model_name, messages=history, inferenceConfig=gen_conf, - system=[{"text": system}] if system else None, + system=[{"text": (system if system else "Answer the user's message.")}] ) ans = response["output"]["message"]["content"][0]["text"] return ans, num_tokens_from_string(ans) @@ -676,7 +676,7 @@ class BedrockChat(Base): modelId=self.model_name, messages=history, inferenceConfig=gen_conf, - system=[{"text": system if system else ""}], + system=[{"text": (system if system else "Answer the user's message.")}] ) # Extract and print the streamed response text in real-time.