aformat() — langchain Function Reference
Architecture documentation for the aformat() function in chat.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD a2b4f8ac_2b89_d468_ad91_8d0355c8d508["aformat()"] 93017235_36b7_3b85_820e_aa7d145183e5["BaseChatPromptTemplate"] a2b4f8ac_2b89_d468_ad91_8d0355c8d508 -->|defined in| 93017235_36b7_3b85_820e_aa7d145183e5 54d4332a_99bc_4cc5_b549_4f0b0cddfb16["aformat_prompt()"] a2b4f8ac_2b89_d468_ad91_8d0355c8d508 -->|calls| 54d4332a_99bc_4cc5_b549_4f0b0cddfb16 d36019e2_748c_4684_2c57_330dbdc419a4["aformat()"] a2b4f8ac_2b89_d468_ad91_8d0355c8d508 -->|calls| d36019e2_748c_4684_2c57_330dbdc419a4 style a2b4f8ac_2b89_d468_ad91_8d0355c8d508 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/langchain_core/prompts/chat.py lines 710–720
async def aformat(self, **kwargs: Any) -> str:
"""Async format the chat template into a string.
Args:
**kwargs: Keyword arguments to use for filling in template variables in all
the template messages in this chat template.
Returns:
Formatted string.
"""
return (await self.aformat_prompt(**kwargs)).to_string()
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does aformat() do?
aformat() is a function in the langchain codebase, defined in libs/core/langchain_core/prompts/chat.py.
Where is aformat() defined?
aformat() is defined in libs/core/langchain_core/prompts/chat.py at line 710.
What does aformat() call?
aformat() calls 2 function(s): aformat, aformat_prompt.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free