Home / Function/ dict() — langchain Function Reference

dict() — langchain Function Reference

Architecture documentation for the dict() function in agent.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  7e22a32a_d4cd_934d_79bf_5d7579310aae["dict()"]
  2066c331_3189_1880_ba09_f5a3c375c553["BaseSingleActionAgent"]
  7e22a32a_d4cd_934d_79bf_5d7579310aae -->|defined in| 2066c331_3189_1880_ba09_f5a3c375c553
  008c369d_f4fc_8ebd_1976_f8b1ae09e0b6["save()"]
  008c369d_f4fc_8ebd_1976_f8b1ae09e0b6 -->|calls| 7e22a32a_d4cd_934d_79bf_5d7579310aae
  8921be96_9d38_54f4_d572_0bc8f4e4559d["dict()"]
  8921be96_9d38_54f4_d572_0bc8f4e4559d -->|calls| 7e22a32a_d4cd_934d_79bf_5d7579310aae
  f53d8b5e_d30a_de4d_2e3d_9cc35a4960ef["dict()"]
  f53d8b5e_d30a_de4d_2e3d_9cc35a4960ef -->|calls| 7e22a32a_d4cd_934d_79bf_5d7579310aae
  8921be96_9d38_54f4_d572_0bc8f4e4559d["dict()"]
  7e22a32a_d4cd_934d_79bf_5d7579310aae -->|calls| 8921be96_9d38_54f4_d572_0bc8f4e4559d
  style 7e22a32a_d4cd_934d_79bf_5d7579310aae fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/agents/agent.py lines 165–180

    def dict(self, **kwargs: Any) -> builtins.dict:
        """Return dictionary representation of agent.

        Returns:
            Dictionary representation of agent.
        """
        _dict = super().model_dump()
        try:
            _type = self._agent_type
        except NotImplementedError:
            _type = None
        if isinstance(_type, AgentType):
            _dict["_type"] = str(_type.value)
        elif _type is not None:
            _dict["_type"] = _type
        return _dict

Subdomains

Calls

Called By

Frequently Asked Questions

What does dict() do?
dict() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/agents/agent.py.
Where is dict() defined?
dict() is defined in libs/langchain/langchain_classic/agents/agent.py at line 165.
What does dict() call?
dict() calls 1 function(s): dict.
What calls dict()?
dict() is called by 3 function(s): dict, dict, save.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free