mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Fix/bedrock issues (#2718)
### What problem does this PR solve? Adding a Bedrock API key for Claude Sonnet was broken. I find the issue came up when trying to test the LLM configuration, the system is a required parameter in boto3. As well, there were problems in Bedrock implementation for embeddings when trying to encode queries. ### Type of change - [X] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
committed by
GitHub
parent
abe9995a7c
commit
34761fa4ca
@ -630,7 +630,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.")}] ,
|
||||
)
|
||||
|
||||
# Extract and print the response text.
|
||||
@ -675,7 +675,8 @@ class BedrockChat(Base):
|
||||
streaming_response = self.client.converse_stream(
|
||||
modelId=self.model_name,
|
||||
messages=history,
|
||||
inferenceConfig=gen_conf
|
||||
inferenceConfig=gen_conf,
|
||||
system=[{"text": system if system else ""}],
|
||||
)
|
||||
|
||||
# Extract and print the streamed response text in real-time.
|
||||
|
||||
Reference in New Issue
Block a user