Skip to content

Commit 8ad12aa

Browse files
committed
fix: remove model_name from normalized API request bodies
The normalized routing layer resolves the model from the URL/connection context — the caller does not need to send it in the JSON body. - normalized/chat_models.py: remove 'model': self.model_name from _default_params - normalized/embeddings.py: remove 'model': self.model_name from both embed_documents and aembed_documents request bodies
1 parent fde0672 commit 8ad12aa

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

packages/uipath_langchain_client/src/uipath_langchain_client/clients/normalized/chat_models.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ def _default_params(self) -> dict[str, Any]:
155155
}
156156

157157
return {
158-
"model": self.model_name,
159158
**{k: v for k, v in exclude_if_none.items() if v is not None},
160159
**self.model_kwargs,
161160
}

packages/uipath_langchain_client/src/uipath_langchain_client/clients/normalized/embeddings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class UiPathEmbeddings(UiPathBaseEmbeddings, Embeddings):
1919

2020
def embed_documents(self, texts: list[str]) -> list[list[float]]:
2121
response = self.uipath_request(
22-
request_body={"input": texts, "model": self.model_name},
22+
request_body={"input": texts},
2323
raise_status_error=True,
2424
)
2525
return [r["embedding"] for r in response.json()["data"]]
@@ -29,7 +29,7 @@ def embed_query(self, text: str) -> list[float]:
2929

3030
async def aembed_documents(self, texts: list[str]) -> list[list[float]]:
3131
response = await self.uipath_arequest(
32-
request_body={"input": texts, "model": self.model_name},
32+
request_body={"input": texts},
3333
raise_status_error=True,
3434
)
3535
return [r["embedding"] for r in response.json()["data"]]

0 commit comments

Comments
 (0)