Fix: detect Anthropic-family models by name for BYOM (core + langchain)#64
Merged
cosminacho merged 5 commits intomainfrom Apr 17, 2026
Merged
Fix: detect Anthropic-family models by name for BYOM (core + langchain)#64cosminacho merged 5 commits intomainfrom
cosminacho merged 5 commits intomainfrom
Conversation
Expand the model-name heuristic to treat `anthropic`, `opus`, `sonnet`, `haiku`, and `mythos` as Claude-family indicators alongside `claude`. Applies to the Bedrock INVOKE factory routing and the normalized client's empty tool-call content workaround. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
BYOM discovery does not expose modelFamily, so the LiteLLM client's is_claude checks silently fell through for custom-named Claude deployments. Extract the keyword heuristic into a shared is_anthropic_model_name() helper in core and use it as a fallback whenever modelFamily is None. Refactor the two langchain call sites to consume the same helper. Core 1.9.0 -> 1.9.1. Langchain now requires core >= 1.9.1. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
constants.py is for enums and mappings, not utility functions. Relocate the helper + keyword tuple to a dedicated utils module and update all call sites to import from the new path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Expose the helper via uipath_langchain_client.utils alongside other re-exported core utilities (exceptions, RetryConfig). Internal callers now import from the package-local utils module instead of reaching across to uipath.llm_client.utils.model_family directly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
BYOM discovery does not expose
modelFamily, sois_claude == (model_family == ANTHROPIC_CLAUDE)silently fell through for custom-named Claude deployments. Add a shared name-keyword heuristic in core and use it as a fallback everywheremodelFamilyis the Claude signal.is_anthropic_model_name()helper +ANTHROPIC_MODEL_NAME_KEYWORDS(anthropic,claude,opus,sonnet,haiku,mythos) in settings/constants.py.is_claudeand default-flavor resolution (Bedrock INVOKE, Vertex anthropic-claude) now fall back to the name heuristic whenmodelFamily is None. This fixes BYOM Claude routing.Packages affected
uipath-llm-client1.9.0 → 1.9.1 (new helper + litellm BYOM fix)uipath-langchain-client1.9.0 → 1.9.1; minimum core dep bumped to 1.9.1Test plan
ruff check && ruff formatpyrightpytest tests(1514 passed, 736 skipped, 9 xpassed)🤖 Generated with Claude Code