Skip to content

Instantly share code, notes, and snippets.

@CodeWithOz
Last active August 26, 2025 22:34
Show Gist options
  • Select an option

  • Save CodeWithOz/0b01d558adac703673aceca48471dca7 to your computer and use it in GitHub Desktop.

Select an option

Save CodeWithOz/0b01d558adac703673aceca48471dca7 to your computer and use it in GitHub Desktop.
Agent for cleaning up named entities in YouTube video transcripts.
...
import json
...
class AgentState(TypedDict):
transcript_text: str
extracted_entities: NamedEntities
...
class DemoEnrichmentAgent:
...
async def extractor_node(self, state: AgentState):
...
return {"extracted_entities": resp_msg}
async def start(self, transcript_text: str):
...
# pretty print the agent's response JSON
print("Agent response:\n", json.dumps(resp, indent=2, default=lambda o: o.__dict__))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment