fix: adapt UiPathChatAnthropic to the langchain-anthropic 1.7.0 raw-response contract - #133
Open
andreibalas-uipath wants to merge 1 commit into
Open
fix: adapt UiPathChatAnthropic to the langchain-anthropic 1.7.0 raw-response contract#133andreibalas-uipath wants to merge 1 commit into
andreibalas-uipath wants to merge 1 commit 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
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: it adaptsUiPathChatAnthropicto the langchain-anthropic 1.7.0 contract and lifts the pin.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 in_generate/_agenerate/_stream/_astream; 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 (pulled in by the lock refresh) treats that as a hard streaming opt-out, silently downgrading.stream()/.astream()to non-streaming invokes.tests/langchain/clients/anthropic/test_raw_response_contract.py(mocked-transport coverage of invoke/stream/tool-calling/structured-output, sync+async, thebetasrouting branch, and gateway-metadata extraction off the raw wrapper) andtests/langchain/clients/litellm/test_streaming_dispatch.py.Affected packages
uipath-langchain-clientonly (1.18.3 → 1.18.4). Core untouched.Verification
ruff check,ruff format --check,pyrightclean; full suite green (2110+ passed, cassette replay).'Message' object has no attribute 'parse', etc.); with this branch it passes 133/133, including the VCR integration tests replaying recorded gateway traffic for the same model/config the failing CI testcase uses (anthropic.claude-haiku-4-5-20251001-v1:0,vendor_type="awsbedrock").🤖 Generated with Claude Code