aformat() — langchain Function Reference
Architecture documentation for the aformat() function in chat.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD d36019e2_748c_4684_2c57_330dbdc419a4["aformat()"] 845a4803_caec_c00a_d98b_d3f3d3fae5d8["ChatMessagePromptTemplate"] d36019e2_748c_4684_2c57_330dbdc419a4 -->|defined in| 845a4803_caec_c00a_d98b_d3f3d3fae5d8 3916fd95_3f4c_3139_05ee_a34850487826["aformat()"] 3916fd95_3f4c_3139_05ee_a34850487826 -->|calls| d36019e2_748c_4684_2c57_330dbdc419a4 12501cb5_f260_9904_b738_b5abce848eb3["aformat()"] 12501cb5_f260_9904_b738_b5abce848eb3 -->|calls| d36019e2_748c_4684_2c57_330dbdc419a4 a2b4f8ac_2b89_d468_ad91_8d0355c8d508["aformat()"] a2b4f8ac_2b89_d468_ad91_8d0355c8d508 -->|calls| d36019e2_748c_4684_2c57_330dbdc419a4 12501cb5_f260_9904_b738_b5abce848eb3["aformat()"] d36019e2_748c_4684_2c57_330dbdc419a4 -->|calls| 12501cb5_f260_9904_b738_b5abce848eb3 style d36019e2_748c_4684_2c57_330dbdc419a4 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/langchain_core/prompts/chat.py lines 373–385
async def aformat(self, **kwargs: Any) -> BaseMessage:
"""Async format the prompt template.
Args:
**kwargs: Keyword arguments to use for formatting.
Returns:
Formatted message.
"""
text = await self.prompt.aformat(**kwargs)
return ChatMessage(
content=text, role=self.role, additional_kwargs=self.additional_kwargs
)
Domain
Subdomains
Defined In
Calls
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 373.
What does aformat() call?
aformat() calls 1 function(s): aformat.
What calls aformat()?
aformat() is called by 3 function(s): aformat, aformat, aformat.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free