Skip to content

Commit

Permalink
fix: Added discord summary type!
Browse files Browse the repository at this point in the history
To query the database for thread summaries, it wasn't possible to do with just checking the null values for thread in metadata.
  • Loading branch information
amindadgar committed Feb 12, 2024
1 parent 72b01a5 commit 8d820d2
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions dags/hivemind_etl_helpers/src/db/discord/summary/summary_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ def transform_thread_summary_to_document(
"date": summary_date,
"thread": thread_name,
"channel": thread_channel,
"type": "thread",
},
excluded_embed_metadata_keys=["date", "thread", "channel"],
excluded_embed_metadata_keys=["date", "thread", "channel", "type"],
)

return thread_summary_document
Expand Down Expand Up @@ -65,11 +66,8 @@ def transform_channel_summary_to_document(

channel_summary_document = Document(
text=channel_summary,
metadata={
"date": summary_date,
"channel": channel_name,
},
excluded_embed_metadata_keys=["date", "thread", "channel"],
metadata={"date": summary_date, "channel": channel_name, "type": "channel"},
excluded_embed_metadata_keys=["date", "thread", "channel", "type"],
)

return channel_summary_document
Expand Down Expand Up @@ -99,10 +97,8 @@ def transform_daily_summary_to_document(
summary = daily_summary[date]
doc = Document(
text=summary,
metadata={
"date": date,
},
excluded_embed_metadata_keys=["date", "thread", "channel"],
metadata={"date": date, "type": "day"},
excluded_embed_metadata_keys=["date", "thread", "channel", "type"],
)
daily_summary_documents.append(doc)

Expand Down

0 comments on commit 8d820d2

Please sign in to comment.