|
1 | 1 | import json
|
2 | 2 | import logging
|
3 |
| -from os import environ as env |
4 | 3 | from typing import Any, Dict, List, Literal, Optional, Union
|
5 | 4 |
|
6 | 5 | from langchain_core.callbacks import (
|
@@ -85,15 +84,6 @@ def endpoint(self) -> str:
|
85 | 84 | class UiPathChat(UiPathRequestMixin, AzureChatOpenAI):
|
86 | 85 | """Custom LLM connector for LangChain integration with UiPath Normalized."""
|
87 | 86 |
|
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 |
| - |
97 | 87 | def _create_chat_result(
|
98 | 88 | self,
|
99 | 89 | response: Union[Dict[str, Any], BaseModel],
|
@@ -267,7 +257,7 @@ def with_structured_output(
|
267 | 257 |
|
268 | 258 | @property
|
269 | 259 | def endpoint(self) -> str:
|
270 |
| - endpoint = EndpointManager.get_passthrough_endpoint() |
| 260 | + endpoint = EndpointManager.get_normalized_endpoint() |
271 | 261 | logger.debug("Using endpoint: %s", endpoint)
|
272 | 262 | return endpoint.format(
|
273 | 263 | model=self.model_name, api_version=self.openai_api_version
|
|
0 commit comments