community[patch]: bugfix for YoutubeLoader's LINES format (#22815)

- **Description:** A change I submitted recently introduced a bug in
`YoutubeLoader`'s `LINES` output format. In those conditions, curly
braces ("`{}`") creates a set, not a dictionary. This bugfix explicitly
specifies that a dictionary is created.
- **Issue:** N/A
- **Dependencies:** N/A
- **Twitter:** lsloan_umich
- **Mastodon:**
[lsloan@mastodon.social](https://mastodon.social/@lsloan)
This commit is contained in:
Mr. Lance E Sloan «UMich» 2024-06-12 12:29:34 -04:00 committed by GitHub
parent 23c22fcbc9
commit 08c466c603
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -282,11 +282,11 @@ class YoutubeLoader(BaseLoader):
map(
lambda transcript_piece: Document(
page_content=transcript_piece["text"].strip(" "),
metadata={
metadata=dict(
filter(
lambda item: item[0] != "text", transcript_piece.items()
)
},
),
),
transcript_pieces,
)