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 AgentState(TypedDict): | |
| ... | |
| replacement_loop_idx: Annotated[int, operator.add] | |
| ... | |
| class DemoEnrichmentAgent: | |
| ... | |
| def continue_replacement_router(self, state: AgentState): | |
| replacement_loop_idx = state.get("replacement_loop_idx", 0) | |
| if replacement_loop_idx < len(state.get("verified_entities", [])): | |
| print(f"Replacement ongoing for entity at index {replacement_loop_idx}") | |
| return "continue" | |
| print(f"Replacement complete for all entities") | |
| return "end" | |
| ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment