INNER CODE UNIT · Python
Section
victordibia/designing-multiagent-systems · course/samples/book_generator/autogen_core/app.py:18
class Section(BaseModel):
title: str
level: str
content: str
image: Optional[str]
class BookSections(BaseModel):
sections: List[Section]
class StoryRequest(BaseModel):
prompt: str
@type_subscription(topic_type="StoryGeneratorAgent")
class StoryGeneratorAgent(RoutedAgent):
def __init__(self, api_key: str) -> None:
super().__init__("Story generator agent")
self.client = genai.Client(api_key=api_key)