pretty_repr() — langchain Function Reference
Architecture documentation for the pretty_repr() function in chat.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 9774ca51_c1fb_c680_32ab_554a3b7f3c21["pretty_repr()"] 894611e5_5039_7621_4673_821d0b9b6f17["_StringImageMessagePromptTemplate"] 9774ca51_c1fb_c680_32ab_554a3b7f3c21 -->|defined in| 894611e5_5039_7621_4673_821d0b9b6f17 47fe42aa_c8e0_87b2_ad04_4343c7ef26cb["pretty_repr()"] 47fe42aa_c8e0_87b2_ad04_4343c7ef26cb -->|calls| 9774ca51_c1fb_c680_32ab_554a3b7f3c21 8b62d957_2f91_a1a5_4cc0_40e77c03366e["pretty_repr()"] 8b62d957_2f91_a1a5_4cc0_40e77c03366e -->|calls| 9774ca51_c1fb_c680_32ab_554a3b7f3c21 47fe42aa_c8e0_87b2_ad04_4343c7ef26cb["pretty_repr()"] 9774ca51_c1fb_c680_32ab_554a3b7f3c21 -->|calls| 47fe42aa_c8e0_87b2_ad04_4343c7ef26cb style 9774ca51_c1fb_c680_32ab_554a3b7f3c21 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/langchain_core/prompts/chat.py lines 646–660
def pretty_repr(self, html: bool = False) -> str:
"""Human-readable representation.
Args:
html: Whether to format as HTML.
Returns:
Human-readable representation.
"""
# TODO: Handle partials
title = self.__class__.__name__.replace("MessagePromptTemplate", " Message")
title = get_msg_title_repr(title, bold=html)
prompts = self.prompt if isinstance(self.prompt, list) else [self.prompt]
prompt_reprs = "\n\n".join(prompt.pretty_repr(html=html) for prompt in prompts)
return f"{title}\n\n{prompt_reprs}"
Domain
Subdomains
Defined In
Calls
Called By
Source
Frequently Asked Questions
What does pretty_repr() do?
pretty_repr() is a function in the langchain codebase, defined in libs/core/langchain_core/prompts/chat.py.
Where is pretty_repr() defined?
pretty_repr() is defined in libs/core/langchain_core/prompts/chat.py at line 646.
What does pretty_repr() call?
pretty_repr() calls 1 function(s): pretty_repr.
What calls pretty_repr()?
pretty_repr() is called by 2 function(s): pretty_repr, pretty_repr.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free