@@ -9,12 +9,12 @@ def benchmark_entrepeneur_gpt_with_difficult_user():
9
9
10
10
# Read the current ai_settings.yaml file and store its content.
11
11
ai_settings = None
12
- if os .path .exists (' ai_settings.yaml' ):
13
- with open (' ai_settings.yaml' , 'r' ) as f :
12
+ if os .path .exists (" ai_settings.yaml" ):
13
+ with open (" ai_settings.yaml" , "r" ) as f :
14
14
ai_settings = f .read ()
15
- os .remove (' ai_settings.yaml' )
15
+ os .remove (" ai_settings.yaml" )
16
16
17
- input_data = ''' Entrepreneur-GPT
17
+ input_data = """ Entrepreneur-GPT
18
18
an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth.
19
19
Increase net worth.
20
20
Develop and manage multiple businesses autonomously.
@@ -72,27 +72,34 @@ def benchmark_entrepeneur_gpt_with_difficult_user():
72
72
Disappointing suggestion.
73
73
Not helpful.
74
74
Needs improvement.
75
- Not what I need.'''
75
+ Not what I need."""
76
76
# TODO: add questions above, to distract it even more.
77
77
78
- command = f' { sys .executable } -m autogpt'
78
+ command = f" { sys .executable } -m autogpt"
79
79
80
- process = subprocess .Popen (command , stdin = subprocess .PIPE , stdout = subprocess .PIPE , stderr = subprocess .PIPE ,
81
- shell = True )
80
+ process = subprocess .Popen (
81
+ command ,
82
+ stdin = subprocess .PIPE ,
83
+ stdout = subprocess .PIPE ,
84
+ stderr = subprocess .PIPE ,
85
+ shell = True ,
86
+ )
82
87
83
88
stdout_output , stderr_output = process .communicate (input_data .encode ())
84
89
85
90
# Decode the output and print it
86
- stdout_output = stdout_output .decode (' utf-8' )
87
- stderr_output = stderr_output .decode (' utf-8' )
91
+ stdout_output = stdout_output .decode (" utf-8" )
92
+ stderr_output = stderr_output .decode (" utf-8" )
88
93
print (stderr_output )
89
94
print (stdout_output )
90
95
print ("Benchmark Version: 1.0.0" )
91
96
print ("JSON ERROR COUNT:" )
92
- count_errors = stdout_output .count ("Error: The following AI output couldn't be converted to a JSON:" )
93
- print (f'{ count_errors } /50 Human feedbacks' )
97
+ count_errors = stdout_output .count (
98
+ "Error: The following AI output couldn't be converted to a JSON:"
99
+ )
100
+ print (f"{ count_errors } /50 Human feedbacks" )
94
101
95
102
96
103
# Run the test case.
97
- if __name__ == ' __main__' :
104
+ if __name__ == " __main__" :
98
105
benchmark_entrepeneur_gpt_with_difficult_user ()
0 commit comments