| from base_agent import BaseAgent | |
| from models import AgentState | |
| from typing import AsyncGenerator | |
| import json | |
| class ArchitectureAnalysis(BaseAgent): | |
| async def __call__(self, state: AgentState) -> AsyncGenerator[str, None]: | |
| prompt_template = """ | |
| Analyze the following project and identify system components: | |
| Project: {project_name} | |
| Description: {project_description} | |
| Entities: {entities_classes} | |
| Use Cases: {actors_use_cases} | |
| Instructions: | |
| 1. Identify major system components/modules | |
| 2. List their responsibilities | |
| 3. Describe how they interact | |
| 4. Format as a structured component hierarchy | |
| """ | |
| async for chunk in self._stream_process( | |
| state=state, | |
| prompt_template=prompt_template, | |
| output_key="architecture_components", | |
| step_name="extract_architecture", | |
| project_name=state["project_name"], | |
| project_description=state["project_description"], | |
| entities_classes=state["entities_classes"], | |
| actors_use_cases=state["actors_use_cases"] | |
| ): | |
| yield chunk | |