Skip to content

The agent engineering platform.

community: fix error in sambastudio embeddings (#26260)

Jorge Piedrahita Ortiz55b641b761d2
diff --git a/libs/community/langchain_community/embeddings/sambanova.py b/libs/community/langchain_community/embeddings/sambanova.py
index 0687295c8d..0daab18ef6 100644
--- a/libs/community/langchain_community/embeddings/sambanova.py
+++ b/libs/community/langchain_community/embeddings/sambanova.py
@@ -213,7 +213,7 @@ class SambaStudioEmbeddings(BaseModel, Embeddings):
)
try:
if params.get("select_expert"):
- embedding = response.json()["predictions"][0]
+ embedding = response.json()["predictions"]
else:
embedding = response.json()["predictions"]
embeddings.extend(embedding)
@@ -299,7 +299,7 @@ class SambaStudioEmbeddings(BaseModel, Embeddings):
)
try:
if params.get("select_expert"):
- embedding = response.json()["predictions"][0][0]
+ embedding = response.json()["predictions"][0]
else:
embedding = response.json()["predictions"][0]
except KeyError: