Skip to content

Commit 62083f6

Browse files
authored
Fix: AgentHub Headers (#46)
1 parent 4a7c2f5 commit 62083f6

7 files changed

Lines changed: 30 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
All notable changes to `uipath_llm_client` (core package) will be documented in this file.
44

5+
## [1.5.5] - 2026-03-19
6+
7+
### Fix
8+
- Fix headers for Platform Settings
9+
510
## [1.5.3] - 2026-03-18
611

712
### Fix

packages/uipath_langchain_client/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
All notable changes to `uipath_langchain_client` will be documented in this file.
44

5+
## [1.5.5] - 2026-03-19
6+
7+
### Fix headers
8+
- Fix headers
9+
510
## [1.5.4] - 2026-03-19
611

712
### Fix

packages/uipath_langchain_client/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ readme = "README.md"
66
requires-python = ">=3.11"
77
dependencies = [
88
"langchain>=1.2.12",
9-
"uipath-llm-client>=1.5.3",
9+
"uipath-llm-client>=1.5.5",
1010
]
1111

1212
[project.optional-dependencies]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
__title__ = "UiPath LangChain Client"
22
__description__ = "A Python client for interacting with UiPath's LLM services via LangChain."
3-
__version__ = "1.5.4"
3+
__version__ = "1.5.5"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
__title__ = "UiPath LLM Client"
22
__description__ = "A Python client for interacting with UiPath's LLM services."
3-
__version__ = "1.5.3"
3+
__version__ = "1.5.5"

src/uipath/llm_client/settings/platform/settings.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ class PlatformBaseSettings(UiPathBaseSettings):
4848

4949
# Tracing configuration
5050
process_key: str | None = Field(default=None, validation_alias="UIPATH_PROCESS_KEY")
51+
folder_key: str | None = Field(default=None, validation_alias="UIPATH_FOLDER_KEY")
5152
job_key: str | None = Field(default=None, validation_alias="UIPATH_JOB_KEY")
53+
trace_id: str | None = Field(default=None, validation_alias="UIPATH_TRACE_ID")
5254

5355
@model_validator(mode="after")
5456
def validate_environment(self) -> Self:
@@ -128,12 +130,20 @@ def build_auth_headers(
128130
) -> Mapping[str, str]:
129131
"""Build authentication and routing headers for API requests."""
130132
headers: dict[str, str] = {}
133+
if self.organization_id:
134+
headers["X-UiPath-Internal-AccountId"] = self.organization_id
135+
if self.tenant_id:
136+
headers["X-UiPath-Internal-TenantId"] = self.tenant_id
131137
if self.agenthub_config:
132138
headers["X-UiPath-AgentHub-Config"] = self.agenthub_config
133139
if self.process_key:
134140
headers["X-UiPath-ProcessKey"] = self.process_key
141+
if self.folder_key:
142+
headers["X-UiPath-FolderKey"] = self.folder_key
135143
if self.job_key:
136144
headers["X-UiPath-JobKey"] = self.job_key
145+
if self.trace_id:
146+
headers["X-UiPath-TraceId"] = self.trace_id
137147
return headers
138148

139149
@override

tests/core/test_base_client.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,11 @@ def test_build_auth_headers_has_default_config(self, platform_env_vars, mock_pla
525525
with patch.dict(os.environ, platform_env_vars, clear=True):
526526
settings = PlatformSettings()
527527
headers = settings.build_auth_headers()
528-
assert headers == {"X-UiPath-AgentHub-Config": "agentsruntime"}
528+
assert headers == {
529+
"X-UiPath-Internal-AccountId": "test-org-id",
530+
"X-UiPath-Internal-TenantId": "test-tenant-id",
531+
"X-UiPath-AgentHub-Config": "agentsruntime",
532+
}
529533

530534
def test_build_auth_headers_with_tracing(self, platform_env_vars, mock_platform_auth):
531535
"""Test build_auth_headers includes tracing headers when set."""
@@ -655,6 +659,8 @@ def test_build_auth_headers_empty_when_no_optional(self, platform_env_vars, mock
655659
settings.agenthub_config = ""
656660
settings.process_key = None
657661
settings.job_key = None
662+
settings.organization_id = None
663+
settings.tenant_id = None
658664
headers = settings.build_auth_headers()
659665
assert headers == {}
660666

0 commit comments

Comments
 (0)