AgentGPT icon indicating copy to clipboard operation
AgentGPT copied to clipboard

ERROR: Failed to search as no SERP_API_KEY is provided in ENV.

Open darth-pika-hu opened this issue 1 year ago • 7 comments

I noticed this error when enabling web search. ERROR: Failed to search as no SERP_API_KEY is provided in ENV. What is SERP_API_KEY?

darth-pika-hu avatar May 01 '23 07:05 darth-pika-hu

It is used for scraping search results. You can sign up here: https://serpapi.com/users/sign_up and it should generate a key for you.

Paste it in this file: https://github.com/reworkd/AgentGPT/blob/8810ae2ee4db52fef84d31789c21406f0ce53bd9/src/services/custom-tools/serper.ts#L26

zahir2000 avatar May 01 '23 09:05 zahir2000

Any benefit over Google API and CSE?

darth-pika-hu avatar May 01 '23 15:05 darth-pika-hu

@darth-pika-hu Mostly just price and scalability. When we turned it on we hit 50k + requests in under 8 hours. I think the google API only allows for 10k searches a day

asim-shrestha avatar May 02 '23 05:05 asim-shrestha

Thanks @zahir2000!

asim-shrestha avatar May 02 '23 05:05 asim-shrestha

@asim-shrestha How about giving users options can use their Google API?

darth-pika-hu avatar May 02 '23 23:05 darth-pika-hu

@darth-pika-hu Mostly just price and scalability. When we turned it on we hit 50k + requests in under 8 hours. I think the google API only allows for 10k searches a day

how much is 50k request in $$ amount? ..... ok I just became a sponsor, a google api and google search id would be good just for a single user that is running there own instance on vercel and 10k a day is fine.

bigsk1 avatar May 03 '23 03:05 bigsk1

Just let user use their own API

darth-pika-hu avatar May 03 '23 05:05 darth-pika-hu

It is used for scraping search results. You can sign up here: https://serpapi.com/users/sign_up and it should generate a key for you.

Paste it in this file:

https://github.com/reworkd/AgentGPT/blob/8810ae2ee4db52fef84d31789c21406f0ce53bd9/src/services/custom-tools/serper.ts#L26

Where do I find this file? After installing in Docker?

yf007 avatar May 30 '23 07:05 yf007

Hey folks, so if you follow our new ./setup.sh script you can provide your own serper API key. To use google, we'd need to have another integration. Feel free to make a ticket if this is of interest to you :) In the meantime, I'll be closing this one

asim-shrestha avatar Jun 04 '23 23:06 asim-shrestha