-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
32 lines (23 loc) · 970 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import logging
from diagramming_workflow import DiagrammingWorkflow, DiagrammingState
from console_interface import ConsoleInterface
from qna_agent.agent.questionnaire_agent import QuestionnaireAgent
logger = logging.getLogger(__name__)
def main():
workflow = DiagrammingWorkflow()
interface = ConsoleInterface()
questionnaire_agent = QuestionnaireAgent()
initial_state = DiagrammingState()
interface.display_welcome_message()
# Run questionnaire
state = workflow.run_questionnaire(initial_state, {"agent": questionnaire_agent})
if state.diagram_type is None:
interface.display_unsupported_diagram_message(state.error_message)
return
# Generate Mermaid diagram
final_state = workflow.generate_mermaid(state, {})
# Display results
interface.display_results(final_state.brief, final_state.mermaid_code)
interface.display_completion_message()
if __name__ == "__main__":
main()