Skip to content

Commit 4dcdccf

Browse files
al3xanndruandreiancuta-uipathcosminachoclaude
authored
Fix/byom not working (#49)
Co-authored-by: Andrei Ancuța <andrei.ancuta@uipath.com> Co-authored-by: Cosmin Maria <acosmin.maria@gmail.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 2934fe4 commit 4dcdccf

8 files changed

Lines changed: 32 additions & 11 deletions

File tree

.claude/CLAUDE.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,23 @@ Follow the existing format — newest version first, grouped by date:
9595

9696
---
9797

98+
## Pre-commit / Pre-PR Checklist
99+
100+
Before every commit and before opening a PR, always run:
101+
102+
```bash
103+
ruff check && ruff format --check && pytest tests
104+
```
105+
106+
All three must pass. Fix any lint, format, or test failures before committing. This applies when working as an AI assistant too — run the checks, fix failures, then commit.
107+
108+
---
109+
98110
## PR Guidelines
99111

100112
### Before Opening a PR
101113

102-
- Run `ruff check`, `ruff format --check`, and `pyright` — all must pass.
103-
- Run `pytest tests` — all tests must pass.
114+
- Run the pre-commit checklist above — all must pass.
104115
- Apply versioning rules above: the CI workflow (`ci_change_version.yml`) enforces that any changed source files must have a corresponding version bump and changelog entry.
105116

106117
### PR Scope

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.9] - 2026-03-26
6+
7+
### Fix
8+
- Use `availableOperationCodes` field (instead of `operationCodes`) when validating BYOM operation codes
9+
510
## [1.5.8] - 2026-03-26
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.9] - 2026-03-26
6+
7+
### Fix
8+
- Remove `fix_host_header` event hooks from `UiPathChatOpenAI`; host header management is handled by the underlying httpx client
9+
510
## [1.5.8] - 2026-03-26
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.13",
9-
"uipath-llm-client>=1.5.8",
9+
"uipath-llm-client>=1.5.9",
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.8"
3+
__version__ = "1.5.9"
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.8"
3+
__version__ = "1.5.9"

src/uipath/llm_client/settings/llmgateway/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def get_available_models(self) -> list[dict[str, Any]]:
117117
@override
118118
def validate_byo_model(self, model_info: dict[str, Any]) -> None:
119119
byom_details = model_info.get("byomDetails", {})
120-
operation_codes = byom_details.get("operationCodes", [])
120+
operation_codes = byom_details.get("availableOperationCodes", [])
121121
if self.operation_code and self.operation_code not in operation_codes:
122122
raise ValueError(
123123
f"The operation code {self.operation_code} is not allowed for the model {model_info['modelName']}"

tests/core/test_base_client.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1933,7 +1933,7 @@ def test_valid_operation_code(self, llmgw_env_vars):
19331933
settings.operation_code = "code1"
19341934
model_info = {
19351935
"modelName": "custom-model",
1936-
"byomDetails": {"operationCodes": ["code1", "code2"]},
1936+
"byomDetails": {"availableOperationCodes": ["code1", "code2"]},
19371937
}
19381938
settings.validate_byo_model(model_info) # Should not raise
19391939

@@ -1943,7 +1943,7 @@ def test_invalid_operation_code_raises(self, llmgw_env_vars):
19431943
settings.operation_code = "invalid-code"
19441944
model_info = {
19451945
"modelName": "custom-model",
1946-
"byomDetails": {"operationCodes": ["code1", "code2"]},
1946+
"byomDetails": {"availableOperationCodes": ["code1", "code2"]},
19471947
}
19481948
with pytest.raises(ValueError, match="operation code"):
19491949
settings.validate_byo_model(model_info)
@@ -1954,7 +1954,7 @@ def test_auto_picks_first_operation_code(self, llmgw_env_vars):
19541954
settings.operation_code = None
19551955
model_info = {
19561956
"modelName": "custom-model",
1957-
"byomDetails": {"operationCodes": ["auto-code"]},
1957+
"byomDetails": {"availableOperationCodes": ["auto-code"]},
19581958
}
19591959
settings.validate_byo_model(model_info)
19601960
assert settings.operation_code == "auto-code"
@@ -1965,7 +1965,7 @@ def test_auto_picks_first_with_warning_for_multiple(self, llmgw_env_vars):
19651965
settings.operation_code = None
19661966
model_info = {
19671967
"modelName": "custom-model",
1968-
"byomDetails": {"operationCodes": ["code1", "code2"]},
1968+
"byomDetails": {"availableOperationCodes": ["code1", "code2"]},
19691969
}
19701970
with patch("uipath.llm_client.settings.llmgateway.settings.logging") as mock_logging:
19711971
settings.validate_byo_model(model_info)
@@ -1978,7 +1978,7 @@ def test_no_operation_codes_no_change(self, llmgw_env_vars):
19781978
settings.operation_code = None
19791979
model_info = {
19801980
"modelName": "custom-model",
1981-
"byomDetails": {"operationCodes": []},
1981+
"byomDetails": {"availableOperationCodes": []},
19821982
}
19831983
settings.validate_byo_model(model_info)
19841984
assert settings.operation_code is None

0 commit comments

Comments
 (0)