Spaces:
Runtime error
Runtime error
Download dev-agent/app/agents/dev_agent.py from BeastGokul/MVP: direct link, hf CLI and curl.
- Browser
- Download file 1.06 kB
-
https://huggingface.co/spaces/BeastGokul/MVP/resolve/main/dev-agent/app/agents/dev_agent.py
- Command line
-
hf download hf://spaces/BeastGokul/MVP/dev-agent/app/agents/dev_agent.py
-
curl -L -o dev_agent.py https://huggingface.co/spaces/BeastGokul/MVP/resolve/main/dev-agent/app/agents/dev_agent.py
1.06 kB
| from typing import Dict, Any | |
| from .graph import build_graph | |
| class DevAgent: | |
| def __init__(self): | |
| self.graph = build_graph() | |
| def process(self, session_id: str, user_message: str, history: list, state_init: dict = None) -> Dict[str, Any]: | |
| state = { | |
| 'session_id': session_id, | |
| 'user_message': user_message, | |
| 'conversation_history': history, | |
| 'extracted_requirements': (state_init or {}).get('extracted_requirements', {}) or {}, | |
| 'missing_information': (state_init or {}).get('missing_information', []) or [], | |
| 'clarification_questions': (state_init or {}).get('clarification_questions', []) or [], | |
| 'draft_spec': (state_init or {}).get('draft_spec', None), | |
| 'validation_result': (state_init or {}).get('validation_result', None), | |
| 'status': (state_init or {}).get('status', 'collecting_requirements') or 'collecting_requirements' | |
| } | |
| result = self.graph.invoke(state, config={'recursion_limit': 50}) | |
| return result | |