LorenzoPeve / rag-reddit

RAG application using a Reddit knowledge base
0 stars 0 forks source link

Write a checker function to avoid having orphaned comments #2

Open LorenzoPeve opened 1 month ago

LorenzoPeve commented 1 month ago
posts_w_no_docs = db.get_posts_without_documents()
if len(posts_w_no_docs) > 0:
    logging.info(f'Processing Reddit posts without documents: {len(posts_w_no_docs)}')

    for post_id in posts_w_no_docs:
        post = reddit.get_post_from_id(post_id)
        insert_reddit_post_and_comments(post)