from typing import List, Optional
from ..models import GeneratorDefinition
class DemoFeedCatalog:
"""Catalog of available feed generators."""
def __init__(self):
self.generators: List[GeneratorDefinition] = [
GeneratorDefinition(
id="balanced",
name="Balanced",
description="A balanced mix of semantic similarity and recent posts",
strategy="hybrid"
),
GeneratorDefinition(
id="semantic",
name="Semantic",
description="Purely semantic ranking based on your taste profile",
strategy="semantic"
),
GeneratorDefinition(
id="recent",
name="Recent",
description="Most recent posts from your network",
strategy="chronological"
)
]
def list(self) -> List[GeneratorDefinition]:
"""List all available generators."""
return self.generators
def resolve(self, generator_id: str) -> Optional[GeneratorDefinition]:
"""Resolve a generator by ID."""
for gen in self.generators:
if gen.id == generator_id:
return gen
return None