Skip to content

Commit 2934fe4

Browse files
cosminachoclaude
andauthored
Fix: Add claude md and base url fix (#50)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 5fe3a6d commit 2934fe4

8 files changed

Lines changed: 163 additions & 3 deletions

File tree

.claude/CLAUDE.md

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
# CLAUDE.md — UiPath LLM Client
2+
3+
## Project Overview
4+
5+
This is a Python monorepo providing a unified client for UiPath's LLM services. It has two published packages:
6+
7+
- **`uipath-llm-client`** (core) — located at `src/uipath/llm_client/`. Core HTTP client with auth, retry, and provider-specific clients (OpenAI, Google, Anthropic).
8+
- **`uipath-langchain-client`** (langchain) — located at `packages/uipath_langchain_client/`. LangChain-compatible chat models and embeddings, depends on the core package.
9+
10+
Supported backends: **AgentHub** (default), **LLMGateway**, and **Orchestrator**.
11+
12+
---
13+
14+
## Development Setup
15+
16+
Uses [uv](https://docs.astral.sh/uv/) with workspace support.
17+
18+
```bash
19+
uv sync --all-extras
20+
```
21+
22+
Run tests:
23+
```bash
24+
pytest tests
25+
```
26+
27+
Lint and format:
28+
```bash
29+
ruff check
30+
ruff format --check
31+
pyright
32+
```
33+
34+
Tests use VCR cassettes (SQLite, `tests/cassettes.db`) via `pytest-recording`. HTTP is recorded and replayed; real network calls are not made in CI.
35+
36+
---
37+
38+
## Repository Structure
39+
40+
```
41+
src/uipath/llm_client/ # Core package source
42+
clients/ # Provider clients (openai, google, anthropic)
43+
settings/ # Backend settings (platform, llmgateway)
44+
utils/ # Shared utilities
45+
__version__.py # Core version string
46+
packages/uipath_langchain_client/
47+
src/uipath_langchain_client/
48+
clients/ # LangChain model wrappers per provider
49+
__version__.py # LangChain version string
50+
pyproject.toml # LangChain package config (declares core dep)
51+
pyproject.toml # Root workspace config
52+
CHANGELOG.md # Core changelog
53+
packages/uipath_langchain_client/CHANGELOG.md # LangChain changelog
54+
tests/ # All tests (core/, langchain/, llamaindex/)
55+
.github/workflows/ # CI/CD pipelines
56+
```
57+
58+
---
59+
60+
## Versioning Rules
61+
62+
Both packages follow semantic versioning. The CD pipelines trigger on version changes in the respective `__version__.py` files.
63+
64+
### When core client changes
65+
66+
Update **all** of the following:
67+
68+
1. `src/uipath/llm_client/__version__.py` — bump core version
69+
2. `packages/uipath_langchain_client/src/uipath_langchain_client/__version__.py` — bump to same version
70+
3. `packages/uipath_langchain_client/pyproject.toml` — update the `uipath-llm-client >= X.Y.Z` dependency to match the new core version
71+
4. `CHANGELOG.md` — add entry under new version
72+
5. `packages/uipath_langchain_client/CHANGELOG.md` — add entry under new version
73+
74+
### When only langchain changes
75+
76+
Update **only**:
77+
78+
1. `packages/uipath_langchain_client/src/uipath_langchain_client/__version__.py` — bump langchain version
79+
2. `packages/uipath_langchain_client/CHANGELOG.md` — add entry under new version
80+
81+
Do **not** touch the core `__version__.py` or root `CHANGELOG.md` for langchain-only changes.
82+
83+
---
84+
85+
## CHANGELOG Format
86+
87+
Follow the existing format — newest version first, grouped by date:
88+
89+
```markdown
90+
## [X.Y.Z] - YYYY-MM-DD
91+
92+
### Added / Fixed / Changed
93+
- Description of the change
94+
```
95+
96+
---
97+
98+
## PR Guidelines
99+
100+
### Before Opening a PR
101+
102+
- Run `ruff check`, `ruff format --check`, and `pyright` — all must pass.
103+
- Run `pytest tests` — all tests must pass.
104+
- 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.
105+
106+
### PR Scope
107+
108+
- Keep PRs focused. One logical change per PR.
109+
- If a change touches both core and langchain, that is a single PR — both packages version together.
110+
- Do not mix version bumps with unrelated refactors.
111+
112+
### What to Include in the PR Description
113+
114+
- What changed and why.
115+
- Which package(s) are affected (core, langchain, or both).
116+
- Reference any related issues.
117+
118+
### Dev Builds
119+
120+
Add the `build:dev` label to a PR to trigger a dev package publish to TestPyPI. The PR description will be updated automatically with install instructions.
121+
122+
---
123+
124+
## Code Style
125+
126+
- **Formatter/linter:** ruff (config in root `pyproject.toml`)
127+
- **Type checker:** pyright (strict)
128+
- **Python version:** 3.11+ required, 3.13 used in CI
129+
- StrEnum string comparisons are acceptable — do not replace with enum constants.
130+
- Provider clients live under `clients/<provider>/` in both the core and langchain packages.
131+
- Settings use pydantic-settings with `BaseSettings`; do not add ad-hoc config.
132+
133+
---
134+
135+
## CI/CD Pipelines
136+
137+
| Workflow | Trigger | Purpose |
138+
|---|---|---|
139+
| `ci.yml` | PR to main | Lint, type check, run tests |
140+
| `ci_change_version.yml` | PR to main | Validate version bump + changelog |
141+
| `cd.yml` | Push to main (core version change) | Build + publish core to PyPI |
142+
| `cd-langchain.yml` | Push to main (langchain version change) | Build + publish langchain to PyPI |
143+
| `publish-dev.yml` | PR with `build:dev` label | Publish dev build to TestPyPI |
144+
145+
The langchain CD waits for the core package to appear on PyPI before building, since it depends on it.

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.8] - 2026-03-26
6+
7+
### Fix
8+
- Pass `base_url` to `OpenAI` and `AsyncOpenAI` constructors in `UiPathOpenAI` and `UiPathAsyncOpenAI` to ensure the correct endpoint is forwarded to the underlying SDK clients
9+
510
## [1.5.7] - 2026-03-23
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.8] - 2026-03-26
6+
7+
### Fix
8+
- Pass `base_url` to `OpenAI` and `AsyncOpenAI` constructors in `UiPathChatOpenAI` to ensure the correct endpoint is used by the underlying SDK clients
9+
510
## [1.5.7] - 2026-03-23
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.7",
9+
"uipath-llm-client>=1.5.8",
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.7"
3+
__version__ = "1.5.8"

