Skip to content

Commit

Permalink
Add owner and size to text metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
Raj725 committed Sep 20, 2024
1 parent 8d8b27b commit 06fd572
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pebblo_safeloader/langchain/textloader_postgress/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


def get_data(
metadata=False, ids=False, metadatas=False
metadata=False, ids=False, metadatas=False
) -> tuple[
list[str],
Optional[dict[str, Any]],
Expand Down Expand Up @@ -40,8 +40,12 @@ def get_data(
if metadatas:
# Metadata(source: fake news web url) for each text
_metadata_list = [
{"source": f"https://www.acme.org/news/{i}"}
for i in range(1, len(texts) + 1)
{
"source": f"https://www.acme.org/news/{i + 1}",
"owner": "Joe Smith",
"size": f"{len(texts[i])}"
}
for i in range(len(texts))
]
else:
_metadata_list = None
Expand Down

0 comments on commit 06fd572

Please sign in to comment.