mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-09 08:08:32 +00:00
updating serperdev to allow for query and search_query
This commit is contained in:
@@ -19,10 +19,13 @@ class SerperDevTool(BaseTool):
|
||||
|
||||
def _run(
|
||||
self,
|
||||
search_query: str,
|
||||
**kwargs: Any,
|
||||
) -> Any:
|
||||
payload = json.dumps({"q": search_query, "num": self.n_results})
|
||||
search_query = kwargs.get('search_query')
|
||||
if search_query is None:
|
||||
search_query = kwargs.get('query')
|
||||
|
||||
payload = json.dumps({"q": search_query})
|
||||
headers = {
|
||||
'X-API-KEY': os.environ['SERPER_API_KEY'],
|
||||
'content-type': 'application/json'
|
||||
|
||||
Reference in New Issue
Block a user