From b76a1360f806443057975e7b6aee27f183e133c6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicol=C3=B2=20Boschi?= <boschi1997@gmail.com>
Date: Tue, 13 Feb 2024 16:22:31 +0100
Subject: [PATCH] fix: BedrockEmbeddings.from_credentials always uses the
 default model (#10640)

---
 .../llama_index/embeddings/bedrock/base.py                      | 2 +-
 llama-index-legacy/llama_index/legacy/embeddings/bedrock.py     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/llama-index-integrations/embeddings/llama-index-embeddings-bedrock/llama_index/embeddings/bedrock/base.py b/llama-index-integrations/embeddings/llama-index-embeddings-bedrock/llama_index/embeddings/bedrock/base.py
index 0971640b2e..ac5faa6d1c 100644
--- a/llama-index-integrations/embeddings/llama-index-embeddings-bedrock/llama_index/embeddings/bedrock/base.py
+++ b/llama-index-integrations/embeddings/llama-index-embeddings-bedrock/llama_index/embeddings/bedrock/base.py
@@ -311,7 +311,7 @@ class BedrockEmbedding(BaseEmbedding):
             client = session.client("bedrock")
         return cls(
             client=client,
-            model_name=model_name,
+            model=model_name,
             embed_batch_size=embed_batch_size,
             callback_manager=callback_manager,
             verbose=verbose,
diff --git a/llama-index-legacy/llama_index/legacy/embeddings/bedrock.py b/llama-index-legacy/llama_index/legacy/embeddings/bedrock.py
index 7244fad665..001a93ac07 100644
--- a/llama-index-legacy/llama_index/legacy/embeddings/bedrock.py
+++ b/llama-index-legacy/llama_index/legacy/embeddings/bedrock.py
@@ -312,7 +312,7 @@ class BedrockEmbedding(BaseEmbedding):
             client = session.client("bedrock")
         return cls(
             client=client,
-            model_name=model_name,
+            model=model_name,
             embed_batch_size=embed_batch_size,
             callback_manager=callback_manager,
             verbose=verbose,
-- 
GitLab