fix(core): add ChatBedrockConverse to deserialization allowlist#35404
fix(core): add ChatBedrockConverse to deserialization allowlist#35404Balaji Seshadri (gitbalaji) wants to merge 1 commit into
Conversation
Merging this PR will degrade performance by 17.65%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | WallTime | test_import_time[HumanMessage] |
239.3 ms | 281.6 ms | -15.02% |
| ❌ | WallTime | test_import_time[ChatPromptTemplate] |
549.8 ms | 639.4 ms | -14.02% |
| ❌ | WallTime | test_import_time[tool] |
473.5 ms | 575 ms | -17.65% |
| ❌ | WallTime | test_import_time[InMemoryVectorStore] |
552.5 ms | 617.3 ms | -10.5% |
| ❌ | WallTime | test_import_time[LangChainTracer] |
410.6 ms | 474.2 ms | -13.41% |
| ❌ | WallTime | test_import_time[CallbackManager] |
286.4 ms | 331.3 ms | -13.55% |
| ❌ | WallTime | test_import_time[RunnableLambda] |
442 ms | 514.9 ms | -14.15% |
| ❌ | WallTime | test_import_time[Runnable] |
444.5 ms | 494.5 ms | -10.1% |
| ❌ | WallTime | test_import_time[PydanticOutputParser] |
477.6 ms | 553.7 ms | -13.75% |
| ❌ | WallTime | test_import_time[Document] |
172.1 ms | 197.1 ms | -12.67% |
| ❌ | WallTime | test_import_time[InMemoryRateLimiter] |
158.6 ms | 187.7 ms | -15.46% |
| ❌ | WallTime | test_import_time[BaseChatModel] |
482.7 ms | 573.5 ms | -15.82% |
Comparing gitbalaji:fix/core-chat-bedrock-converse-allowlist (0f1fc20) with master (2d1492a)2
Footnotes
-
23 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
-
No successful run was found on
master(0b975d4) during the generation of this report, so 2d1492a was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
CodSpeed regressions are false positivesAll 7 flagged benchmarks are unrelated to this change. Our change: a single static dict entry added to Why none of these benchmarks can regress from our change:
The consistent ~10–15% regression across 6 unrelated import benchmarks in a single run is a textbook signature of a noisy shared runner, not a real regression. CodSpeed itself warns: "Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data." |
`ChatBedrockConverse` was absent from `SERIALIZABLE_MAPPING`, causing `langchain-core>=1.2.5` to raise a deserialization error when calling `langsmith.pull_prompt(..., include_model=True)` with a Bedrock Converse model. `ChatBedrock` and `BedrockLLM` were already allowed; this adds the missing entry for `ChatBedrockConverse`. Fixes langchain-ai#34645. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
5a8eb84 to
0f1fc20
Compare
ccurme (ccurme)
left a comment
There was a problem hiding this comment.
Duplicated with #34510.
Summary
Fixes #34645.
ChatBedrockConversewas absent fromSERIALIZABLE_MAPPINGinlangchain_core/load/mapping.py.langchain-core>=1.2.5(PR fix(core): serialization patch #34455 tightened the allowlist enforcement), callinglangsmith.pull_prompt(..., include_model=True)with aChatBedrockConversemodel raises:ChatBedrockandBedrockLLMwere already in the mapping —ChatBedrockConversewas simply missed.("langchain_aws", "chat_models", "ChatBedrockConverse")→langchain_aws.chat_models.bedrock_converse.ChatBedrockConverse(confirmed viaChatBedrockConverse.get_lc_namespace()returning["langchain_aws", "chat_models"]).Areas requiring careful review
("langchain_aws", "chat_models", "ChatBedrockConverse")is derived fromget_lc_namespace()+ class name — confirmed against the source inlangchain-ai/langchain-aws.Test plan
test_chat_bedrock_converse_in_serializable_mapping— asserts the key is present and maps to the correct module path (nolangchain-awsinstall required)tests/unit_tests/load/test_serializable.pysuite passes (45 tests)ruff check,ruff format,mypyclean🤖 Generated with Claude Code