fix: adapt UiPathChatAnthropic to the langchain-anthropic 1.7.0 raw-response contract - #133
Open
andreibalas-uipath wants to merge 2 commits into
Open
fix: adapt UiPathChatAnthropic to the langchain-anthropic 1.7.0 raw-response contract#133andreibalas-uipath wants to merge 2 commits into
andreibalas-uipath wants to merge 2 commits into
Conversation
…nse contract - _create/_acreate now return raw-response wrappers (with_raw_response) since langchain-anthropic 1.7.0 calls .parse() on the result; previously every invoke/stream/tool-calling/structured-output call failed with "'Message' object has no attribute 'parse'" - raise langchain-anthropic floor to >=1.7.0,<2.0.0 (anthropic extra, and explicitly on the bedrock extra which pulls it transitively) - fix UiPathChatLiteLLM stream()/astream() silently degrading to non-streaming on langchain-core >= 1.4 (pulled in by langchain-anthropic 1.7.0), caused by ChatLiteLLM's validator marking streaming=False as explicitly set - regenerate uv.lock (langchain-anthropic 1.7.0, anthropic 0.125.0 — still <1.0.0) - bump uipath-langchain-client to 1.18.2 with changelog entry Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
andreibalas-uipath
requested review from
DragosBobolea,
cosminacho,
cristipufu,
dragosvelcea,
ionmincu,
ionut-mihalache-uipath,
radu-mocanu and
vldcmp-uipath
as code owners
September 2, 2026 12:25
andreibalas-uipath
force-pushed
the
fix/langchain-anthropic-1.7.0-raw-response
branch
from
September 3, 2026 13:05
c861913 to
a765297
Compare
andreibalas-uipath
force-pushed
the
fix/langchain-anthropic-1.7.0-raw-response
branch
from
September 3, 2026 13:10
a765297 to
1d40b24
Compare
andreibalas-uipath
force-pushed
the
fix/langchain-anthropic-1.7.0-raw-response
branch
from
September 3, 2026 13:17
1d40b24 to
6182710
Compare
andreibalas-uipath
force-pushed
the
fix/langchain-anthropic-1.7.0-raw-response
branch
from
September 3, 2026 13:36
6182710 to
8c4bc1c
Compare
Builds both wheels from the PR, injects tool.uv.override-dependencies into the downstream checkout (UV_OVERRIDE is silently ignored by uv project commands), runs the downstream unit suite and the chat-models / multimodal-invoke live testcases, and exposes a single downstream-gate check suitable for branch protection. Requires ALPHA_TEST_CLIENT_ID/ ALPHA_TEST_CLIENT_SECRET/ALPHA_BASE_URL secrets; skip:downstream label bypasses. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
andreibalas-uipath
force-pushed
the
fix/langchain-anthropic-1.7.0-raw-response
branch
from
September 3, 2026 14:11
8c4bc1c to
ebac946
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed and why
Follow-up to #132, which pinned
langchain-anthropic<1.7.0as an interim mitigation. This PR is the real fix, plus a downstream CI gate so this class of breakage is caught before publish in the future.langchain-anthropic 1.7.0 contract fix
UiPathChatAnthropic._create/._acreatenow route throughwith_raw_response.create(...)(both the plain andbetasbranches). langchain-anthropic 1.7.0 changed these private methods to return a raw-response wrapper and calls.parse()on the result; the previous override bodies returned parsed objects, so every operation failed with'Message'/'Stream'/'AsyncStream' object has no attribute 'parse'.langchain-anthropicbound on theanthropicandbedrockextras moves from>=1.4.1,<1.7.0(the fix: bound langchain-anthropic<1.7.0 in uipath-langchain-client #132 pin) to>=1.7.0,<2.0.0.UiPathChatLiteLLMno longer lets ChatLiteLLM's before-validator markstreaming=Falseas explicitly set: langchain-core >= 1.4 treats that as a hard streaming opt-out, silently downgrading.stream()/.astream()to non-streaming invokes.tests/langchain/clients/anthropic/test_raw_response_contract.pyandtests/langchain/clients/litellm/test_streaming_dispatch.py.Downstream integration gate (new CI)
.github/workflows/test-downstream-langchain.yml+.github/scripts/inject_uv_overrides.py: on every PR that touches package source, build both wheels from the PR, injecttool.uv.override-dependenciesinto a checkout of uipath-langchain-python main (theUV_OVERRIDEenv var used by uipath-python's cross-tests is silently ignored by uv project commands — verified), then run thechat-modelsandmultimodal-invokelive integration testcases against alpha via the downstream's ownrun.sh/validate_output.sh— the two testcases that exercise the LLM client end to end.A single
downstream-gatecheck summarizes (passes when jobs were legitimately skipped), suitable for branch protection.skip:downstreamlabel bypasses.Prerequisite before the integration jobs can pass: repo secrets
ALPHA_TEST_CLIENT_ID,ALPHA_TEST_CLIENT_SECRET,ALPHA_BASE_URL(same values as uipath-langchain-python's integration workflow). Until they're added, the two live jobs (and the gate) will fail on this PR. Do not markdownstream-gaterequired until secrets are in and a burn-in period has passed.Affected packages
uipath-langchain-clientonly (1.18.3 → 1.18.4). Core untouched (CI files are workflow-level).Verification
ruff check,ruff format --check,pyrightclean; full suite green (2110 passed, cassette replay).anthropic.claude-haiku-4-5-20251001-v1:0,vendor_type="awsbedrock").[tool.uv]present/absent paths), the testcase resolution picks the PR wheels with wheel-metadata-driven transitive pins and survives the testcase's ownuv add uipath-langchain[bedrock/vertex]steps, and the agent graph constructs all six chat-model classes against the injected packages. The only un-rehearsed step is the live testcase run (needs the alpha secrets).Side-finding for a separate PR
Rehearsing the gate surfaced a pre-existing latent drift bug: the
fireworksextra has nofireworks-aibound, so fresh resolutions pull fireworks-ai 1.x, which breaksUiPathChatFireworksimports (fireworks.client.api_clientremoved; 0.16+ also collides with the google/vertexai gRPC protos). Hidden today by committed lockfiles holding 0.15.x. Fix (fireworks-ai>=0.15.0,<0.16.0) to land separately.🤖 Generated with Claude Code