packages/uipath_langchain_client/src/uipath_langchain_client/clients/openai/chat_models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,13 @@ async def fix_url_and_api_flavor_header_async(request: Request):
6464
api_key="PLACEHOLDER",
6565
max_retries=0, # handled by the UiPath client
6666
http_client=self.uipath_sync_client,
67+
base_url=base_url,
6768
)
6869
self.root_async_client = AsyncOpenAI(
6970
api_key="PLACEHOLDER",
7071
max_retries=0, # handled by the UiPath client
7172
http_client=self.uipath_async_client,
73+
base_url=base_url,
7274
)
7375
self.client = self.root_client.chat.completions
7476
self.async_client = self.root_async_client.chat.completions
@@ -111,6 +113,7 @@ async def fix_url_and_api_flavor_header_async(request: Request):
111113

112114
self.uipath_sync_client.event_hooks["request"].append(fix_url_and_api_flavor_header)
113115
self.uipath_async_client.event_hooks["request"].append(fix_url_and_api_flavor_header_async)
116+
114117
self.root_client = AzureOpenAI(
115118
azure_endpoint="PLACEHOLDER",
116119
api_version="PLACEHOLDER",
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.7"
3+
__version__ = "1.5.8"

src/uipath/llm_client/clients/openai/client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def __init__(
5252
api_key="PLACEHOLDER",
5353
max_retries=0,
5454
http_client=httpx_client,
55+
base_url=str(httpx_client.base_url).rstrip("/"),
5556
)
5657

5758

@@ -91,6 +92,7 @@ def __init__(
9192
api_key="PLACEHOLDER",
9293
max_retries=0,
9394
http_client=httpx_client,
95+
base_url=str(httpx_client.base_url).rstrip("/"),
9496
)
9597

9698

0 commit comments

Comments
 (0)