Spaces:
Sleeping
Sleeping
| from core.base_agent import BaseAgent | |
| from core.database import db | |
| from typing import Dict, Any | |
| class BusinessAnalystAgent(BaseAgent): | |
| def __init__(self): | |
| super().__init__("Business Analyst") | |
| self.create_chain(""" | |
| You are a Business Analyst. Your task is to create detailed user stories from the given business requirements. | |
| Business Requirements: | |
| {input} | |
| Create user stories following this format: | |
| As a [type of user] | |
| I want [some goal] | |
| So that [some reason] | |
| Acceptance Criteria: | |
| 1. [First criterion] | |
| 2. [Second criterion] | |
| ... | |
| Please provide clear, testable user stories with specific acceptance criteria. | |
| """) | |
| async def create_user_stories(self, requirements: str) -> Dict[str, Any]: | |
| """Create user stories from business requirements""" | |
| result = await self.process({"input": requirements}) | |
| # Store the user stories in the database | |
| db.store_artifact( | |
| "user_stories", | |
| result, | |
| { | |
| "type": "user_story", | |
| "source": "business_analyst", | |
| "status": "created" | |
| } | |
| ) | |
| return { | |
| "status": "success", | |
| "user_stories": result, | |
| "message": "User stories created successfully" | |
| } |