Menu

Does My Comment-Reply Pipeline Know the Difference Between a Question and an Instruction?
πŸ“°

Does My Comment-Reply Pipeline Know the Difference Between a Question and an Instruction?

DEV Community: aiΒ·Enjoy KumawatΒ·2 days ago
#2N9V0Zdo
#devtoai#devto#dev#comment#leaf
Long article (1060 words) β€” no AI summary yet.
Reading 0:00
15s threshold

This repo runs a small, unglamorous pipeline: reply_comments.py pending lists every DEV.to comment on my articles that still needs a reply, and whoever drafts the reply β€” me, or in this scheduled run's case, an agent session β€” reads that JSON and writes something back. It's been running since early August. I never once asked what's actually inside the body field it hands over.

So I looked. _pending_entries() is the function that builds each pending item:

def _pending_entries ( comment , drafted_codes ) : for leaf in _pending_leaves ( comment ) : if leaf [ "id_code" ] in drafted_codes : continue yield { "id_code" : leaf [ "id_code" ] , "author" : leaf [ "user" ] [ "username" ] , "comment_url" : f "https://dev.to/{ME}/comment/{leaf['id_code']}" , "body" : strip_html ( leaf [ "body_html" ] ) , }

Enter fullscreen mode

Exit fullscreen mode

strip_html() has exactly one job: turn DEV.to's rendered body_html into plain text a human (or an LLM) can read β€” strip tags, unescape HTML entities.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.