Skip to content

Commit

Permalink
chore: logs
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesponti committed Sep 24, 2024
1 parent b9773e1 commit 47f7e19
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/crons/focus_crons.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,14 @@ def refresh_focus_from_chroma():
print("Refreshing Focus from Chroma")
try:
focus_items = session.query(Focus).filter(Focus.in_vector_store.is_(False)).all()
print(f"Focus items: {focus_items}")
if not focus_items:
logger.info("No focus items to refresh from the vector store.")
return

print(f"Focus items: {len(focus_items)}")
docs = chroma_service.vector_store.get(ids=[str(focus_item.id) for focus_item in focus_items])

print(f"Docs: {len(docs['documents'])}")
logger.info(f"Docs: {len(docs['documents'])}")
completed_ids = []
for doc, doc_id, metadata in zip(docs["documents"], docs["ids"], docs["metadatas"]):
keywords = get_query_keywords(doc)
Expand Down

0 comments on commit 47f7e19

Please sign in to comment.