Last active
August 26, 2025 22:34
-
-
Save CodeWithOz/0b01d558adac703673aceca48471dca7 to your computer and use it in GitHub Desktop.
Agent for cleaning up named entities in YouTube video transcripts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ... | |
| class DemoEnrichmentAgent: | |
| ... | |
| def __init__(self): | |
| ... | |
| graph_builder.add_node("replace_entity", self.replace_entity_node) | |
| graph_builder.add_node("replacement_reviewer", self.replacement_reviewer_node) | |
| # set edges | |
| ... | |
| graph_builder.add_edge("get_verified_entity_worker", "replacement_reviewer") | |
| graph_builder.add_conditional_edges( | |
| "replacement_reviewer", | |
| self.continue_replacement_router, | |
| {"continue": "replace_entity", "end": END}, | |
| ) | |
| graph_builder.add_edge("replace_entity", "replacement_reviewer") | |
| ... | |
| async def replace_entity_node(self, state: AgentState): | |
| # 🤖 - I will replace the entities in the text | |
| pass | |
| async def replacement_reviewer_node(self, state: AgentState): | |
| # 🤖 - I will review the replacements for completeness | |
| pass | |
| def continue_replacement_router(self, state: AgentState): | |
| # 🔄 - I will decide if the loop should continue or stop | |
| pass | |
| ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment