AutoGPT: Command google_search never invoked anymore
⚠️ Search for existing issues first ⚠️
- I have searched the existing issues, and there is no existing issue for my problem
Which Operating System are you using?
Linux
Which version of Auto-GPT are you using?
Latest Release
GPT-3 or GPT-4?
GPT-3.5
Steps to reproduce 🕹
Start a goal that’s primarily searching the web
Current behavior 😯
Instead of searching Google or any other search engine, it will always ‘browse website’ instead. Even when the declared plan is to use search engines. Browsing the homepage of search engines and archive sites obviously yield no results.
Expected behavior 🤔
Use ‘google_search’ command like it used to before the latest release.
Your prompt 📝
# Search and summarize recent articles on the topic of XXX
Your Logs 📒
No response
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 22 (4 by maintainers)
Using the combination of suggestions from @benqqqq and @jonasdebeukelaer I was able to get mine running smoothly again with proper Google searches via the Google API (running in VS Code + Docker Container):
1. Renamed Duck Duck Go query name, changed Line 14 from:
https://github.com/Significant-Gravitas/Auto-GPT/blob/3bf5934b20b906f977776e2d41033027ecb5df9b/autogpt/commands/google_search.py#L14
to
@command("ddg", "Duck Duck Go", '"query": "<query>"', not CFG.google_api_key)
2. Added line fix, changed Line 113 from:
https://github.com/Significant-Gravitas/Auto-GPT/blob/3bf5934b20b906f977776e2d41033027ecb5df9b/autogpt/commands/google_search.py#L113
to
[result.encode("utf-8", "ignore").decode("utf-8") for result in results]
Now everything running smoothly for me again.
Note: I also updated my DuckDuckGo Search per discussion comments in #4120 - Not sure if that has anything to do with it as I didn’t test in between the DDG update and making the other changes. But worth noting.
Update DuckDuckGo Search:
pip install --upgrade duckduckgo-search
I’ve noticed this issue as well. Worked for me in v0.2.2 but not since switching to stable v.0.3.0.
I have both Google API Key and Search ID set in my .env but it just uses the browse_website function and not Google.
Using GPT 4 API.
I also checked my Google API Key results to see if any traffic was using it, and I see no traffic on my API since making the switch.
@yangkyeongmo added whitespace and removed escape sequences for readability
Is there a workaround for people running autogpt on Docker? I can’t get it to use Google Search at all
Hi, I think the root cause is that there are two commands with the same “name”
google
(the first argument) in the following code snippets:(Google Official search) https://github.com/Significant-Gravitas/Auto-GPT/blob/3bf5934b20b906f977776e2d41033027ecb5df9b/autogpt/commands/google_search.py#L40-L47
(DuckDuckGo search) https://github.com/Significant-Gravitas/Auto-GPT/blob/3bf5934b20b906f977776e2d41033027ecb5df9b/autogpt/commands/google_search.py#L14-L15
This causes the command registry to overwrite each other, as seen in the code snippet https://github.com/Significant-Gravitas/Auto-GPT/blob/dcd6aa912b992d7c024ea1b668d3249b201b0c2c/autogpt/commands/command.py#L61-L62
There are two workarounds available:
Comment out the GOOGLE_API_KEY in the .env file, which will make it use DuckDuckGo for searching instead.
#GOOGLE_API_KEY=xxxx
Use different names in the above two code snippets for these two commands.
I believe command changed to just google but it returns disabled for me.
I have, and it seems to understand. Yet, the generated command is ‘browse_website’ instead of ‘google_search’. It just keeps scraping google com homepage.