AutoGPT
AutoGPT copied to clipboard
Google search fails with 400 Bad request: Request contains an invalid argument
⚠️ Search for existing issues first ⚠️
- [X] I have searched the existing issues, and there is no existing issue for my problem
GPT-3 or GPT-4
- [X] I am using Auto-GPT with GPT-3 (GPT-3.5)
Steps to reproduce 🕹
Each time when Auto-GPT try to google something, it return the same message like this. How to solve it? T^T
SYSTEM: Command google returned: Error: <HttpError 400 when requesting https://customsearch.googleapis.com/customsearch/v1?q=top+5+social+media+platforms+2023%3B+5+emerging+social+media+platforms+2023&cx=autogpt-383613&num=8&key=AIzaSyDOf6f0U-erJubJjHFA1-KmmT97T720Z8Y&alt=json returned "Request contains an invalid argument.". Details: "[{'message': 'Request contains an invalid argument.', 'domain': 'global', 'reason': 'badRequest'}]">
Current behavior 😯
No response
Expected behavior 🤔
No response
Your prompt 📝
# Paste your prompt here
First, go cycle your api key
Second, verify your api key is in the right format
Exactly error of a wrong api key. Had the same issuu.
I have the same error, but only when I switch to 'stable' branch if I use 'master' it return the list of result but in master I have error ref: #1407
have you solved this problem? I have checked my key and id. Is there special url to check or some tutorials?
In my case... Im working in "stable" branch and fixed it by editing autogpt/commands/google_search.py, you must to compare it with master branch, add the method and line which are diff.
# stable branch
def google_search(query):
...
return json.dumps(search_results, ensure_ascii=False, indent=4)
But master has the method safe_google_results(results)
So you have to add this method and change the return of method. Hope you fix it!
For me, what worked was creating a custom search engine from https://programmablesearchengine.google.com/controlpanel/all and making it "Search the entire web". I added the ID of the custom search engine to .env. It started working
This issue has automatically been marked as stale because it has not had any activity in the last 50 days. You can unstale it by commenting or removing the label. Otherwise, this issue will be closed in 10 days.
This issue was closed automatically because it has been stale for 10 days with no activity.