File tree 4 files changed +13
-7
lines changed 4 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 26
26
27
27
from .. import prompts
28
28
29
+
29
30
class Think :
30
31
"""
31
32
The main class for operations involving the GPT for the DAIA
@@ -121,19 +122,23 @@ def action(
121
122
screen_data = screen_data ,
122
123
suggestion = suggestion ,
123
124
),
124
-
125
125
}
126
126
],
127
- response_format = {"type" : "json" }
127
+ response_format = {"type" : "json" },
128
128
)
129
129
executable = executable .choices [0 ].message .content
130
130
executable = orjson .loads (executable )
131
131
# Check if the response returns commands or just 'Not specific'
132
132
if executable .get ("status" ) == "impossible" :
133
133
return "Not specific"
134
134
else :
135
- #TODO: Make this clean, changing where the function is called than making some string manipulation magic here
136
- return "\n " .join ([f"{ i } . { command .get ('command' )} { command .get ('parameter' )} ({ command .get ('expected_outcome' )} )" for i , command in enumerate (executable .get ("commands" ))])
135
+ # TODO: Make this clean, changing where the function is called than making some string manipulation magic here
136
+ return "\n " .join (
137
+ [
138
+ f"{ i } . { command .get ('command' )} { command .get ('parameter' )} ({ command .get ('expected_outcome' )} )"
139
+ for i , command in enumerate (executable .get ("commands" ))
140
+ ]
141
+ )
137
142
138
143
def suggestion_explainer (self , suggestion : str ):
139
144
"""
Original file line number Diff line number Diff line change 1
- from .prompts1 import *
1
+ from .prompts1 import *
Original file line number Diff line number Diff line change 26
26
If the suggestion is not specific enough for execution:
27
27
- Provide a response in JSON format with a reason for the impossibility:
28
28
{"status": "impossible", "commands": [], "reason": "Not specific enough due to [brief explanation]"}
29
- """
29
+ """
Original file line number Diff line number Diff line change 18
18
from openai import OpenAI
19
19
from . import prompts
20
20
21
+
21
22
def run (api_key ):
22
23
goal = input ("Please enter your goal for the DAIA here: " )
23
24
@@ -86,7 +87,7 @@ def run(api_key):
86
87
while True :
87
88
print (
88
89
"(Press ENTER to skip) WARNING: if you skip, the suggestions will be accepted. This is the LAST MANUAL step, everything from here on is automated"
89
- ) # TODO: Use ANSI escape codes to make this text red
90
+ ) # TODO: Use ANSI escape codes to make this text red
90
91
agree = input (
91
92
"Do you agree with the current suggestions/processes for your goal? (Y/N)"
92
93
)
You can’t perform that action at this time.
0 commit comments