mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-05-02 15:52:34 +00:00
Update serper_dev_tool.py
This commit is contained in:
@@ -38,15 +38,12 @@ class SerperDevTool(BaseTool):
|
|||||||
save_file = kwargs.get('save_file', self.save_file)
|
save_file = kwargs.get('save_file', self.save_file)
|
||||||
n_results = kwargs.get('n_results', self.n_results)
|
n_results = kwargs.get('n_results', self.n_results)
|
||||||
|
|
||||||
payload = json.dumps(
|
payload = { "q": search_query, "num": n_results }
|
||||||
{
|
payload["gl"] = self.country if self.country
|
||||||
"q": search_query,
|
payload["location"] = self.country if self.location
|
||||||
"num": n_results,
|
payload["hl"] = self.country if self.locale
|
||||||
"gl": self.country,
|
|
||||||
"location": self.location,
|
payload = json.dumps(payload)
|
||||||
"hl": self.locale,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
headers = {
|
headers = {
|
||||||
'X-API-KEY': os.environ['SERPER_API_KEY'],
|
'X-API-KEY': os.environ['SERPER_API_KEY'],
|
||||||
|
|||||||
Reference in New Issue
Block a user