Skip to content

The agent engineering platform.

fix(core): Dereference Refs for pydantic schema fails in tool schema generation (#32203)

jmaillefaudfb5da8384e63
diff --git a/libs/core/langchain_core/utils/json_schema.py b/libs/core/langchain_core/utils/json_schema.py
index 0b738e04a0..70cea60d09 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: