_recursive_dump() — langchain Function Reference
Architecture documentation for the _recursive_dump() function in test_agent.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD d057073c_d436_881b_39c0_9a71bc129dcd["_recursive_dump()"] 47a7b285_8e60_f78f_282d_429958c446fa["test_agent.py"] d057073c_d436_881b_39c0_9a71bc129dcd -->|defined in| 47a7b285_8e60_f78f_282d_429958c446fa 3fe24fd2_57d5_7278_725d_f532b8fd70bc["test_openai_agent_with_streaming()"] 3fe24fd2_57d5_7278_725d_f532b8fd70bc -->|calls| d057073c_d436_881b_39c0_9a71bc129dcd style d057073c_d436_881b_39c0_9a71bc129dcd fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain/tests/unit_tests/agents/test_agent.py lines 811–828
def _recursive_dump(obj: Any) -> Any:
"""Recursively dump the object if encountering any pydantic models."""
if isinstance(obj, dict):
return {
k: _recursive_dump(v)
for k, v in obj.items()
if k != "id" # Remove the id field for testing purposes
}
if isinstance(obj, list):
return [_recursive_dump(v) for v in obj]
if hasattr(obj, "dict"):
# if the object contains an ID field, we'll remove it for testing purposes
if hasattr(obj, "id"):
d = obj.model_dump()
d.pop("id")
return _recursive_dump(d)
return _recursive_dump(obj.model_dump())
return obj
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does _recursive_dump() do?
_recursive_dump() is a function in the langchain codebase, defined in libs/langchain/tests/unit_tests/agents/test_agent.py.
Where is _recursive_dump() defined?
_recursive_dump() is defined in libs/langchain/tests/unit_tests/agents/test_agent.py at line 811.
What calls _recursive_dump()?
_recursive_dump() is called by 1 function(s): test_openai_agent_with_streaming.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free