From 12ad746ee61cfb208a9e8dfa896f5c75b8d7ca37 Mon Sep 17 00:00:00 2001 From: Kevin Hu Date: Wed, 26 Mar 2025 11:27:12 +0800 Subject: [PATCH] Fix: Bedrock model invocation error. (#6533) ### What problem does this PR solve? ### 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 1dfdb1068..6c2f15499 100644 --- a/rag/llm/chat_model.py +++ b/rag/llm/chat_model.py @@ -829,7 +829,7 @@ class BedrockChat(Base): def chat(self, system, history, gen_conf): from botocore.exceptions import ClientError for k in list(gen_conf.keys()): - if k not in ["top_p", "max_tokens"]: + if k not in ["temperature"]: del gen_conf[k] for item in history: if not isinstance(item["content"], list) and not isinstance(item["content"], tuple): @@ -854,7 +854,7 @@ class BedrockChat(Base): def chat_streamly(self, system, history, gen_conf): from botocore.exceptions import ClientError for k in list(gen_conf.keys()): - if k not in ["top_p", "max_tokens"]: + if k not in ["temperature"]: del gen_conf[k] for item in history: if not isinstance(item["content"], list) and not isinstance(item["content"], tuple):