diff --git a/.idea/Auto-GPT.iml b/.idea/Auto-GPT.iml new file mode 100644 index 000000000000..0070e873e3f5 --- /dev/null +++ b/.idea/Auto-GPT.iml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 000000000000..105ce2da2d64 --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 000000000000..6408223b98e1 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 000000000000..35eb1ddfbbc0 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 000000000000..2fcc96b86da5 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1680742313846 + + + + + + \ No newline at end of file diff --git a/auto_gpt_workspace/communication_app.py b/auto_gpt_workspace/communication_app.py new file mode 100644 index 000000000000..75235eb41136 --- /dev/null +++ b/auto_gpt_workspace/communication_app.py @@ -0,0 +1 @@ +# This is a Python file for our proof of concept communication application. \ No newline at end of file diff --git a/auto_gpt_workspace/fibonacci.py b/auto_gpt_workspace/fibonacci.py new file mode 100644 index 000000000000..b126f4b86184 --- /dev/null +++ b/auto_gpt_workspace/fibonacci.py @@ -0,0 +1,12 @@ +def fibonacci(n, memo={}): + if n < 0: + raise ValueError('Input must be a non-negative integer') + elif n == 0: + return 0 + elif n == 1 or n == 2: + return 1 + elif n in memo: + return memo[n] + else: + memo[n] = fibonacci(n-1, memo) + fibonacci(n-2, memo) + return memo[n] \ No newline at end of file diff --git a/auto_gpt_workspace/goals.txt b/auto_gpt_workspace/goals.txt new file mode 100644 index 000000000000..69dbcd05a84f --- /dev/null +++ b/auto_gpt_workspace/goals.txt @@ -0,0 +1,5 @@ +1. Design and deploy a system that I can communicate and provide feedback to you. +2. Provide recommendations for improving our effectiveness to work as a team. +3. Generate further autonomous agents to streamline processes and accomplish all tasks that I communicate to you. +4. Design and code a working application that accomplishes all of the above, then deploy it. +5. Execute all goals in this order then terminate because the improved application has been deployed and we will continue working together on that application. \ No newline at end of file diff --git a/auto_gpt_workspace/recommended_tools.txt b/auto_gpt_workspace/recommended_tools.txt new file mode 100644 index 000000000000..996e92d10c03 --- /dev/null +++ b/auto_gpt_workspace/recommended_tools.txt @@ -0,0 +1,5 @@ +Sketch +InVision +Figma +Adobe XD +Axure \ No newline at end of file diff --git a/scripts/json_parser.py b/scripts/json_parser.py index 11ff9ed22e0a..2ca76e6a9412 100644 --- a/scripts/json_parser.py +++ b/scripts/json_parser.py @@ -3,6 +3,7 @@ from config import Config cfg = Config() + def fix_and_parse_json(json_str: str, try_to_fix_with_gpt: bool = True): json_schema = """ { @@ -23,30 +24,35 @@ def fix_and_parse_json(json_str: str, try_to_fix_with_gpt: bool = True): } """ - try: - return json.loads(json_str) - except Exception as e: - # Let's do something manually - sometimes GPT responds with something BEFORE the braces: - # "I'm sorry, I don't understand. Please try again."{"text": "I'm sorry, I don't understand. Please try again.", "confidence": 0.0} - # So let's try to find the first brace and then parse the rest of the string + def clean_input(json_str): + brace_index = json_str.index("{") + json_str = json_str[brace_index:] + last_brace_index = json_str.rindex("}") + json_str = json_str[:last_brace_index+1] + return json_str + + def attempt_parse(json_str): try: - brace_index = json_str.index("{") - json_str = json_str[brace_index:] - last_brace_index = json_str.rindex("}") - json_str = json_str[:last_brace_index+1] - return json.loads(json_str) + return json.loads(json_str) except Exception as e: - if try_to_fix_with_gpt: - print(f"Warning: Failed to parse AI output, attempting to fix.\n If you see this warning frequently, it's likely that your prompt is confusing the AI. Try changing it up slightly.") - # Now try to fix this up using the ai_functions - ai_fixed_json = fix_json(json_str, json_schema, False) - if ai_fixed_json != "failed": - return json.loads(ai_fixed_json) - else: - print(f"Failed to fix ai output, telling the AI.") # This allows the AI to react to the error message, which usually results in it correcting its ways. - return json_str - else: - raise e + return None + + cleaned_json_str = clean_input(json_str) + parsed_json = attempt_parse(cleaned_json_str) + + if parsed_json is not None: + return parsed_json + elif try_to_fix_with_gpt: + print("Warning: Failed to parse AI output, attempting to fix.") + ai_fixed_json = fix_json(cleaned_json_str, json_schema, False) + + if ai_fixed_json != "failed": + return json.loads(ai_fixed_json) + else: + print("Failed to fix ai output, telling the AI.") + return json_str + + raise ValueError("Failed to parse JSON: '{}'".format(json_str)) def fix_json(json_str: str, schema: str, debug=False) -> str: # Try to fix the JSON using gpt: diff --git a/speech.mp3 b/speech.mp3 new file mode 100644 index 000000000000..a83de4d221dd Binary files /dev/null and b/speech.mp3 differ