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
| ... | |
| from pydantic import BaseModel, Field | |
| class NamedEntity(BaseModel): | |
| entity_name: str = Field(description="A short name for the entity.") | |
| entity_context: str = Field( | |
| description="A **brief** phrase (≤ 12 words) that is suitable for web search." | |
| ) | |
| class NamedEntities(BaseModel): | |
| named_entities: list[NamedEntity] | |
| ... | |
| class DemoEnrichmentAgent: | |
| extractor_llm: Runnable | |
| def __init__(self): | |
| self.extractor_llm = init_chat_model( | |
| "gpt-4o-mini", | |
| model_provider="openai" | |
| ).with_structured_output(NamedEntities) | |
| ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment