|
|
|
@ -146,9 +146,11 @@ def format_document(doc: Document, prompt: BasePromptTemplate) -> str:
|
|
|
|
|
|
|
|
|
|
First, this pulls information from the document from two sources:
|
|
|
|
|
|
|
|
|
|
1. `page_content`: this takes the information from the `document.page_content`
|
|
|
|
|
1. `page_content`:
|
|
|
|
|
This takes the information from the `document.page_content`
|
|
|
|
|
and assigns it to a variable named `page_content`.
|
|
|
|
|
2. metadata: this takes information from `document.metadata` and assigns
|
|
|
|
|
2. 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.
|
|
|
|
|