Home / Function/ dict() — langchain Function Reference

dict() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  08753471_4b72_7243_882e_931271f22646["dict()"]
  dddce6a3_2420_c71d_01fe_f214c3eb2503["BasePromptTemplate"]
  08753471_4b72_7243_882e_931271f22646 -->|defined in| dddce6a3_2420_c71d_01fe_f214c3eb2503
  40ea1f08_c628_27cc_09d4_5781e42cf86a["save()"]
  40ea1f08_c628_27cc_09d4_5781e42cf86a -->|calls| 08753471_4b72_7243_882e_931271f22646
  style 08753471_4b72_7243_882e_931271f22646 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/prompts/base.py lines 339–351

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

        Args:
            **kwargs: Any additional arguments to pass to the dictionary.

        Returns:
            Dictionary representation of the prompt.
        """
        prompt_dict = super().model_dump(**kwargs)
        with contextlib.suppress(NotImplementedError):
            prompt_dict["_type"] = self._prompt_type
        return prompt_dict

Subdomains

Called By

Frequently Asked Questions

What does dict() do?
dict() is a function in the langchain codebase, defined in libs/core/langchain_core/prompts/base.py.
Where is dict() defined?
dict() is defined in libs/core/langchain_core/prompts/base.py at line 339.
What calls dict()?
dict() is called by 1 function(s): save.

Analyze Your Own Codebase

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

Try Supermodel Free