Package
Example Code (Python)
from langsmith import Client
client = Client(api_key=LANGSMITH_API_KEY)
prompt = client.pull_prompt(PROMPT_ID, include_model=True) #Model must be any ChatBedrockConverse in Langsmith
print(prompt.last.bound.invoke("hi"))
Error Message and Stack Trace (if applicable)
ValueError: Deserialization of ('langchain', 'chat_models', 'openai', 'ChatOpenAI') is not allowed. The default (allowed_objects='core') only permits core langchain-core classes. To allow trusted partner integrations, use allowed_objects='all'. Alternatively, pass an explicit list of allowed classes via allowed_objects=[...]. See langchain_core.load.mapping for the full allowlist.
Description
Irrespective of langchain-aws and langsmith versions, pulling ChatBedrockConverse models through langsmith's pull_prompt method with include_model=True is broken from langchain-core>=1.2.5, works perfectly in 1.2.4.
I traced it to #34455. In this PR it seems there was a larger enforcement of the whitelist for partner models/packages. The issue I'm facing is also referenced in langchain-ai/langchain-aws#816, where allowed_objects='all' is used to pass unit tests, however, when pulling using the langsmith client this is not possible to set, resulting in the broken integration.
Looked into the allow list in langchain_core/load/mapping.py and I found the issue: ChatBedrock is allowed, BedrockLLM is allowed, but ChatBedrockConverse is not in the list. I quickly patched this locally and the issue seems to be fully fixed. I'll be creating a PR for this, but would appreciate if anyone could point out anything I might've missed.
Package
Example Code (Python)
Error Message and Stack Trace (if applicable)
Description
Irrespective of
langchain-awsandlangsmithversions, pulling ChatBedrockConverse models through langsmith's pull_prompt method withinclude_model=Trueis broken fromlangchain-core>=1.2.5, works perfectly in 1.2.4.I traced it to #34455. In this PR it seems there was a larger enforcement of the whitelist for partner models/packages. The issue I'm facing is also referenced in langchain-ai/langchain-aws#816, where
allowed_objects='all'is used to pass unit tests, however, when pulling using the langsmith client this is not possible to set, resulting in the broken integration.Looked into the allow list in langchain_core/load/mapping.py and I found the issue: ChatBedrock is allowed, BedrockLLM is allowed, but ChatBedrockConverse is not in the list. I quickly patched this locally and the issue seems to be fully fixed. I'll be creating a PR for this, but would appreciate if anyone could point out anything I might've missed.