forked from murchie85/GPT_AUTOMATE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
48 lines (41 loc) · 1.44 KB
/
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import os
from termcolor import colored, cprint
from art import *
import problemClassifier
from decomposer import *
from getToken import *
class agent_coordinator():
def __init__(self):
self.state = 'not started'
self.classifier = problemClassifier.ProblemClassifier()
self.deliverableStatement = None
self.no_deliverables = 0
self.currentDeliv = 0
self.deliverablesArray = []
self.openaiObject = None
def mainLoop(self):
self.openaiObject = getOpenAPIKey()
if(self.state =='not started'):
self.classifier.get_requirements(self.openaiObject)
if(self.classifier.problem_state == 'solvable_with_code'):
# IMPORT METRICS
self.problemStatement = self.classifier.problemStatement
self.deliverableStatement = self.classifier.currentResponse
self.no_deliverables = self.classifier.no_deliverables
self.state = 'decompose'
print('Deliverables : ' + str(self.no_deliverables))
cprint('Complete! press any key to proceed to the next step', 'white')
input('')
else:
self.state = 'complete'
cprint('Complete! Problem is not solvable with code unfortunately', 'red')
input('')
if(self.state =='decompose'):
decompose(self.openaiObject)
os.system('clear')
welcomeMessage=text2art("Welcome")
amuMessage=text2art("Automator V 0.1")
print(welcomeMessage)
print(amuMessage)
coordinator = agent_coordinator()
coordinator.mainLoop()