Skip to content

Commit 4cf4548

Browse files
authored
Updated included headers on LLMGW settings (#18)
1 parent 5390289 commit 4cf4548

7 files changed

Lines changed: 31 additions & 8 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.0.13] - 2026-02-05
6+
7+
### Fix
8+
- Fixed headers on llmgw settings
9+
510
## [1.0.12] - 2026-02-05
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.0.13] - 2026-02-05
6+
7+
### Fix
8+
- Bump version
9+
510
## [1.0.12] - 2026-02-05
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.7",
9-
"uipath-llm-client>=1.0.10",
9+
"uipath-llm-client>=1.0.13",
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.0.12"
3+
__version__ = "1.0.13"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
__titile__ = "UiPath LLM Client"
22
__description__ = "A Python client for interacting with UiPath's LLM services."
3-
__version__ = "1.0.12"
3+
__version__ = "1.0.13"

src/uipath_llm_client/settings/agenthub/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ class AgentHubBaseSettings(UiPathBaseSettings):
3535

3636
model_config = SettingsConfigDict(validate_by_alias=True)
3737

38-
# Environment configuration
38+
# Environment configuration: alpha, staging, cloud
3939
environment: str | None = Field(default=None, validation_alias="UIPATH_ENVIRONMENT")
4040

41-
# Authentication fields
41+
# Authentication fields - retrieved from uipath auth as well
4242
access_token: SecretStr | None = Field(default=None, validation_alias="UIPATH_ACCESS_TOKEN")
4343
base_url: str | None = Field(default=None, validation_alias="UIPATH_URL")
4444
tenant_id: str | None = Field(default=None, validation_alias="UIPATH_TENANT_ID")

src/uipath_llm_client/settings/llmgateway/settings.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,18 @@ class LLMGatewayBaseSettings(UiPathBaseSettings):
4242
requesting_product: str = Field(default=..., validation_alias="LLMGW_REQUESTING_PRODUCT")
4343
requesting_feature: str = Field(default=..., validation_alias="LLMGW_REQUESTING_FEATURE")
4444

45-
# Optional fields - used for tracking and billing
46-
user_id: str | None = Field(default=None, validation_alias="LLMGW_SEMANTIC_USER_ID")
47-
action_id: str | None = Field(default=None, validation_alias="LLMGW_ACTION_ID")
45+
# Optional fields - situational usecase
46+
user_id: str | None = Field(
47+
default=None, validation_alias="LLMGW_SEMANTIC_USER_ID"
48+
) # used to apply governance rules
49+
action_id: str | None = Field(
50+
default=None, validation_alias="LLMGW_ACTION_ID"
51+
) # used to track the action
52+
operation_code: str | None = Field(
53+
default=None, validation_alias="LLMGW_OPERATION_CODE"
54+
) # used to correctly identify byo models
55+
56+
# additional headers for the request (e.g. X-UiPath-LlmGateway-Telemetry-SessionId)
4857
additional_headers: Mapping[str, str] = Field(
4958
default_factory=dict, validation_alias="LLMGW_ADDITIONAL_HEADERS"
5059
)
@@ -82,11 +91,15 @@ def build_auth_headers(
8291
headers = {
8392
"X-UiPath-LlmGateway-RequestingProduct": self.requesting_product,
8493
"X-UiPath-LlmGateway-RequestingFeature": self.requesting_feature,
94+
"X-UiPath-Internal-AccountId": self.org_id,
95+
"X-UiPath-Internal-TenantId": self.tenant_id,
8596
}
8697
if self.user_id:
8798
headers["X-UiPath-LlmGateway-UserId"] = self.user_id
8899
if self.action_id:
89100
headers["X-UiPath-LlmGateway-ActionId"] = self.action_id
101+
if self.operation_code:
102+
headers["X-UiPath-LlmGateway-OperationCode"] = self.operation_code
90103
if self.additional_headers:
91104
headers.update(self.additional_headers)
92105
return headers

0 commit comments

Comments
 (0)