mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 00:28:31 +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(
|
def _run(
|
||||||
self,
|
self,
|
||||||
search_query: str,
|
|
||||||
**kwargs: Any,
|
**kwargs: Any,
|
||||||
) -> 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 = {
|
headers = {
|
||||||
'X-API-KEY': os.environ['SERPER_API_KEY'],
|
'X-API-KEY': os.environ['SERPER_API_KEY'],
|
||||||
'content-type': 'application/json'
|
'content-type': 'application/json'
|
||||||
|
|||||||
Reference in New Issue
Block a user