diff --git a/libs/core/langchain_core/utils/json_schema.py b/libs/core/langchain_core/utils/json_schema.py index 0b738e04a0c..70cea60d094 100644 --- a/libs/core/langchain_core/utils/json_schema.py +++ b/libs/core/langchain_core/utils/json_schema.py @@ -55,7 +55,7 @@ def _dereference_refs_helper( processed_refs = set() # 1) Pure $ref node? - if isinstance(obj, dict) and set(obj.keys()) == {"$ref"}: + if isinstance(obj, dict) and "$ref" in set(obj.keys()): ref_path = obj["$ref"] # cycle? if ref_path in processed_refs: