mirror of
https://github.com/agentuniverse-ai/agentUniverse.git
synced 2026-02-09 01:59:19 +08:00
Merge pull request #470 from PengZa666/improve-peer-agent-readme
修复了Google搜索工具文档中的拼写错误:"serpher" → "serper" 改进了代码注释,添加了详细的docstring
This commit is contained in:
@@ -19,7 +19,7 @@ class GoogleSearchTool(Tool):
|
||||
Implement the execute method of demo google search tool, using the `GoogleSerperAPIWrapper` to implement a simple Google search.
|
||||
|
||||
Note:
|
||||
You need to sign up for a free account at https://serper.dev and get the serpher api key (2500 free queries).
|
||||
You need to sign up for a free account at https://serper.dev and get the serper api key (2500 free queries).
|
||||
"""
|
||||
|
||||
serper_api_key: Optional[str] = Field(default_factory=lambda: get_from_env("SERPER_API_KEY"))
|
||||
|
||||
@@ -61,7 +61,7 @@ class GoogleSearchTool(Tool):
|
||||
Implement the execute method of demo google search tool, using the `GoogleSerperAPIWrapper` to implement a simple Google search.
|
||||
|
||||
Note:
|
||||
You need to sign up for a free account at https://serper.dev and get the serpher api key (2500 free queries).
|
||||
You need to sign up for a free account at https://serper.dev and get the serper api key (2500 free queries).
|
||||
"""
|
||||
|
||||
def execute(self, tool_input: ToolInput):
|
||||
|
||||
@@ -61,7 +61,7 @@ class GoogleSearchTool(Tool):
|
||||
Implement the execute method of demo google search tool, using the `GoogleSerperAPIWrapper` to implement a simple Google search.
|
||||
|
||||
Note:
|
||||
You need to sign up for a free account at https://serper.dev and get the serpher api key (2500 free queries).
|
||||
You need to sign up for a free account at https://serper.dev and get the serper api key (2500 free queries).
|
||||
"""
|
||||
|
||||
def execute(self, input: str):
|
||||
|
||||
@@ -18,7 +18,7 @@ class GoogleSearchTool(Tool):
|
||||
Implement the execute method of demo google search tool, using the `GoogleSerperAPIWrapper` to implement a simple Google search.
|
||||
|
||||
Note:
|
||||
You need to sign up for a free account at https://serper.dev and get the serpher api key (2500 free queries).
|
||||
You need to sign up for a free account at https://serper.dev and get the serper api key (2500 free queries).
|
||||
"""
|
||||
|
||||
serper_api_key: Optional[str] = Field(default_factory=lambda: get_from_env("SERPER_API_KEY"))
|
||||
@@ -26,4 +26,4 @@ class GoogleSearchTool(Tool):
|
||||
def execute(self, input: str):
|
||||
# get top10 results from Google search.
|
||||
search = GoogleSerperAPIWrapper(serper_api_key=self.serper_api_key, k=10, gl="us", hl="en", type="search")
|
||||
return search.run(query=input)
|
||||
return search.run(query=input)
|
||||
|
||||
@@ -19,7 +19,7 @@ class GoogleSearchTool(Tool):
|
||||
Implement the execute method of demo google search tool, using the `GoogleSerperAPIWrapper` to implement a simple Google search.
|
||||
|
||||
Note:
|
||||
You need to sign up for a free account at https://serper.dev and get the serpher api key (2500 free queries).
|
||||
You need to sign up for a free account at https://serper.dev and get the serper api key (2500 free queries).
|
||||
"""
|
||||
|
||||
serper_api_key: Optional[str] = Field(default_factory=lambda: get_from_env("SERPER_API_KEY"))
|
||||
|
||||
@@ -17,7 +17,7 @@ class GoogleSearchTool(Tool):
|
||||
Implement the execute method of demo google search tool, using the `GoogleSerperAPIWrapper` to implement a simple Google search.
|
||||
|
||||
Note:
|
||||
You need to sign up for a free account at https://serper.dev and get the serpher api key (2500 free queries).
|
||||
You need to sign up for a free account at https://serper.dev and get the serper api key (2500 free queries).
|
||||
"""
|
||||
|
||||
serper_api_key: Optional[str] = Field(default_factory=lambda: get_from_env("SERPER_API_KEY"))
|
||||
@@ -25,4 +25,4 @@ class GoogleSearchTool(Tool):
|
||||
def execute(self, input: str):
|
||||
# get top10 results from Google search.
|
||||
search = GoogleSerperAPIWrapper(serper_api_key=self.serper_api_key, k=10, gl="us", hl="en", type="search")
|
||||
return search.run(query=input)
|
||||
return search.run(query=input)
|
||||
|
||||
@@ -19,7 +19,7 @@ class GoogleSearchTool(Tool):
|
||||
Implement the execute method of demo google search tool, using the `GoogleSerperAPIWrapper` to implement a simple Google search.
|
||||
|
||||
Note:
|
||||
You need to sign up for a free account at https://serper.dev and get the serpher api key (2500 free queries).
|
||||
You need to sign up for a free account at https://serper.dev and get the serper api key (2500 free queries).
|
||||
"""
|
||||
|
||||
serper_api_key: Optional[str] = Field(default_factory=lambda: get_from_env("SERPER_API_KEY"))
|
||||
|
||||
@@ -17,7 +17,7 @@ class GoogleSearchTool(Tool):
|
||||
Implement the execute method of demo google search tool, using the `GoogleSerperAPIWrapper` to implement a simple Google search.
|
||||
|
||||
Note:
|
||||
You need to sign up for a free account at https://serper.dev and get the serpher api key (2500 free queries).
|
||||
You need to sign up for a free account at https://serper.dev and get the serper api key (2500 free queries).
|
||||
"""
|
||||
|
||||
serper_api_key: Optional[str] = Field(default_factory=lambda: get_from_env("SERPER_API_KEY"))
|
||||
@@ -25,4 +25,4 @@ class GoogleSearchTool(Tool):
|
||||
def execute(self, input: str):
|
||||
# get top10 results from Google search.
|
||||
search = GoogleSerperAPIWrapper(serper_api_key=self.serper_api_key, k=10, gl="us", hl="en", type="search")
|
||||
return search.run(query=input)
|
||||
return search.run(query=input)
|
||||
|
||||
@@ -17,12 +17,20 @@ class GoogleSearchTool(Tool):
|
||||
Implement the execute method of demo google search tool, using the `GoogleSerperAPIWrapper` to implement a simple Google search.
|
||||
|
||||
Note:
|
||||
You need to sign up for a free account at https://serper.dev and get the serpher api key (2500 free queries).
|
||||
You need to sign up for a free account at https://serper.dev and get the serper api key (2500 free queries).
|
||||
"""
|
||||
|
||||
serper_api_key: Optional[str] = Field(default_factory=lambda: get_from_env("SERPER_API_KEY"))
|
||||
|
||||
def execute(self, input: str):
|
||||
# get top10 results from Google search.
|
||||
"""Execute Google search and return top 10 results.
|
||||
|
||||
Args:
|
||||
input (str): The search query string
|
||||
|
||||
Returns:
|
||||
str: Search results from Google in text format
|
||||
"""
|
||||
# Configure Google search with top 10 results, US region, English language
|
||||
search = GoogleSerperAPIWrapper(serper_api_key=self.serper_api_key, k=10, gl="us", hl="en", type="search")
|
||||
return search.run(query=input)
|
||||
return search.run(query=input)
|
||||
|
||||
@@ -17,7 +17,7 @@ class GoogleSearchTool(Tool):
|
||||
Implement the execute method of demo google search tool, using the `GoogleSerperAPIWrapper` to implement a simple Google search.
|
||||
|
||||
Note:
|
||||
You need to sign up for a free account at https://serper.dev and get the serpher api key (2500 free queries).
|
||||
You need to sign up for a free account at https://serper.dev and get the serper api key (2500 free queries).
|
||||
"""
|
||||
|
||||
serper_api_key: Optional[str] = Field(default_factory=lambda: get_from_env("SERPER_API_KEY"))
|
||||
@@ -25,4 +25,4 @@ class GoogleSearchTool(Tool):
|
||||
def execute(self, input: str):
|
||||
# get top10 results from Google search.
|
||||
search = GoogleSerperAPIWrapper(serper_api_key=self.serper_api_key, k=10, gl="us", hl="en", type="search")
|
||||
return search.run(query=input)
|
||||
return search.run(query=input)
|
||||
|
||||
@@ -17,7 +17,7 @@ class GoogleSearchTool(Tool):
|
||||
Implement the execute method of demo google search tool, using the `GoogleSerperAPIWrapper` to implement a simple Google search.
|
||||
|
||||
Note:
|
||||
You need to sign up for a free account at https://serper.dev and get the serpher api key (2500 free queries).
|
||||
You need to sign up for a free account at https://serper.dev and get the serper api key (2500 free queries).
|
||||
"""
|
||||
|
||||
serper_api_key: Optional[str] = Field(default_factory=lambda: get_from_env("SERPER_API_KEY"))
|
||||
@@ -25,4 +25,4 @@ class GoogleSearchTool(Tool):
|
||||
def execute(self, input: str):
|
||||
# get top10 results from Google search.
|
||||
search = GoogleSerperAPIWrapper(serper_api_key=self.serper_api_key, k=10, gl="us", hl="en", type="search")
|
||||
return search.run(query=input)
|
||||
return search.run(query=input)
|
||||
|
||||
@@ -18,7 +18,7 @@ class GoogleSearchTool(Tool):
|
||||
Implement the execute method of demo google search tool, using the `GoogleSerperAPIWrapper` to implement a simple Google search.
|
||||
|
||||
Note:
|
||||
You need to sign up for a free account at https://serper.dev and get the serpher api key (2500 free queries).
|
||||
You need to sign up for a free account at https://serper.dev and get the serper api key (2500 free queries).
|
||||
"""
|
||||
|
||||
serper_api_key: Optional[str] = Field(default_factory=lambda: get_from_env("SERPER_API_KEY"))
|
||||
@@ -26,4 +26,4 @@ class GoogleSearchTool(Tool):
|
||||
def execute(self, input: str):
|
||||
# get top10 results from Google search.
|
||||
search = GoogleSerperAPIWrapper(serper_api_key=self.serper_api_key, k=10, gl="us", hl="en", type="search")
|
||||
return search.run(query=input)
|
||||
return search.run(query=input)
|
||||
|
||||
@@ -17,7 +17,7 @@ class GoogleSearchTool(Tool):
|
||||
Implement the execute method of demo google search tool, using the `GoogleSerperAPIWrapper` to implement a simple Google search.
|
||||
|
||||
Note:
|
||||
You need to sign up for a free account at https://serper.dev and get the serpher api key (2500 free queries).
|
||||
You need to sign up for a free account at https://serper.dev and get the serper api key (2500 free queries).
|
||||
"""
|
||||
|
||||
serper_api_key: Optional[str] = Field(default_factory=lambda: get_from_env("SERPER_API_KEY"))
|
||||
@@ -25,4 +25,4 @@ class GoogleSearchTool(Tool):
|
||||
def execute(self, input: str):
|
||||
# get top10 results from Google search.
|
||||
search = GoogleSerperAPIWrapper(serper_api_key=self.serper_api_key, k=10, gl="us", hl="en", type="search")
|
||||
return search.run(query=input)
|
||||
return search.run(query=input)
|
||||
|
||||
@@ -19,7 +19,7 @@ class DemoSearchTool(Tool):
|
||||
Implement the execute method of demo google search tool, using the `GoogleSerperAPIWrapper` to implement a simple Google search.
|
||||
|
||||
Note:
|
||||
You need to sign up for a free account at https://serper.dev and get the serpher api key (2500 free queries).
|
||||
You need to sign up for a free account at https://serper.dev and get the serper api key (2500 free queries).
|
||||
"""
|
||||
|
||||
serper_api_key: Optional[str] = Field(default_factory=lambda: get_from_env("SERPER_API_KEY"))
|
||||
|
||||
@@ -19,7 +19,7 @@ class GoogleSearchTool(Tool):
|
||||
Implement the execute method of demo google search tool, using the `GoogleSerperAPIWrapper` to implement a simple Google search.
|
||||
|
||||
Note:
|
||||
You need to sign up for a free account at https://serper.dev and get the serpher api key (2500 free queries).
|
||||
You need to sign up for a free account at https://serper.dev and get the serper api key (2500 free queries).
|
||||
"""
|
||||
|
||||
serper_api_key: Optional[str] = Field(default_factory=lambda: get_from_env("SERPER_API_KEY"))
|
||||
@@ -27,4 +27,4 @@ class GoogleSearchTool(Tool):
|
||||
def execute(self, input: str):
|
||||
# get top10 results from Google search.
|
||||
search = GoogleSerperAPIWrapper(serper_api_key=self.serper_api_key, k=10, gl="us", hl="en", type="search")
|
||||
return search.run(query=input)
|
||||
return search.run(query=input)
|
||||
|
||||
Reference in New Issue
Block a user