Skip to content

Commit eb2d43d

Browse files
authored
Merge pull request #129 from UiPath/fix/uipath_chat_endpoint
fix(chat): fix uipath chat endpoint
2 parents b5f0359 + 5758ef0 commit eb2d43d

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath-langchain"
3-
version = "0.0.117"
3+
version = "0.0.118"
44
description = "UiPath Langchain"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.10"

src/uipath_langchain/chat/models.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import json
22
import logging
3-
from os import environ as env
43
from typing import Any, Dict, List, Literal, Optional, Union
54

65
from langchain_core.callbacks import (
@@ -85,15 +84,6 @@ def endpoint(self) -> str:
8584
class UiPathChat(UiPathRequestMixin, AzureChatOpenAI):
8685
"""Custom LLM connector for LangChain integration with UiPath Normalized."""
8786

88-
def __init__(self, *args: Any, **kwargs: Any):
89-
"""Initialize the UiPath Azure Chat OpenAI model."""
90-
91-
super().__init__(*args, **kwargs)
92-
self.default_headers = {
93-
"X-UiPath-JobKey": env.get("UIPATH_JOB_KEY", ""),
94-
"X-UiPath-ProcessKey": env.get("UIPATH_PROCESS_KEY", ""),
95-
}
96-
9787
def _create_chat_result(
9888
self,
9989
response: Union[Dict[str, Any], BaseModel],
@@ -267,7 +257,7 @@ def with_structured_output(
267257

268258
@property
269259
def endpoint(self) -> str:
270-
endpoint = EndpointManager.get_passthrough_endpoint()
260+
endpoint = EndpointManager.get_normalized_endpoint()
271261
logger.debug("Using endpoint: %s", endpoint)
272262
return endpoint.format(
273263
model=self.model_name, api_version=self.openai_api_version

0 commit comments

Comments
 (0)