mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-06-04 11:24:00 +08:00
fix add Bedrock llm error (#1952)
### What problem does this PR solve? #1942 fix add Bedrock llm error ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --------- Co-authored-by: Zhedong Cen <cenzhedong2@126.com>
This commit is contained in:
parent
ef8728a314
commit
6acc46bc7b
@ -678,6 +678,10 @@ class BedrockChat(Base):
|
||||
if "top_p" in gen_conf:
|
||||
gen_conf["topP"] = gen_conf["top_p"]
|
||||
_ = gen_conf.pop("top_p")
|
||||
for item in history:
|
||||
if not isinstance(item["content"],list) and not isinstance(item["content"],tuple):
|
||||
item["content"] = [{"text":item["content"]}]
|
||||
|
||||
|
||||
try:
|
||||
# Send the message to the model, using a basic inference configuration.
|
||||
@ -707,7 +711,10 @@ class BedrockChat(Base):
|
||||
if "top_p" in gen_conf:
|
||||
gen_conf["topP"] = gen_conf["top_p"]
|
||||
_ = gen_conf.pop("top_p")
|
||||
|
||||
for item in history:
|
||||
if not isinstance(item["content"],list) and not isinstance(item["content"],tuple):
|
||||
item["content"] = [{"text":item["content"]}]
|
||||
|
||||
if self.model_name.split('.')[0] == 'ai21':
|
||||
try:
|
||||
response = self.client.converse(
|
||||
|
Loading…
x
Reference in New Issue
Block a user