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 os
from tavily import AsyncTavilyClient
...
class DemoEnrichmentAgent:
...
tavily_client: AsyncTavilyClient
def __init__(self):
...
self.tavily_client = AsyncTavilyClient(api_key=os.getenv("TAVILY_API_KEY"))
async def research_entity(self, entity: NamedEntity):
print(f"Performing web search to verify entity: {entity.entity_name}")
search_response = await self.tavily_client.search(
f"{entity.entity_name} {entity.entity_context}", max_results=3
)
search_results = search_response.get("results", [])
print(f"Found {len(search_results)} results for entity: {entity.entity_name}")
return search_results
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment