Async format a document into a string based on a prompt template.
First, this pulls information from the document from two sources:
page_content: This takes the information from the document.page_content and
assigns it to a variable named page_content.metadata: This takes information from document.metadata and assigns it to
variables of the same name.Those variables are then passed into the prompt to produce a formatted string.
aformat_document(
doc: Document,
prompt: BasePromptTemplate[str],
) -> str| Name | Type | Description |
|---|---|---|
doc* | Document |
|
prompt* | BasePromptTemplate[str] |
|