Skip to content

Commit

Permalink
feat: saving datetime instead of date for Qdrant db!
Browse files Browse the repository at this point in the history
Qdrant db, doesn't support python date
  • Loading branch information
amindadgar committed Nov 6, 2024
1 parent d54c82a commit 08c52dd
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from datetime import date, timedelta
from datetime import date, datetime, timedelta, timezone

from llama_index.core import Document

Expand Down Expand Up @@ -32,7 +32,9 @@ def transform(self, summaries: dict[date, str]) -> list[Document]:
+ (day + timedelta(days=1)).strftime("%Y-%m-%d"),
text=summary,
metadata={
"date": day,
"date": datetime.combine(
day, datetime.min.time(), tzinfo=timezone.utc
),
},
)
summary_docs.append(document)
Expand Down

0 comments on commit 08c52dd

Please sign in to comment.