Significant-Gravitas / AutoGPT

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
https://agpt.co
MIT License
166.08k stars 43.97k forks source link

Issues encountered while running the project on Windows 10 with Python 3.11 #64

Closed SunilWarrier closed 1 year ago

SunilWarrier commented 1 year ago

I encountered multiple issues while trying to run your project on Windows 10 with Python 3.11 using Windows CMD.

Missing modules after running the requirements: I was unable to find a compatible version of pywin32, so I installed it manually using the following command:

python -m pip install pywin32 I also had to install the following modules manually:

pip install google pip install readability-lxml pip install playsound pip install python-dotenv pip install docker

Strange characters in the output: After running the program, I noticed some strange characters like ←[32m and ←[94m in the output. This might be an issue with Windows CMD.

AttributeError after answering the AI goals: After answering the question "Enter up to 5 goals for your AI," I encountered the following error:

File "\Auto-GPT\scripts\main.py", line 204, in assistant_reply = chat.chat_with_ai( ^^^^^^^^^^^^^^^^^^ File "\Auto-GPT\scripts\chat.py", line 68, in chat_with_ai response = openai.ChatCompletion.create( ^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'openai' has no attribute 'ChatCompletion'. Did you mean: 'Completion'?

Please help me understand if I missed anything during the setup process and how I can resolve these issues.

I appreciate your support.

Best regards, Sunil

SunilWarrier commented 1 year ago

Upgrade to openAI solved these issues pip install --upgrade openai

Now got a new issue File \AppData\Local\Programs\Python\Python311\Lib\site-packages\openai\util.py", line 186, in default_api_key raise openai.error.AuthenticationError( openai.error.AuthenticationError: No API key provided. You can set your API key in code using 'openai.api_key = ', or you can set the environment variable OPENAI_API_KEY=).

SunilWarrier commented 1 year ago

Again dumb me should have read the readme.md correctly renamed the .env file Now getting error openai.error.InvalidRequestError: The model: gpt-4 does not exist I am a paid user in OpenAI and chatGPT

SunilWarrier commented 1 year ago

Maybe I am not allowed, so I revisited and applied for it. Then I changed it to gpt-3.5turbo it stated working but stuck with Error: Invalid JSON What task would you like me to perform? NEXT ACTION: COMMAND = Error: ARGUMENTS = Invalid JSON Enter 'y' to authorise command or 'n' to exit program... Input:y -=-=-=-=-=-=-= COMMAND AUTHORISED BY USER -=-=-=-=-=-=-= SYSTEM: Command Error: returned: Unknown command Error: Error: Invalid JSON I am ready for your next command. What would you like me to do? NEXT ACTION: COMMAND = Error: ARGUMENTS = Invalid JSON Enter 'y' to authorise the command or 'n' to exit the program... Input: I am trying to figure out how to fix this. any suggestions?

Torantulino commented 1 year ago

This last erorr looks like it's due to a bad prompt, try the default one and see if it's any different.

Also please make sure you're on the latest version.

SunilWarrier commented 1 year ago

I tried the defaults and got the same error. Let me try to debug the JSON at that time. I am not a Python programer, but I can understand.

[32mWelcome to Auto-GPT! ←[0mEnter the name of your AI and its role below. Entering nothing will load defaults. ←[32mName your AI: ←[0mFor example, 'Entrepreneur-GPT' AI Name: Entrepreneur-GPT ←[94mEntrepreneur-GPT here! ←[0mI am at your service. ←[32mDescribe your AI's role: ←[0mFor example, 'an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth.' Entrepreneur-GPT is: an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth. ←[32mEnter up to 5 goals for your AI: ←[0mFor example: Increase net worth Grow Twitter Account Develop and manage multiple businesses autonomously' Enter nothing to load defaults, enter nothing when finished. ←[94mGoal←[0m 1: Error: Prompt file not found ←[31mError: Invalid JSON ←[0mPlease provide a command for me to execute. ←[36mNEXT ACTION: ←[0mCOMMAND = ←[36mError:←[0m ARGUMENTS = ←[36mInvalid JSON←[0m Enter 'y' to authorise command or 'n' to exit program... ←[35mInput:←[0m

SunilWarrier commented 1 year ago

When I run it in MS Code, I get the colours, and it will load the prompt file. When I print that I get Assistant reply JSON: What would you like the next command to be? Not sure from where this is coming.

PS C:\development\PythonDevelopment\Auto-GPT\scripts> & C:/Users/sunil/AppData/Local/Programs/Python/Python311/python.exe c:/development/PythonDevelopment/Auto-GPT/scripts/main.py Welcome to Auto-GPT! Enter the name of your AI and its role below. Entering nothing will load defaults. Name your AI: For example, 'Entrepreneur-GPT' AI Name: Entrepreneur-GPT Entrepreneur-GPT here! I am at your service. Describe your AI's role: For example, 'an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth.' Entrepreneur-GPT is: an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth. Enter up to 5 goals for your AI: For example: Increase net worth Grow Twitter Account Develop and manage multiple businesses autonomously' Enter nothing to load defaults, enter nothing when finished. Goal 1: Assistant reply JSON: What would you like the next command to be? Error: Invalid JSON NEXT ACTION: COMMAND = Error: ARGUMENTS = Invalid JSON Enter 'y' to authorise command or 'n' to exit program... Input:y -=-=-=-=-=-=-= COMMAND AUTHORISED BY USER -=-=-=-=-=-=-= SYSTEM: Command Error: returned: Unknown command Error: Assistant reply JSON: What would you like the next command to be? Error: Invalid JSON What would you like the next command to be? NEXT ACTION: COMMAND = Error: ARGUMENTS = Invalid JSON Enter 'y' to authorise command or 'n' to exit program... Input:

SunilWarrier commented 1 year ago

I can see we are getting assistant_reply from the OpenAI response.

assistant_reply = response.choices[0].message["content"] in the response is a JSON but the content variable is just a string. How can we try to load assistant_reply_json = json.loads(assistant_reply) as json in print_assistant_thoughts function?

Here the response is from gpt-3.5-turbo

I have tried the option also - python scripts/main.py --gpt3only but the same results.

Any clue to fix this? Thanks.

AutoGPT

richbeales commented 1 year ago

closing as outdated.