Skip to content

Commit b5d1d6a

Browse files
new: include youtube chapters into the summary as metadata
Signed-off-by: thiswillbeyourgithub <[email protected]>
1 parent 960fdce commit b5d1d6a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

wdoc/wdoc.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,10 @@ def summarize_documents(
660660
metadata.append(f"<author>\n{author}\n</author>")
661661
else:
662662
author = None
663+
if "yt_chapters" in relevant_docs[0].metadata:
664+
chapters = json.dumps(relevant_docs[0].metadata["yt_chapters"])
665+
metadata.append(
666+
f"<youtube_chapters>\n{chapters}\n</youtube_chapters>")
663667

664668
if metadata:
665669
metadata = "<text_metadata>\n" + "\n".join(metadata) + "\n"

0 commit comments

Comments
 (0)