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:
Omar Leonardo Sanchez Granados
2024-10-05 04:44:50 -04:00
committed by GitHub
parent abe9995a7c
commit 34761fa4ca
2 changed files with 4 additions and 3 deletions

View File

@ -443,7 +443,7 @@ class BedrockEmbed(Base):
response = self.client.invoke_model(modelId=self.model_name, body=json.dumps(body))
model_response = json.loads(response["body"].read())
embeddings.extend([model_response["embedding"]])
embeddings.extend(model_response["embedding"])
return np.array(embeddings), token_count