chore: apply flake8-comprehensions Ruff rules to improve collection comprehensions (#5652)

Co-authored-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
Bowen Liang
2024-06-27 11:21:31 +08:00
committed by GitHub
parent 2e718b85e9
commit dcb72e0067
58 changed files with 123 additions and 136 deletions

View File

@@ -94,7 +94,7 @@ class GoogleTool(BuiltinTool):
google_domain = tool_parameters.get("google_domain", "google.com")
gl = tool_parameters.get("gl", "us")
hl = tool_parameters.get("hl", "en")
location = tool_parameters.get("location", None)
location = tool_parameters.get("location")
api_key = self.runtime.credentials['searchapi_api_key']
result = SearchAPI(api_key).run(query, result_type=result_type, num=num, google_domain=google_domain, gl=gl, hl=hl, location=location)

View File

@@ -72,11 +72,11 @@ class GoogleJobsTool(BuiltinTool):
"""
query = tool_parameters['query']
result_type = tool_parameters['result_type']
is_remote = tool_parameters.get("is_remote", None)
is_remote = tool_parameters.get("is_remote")
google_domain = tool_parameters.get("google_domain", "google.com")
gl = tool_parameters.get("gl", "us")
hl = tool_parameters.get("hl", "en")
location = tool_parameters.get("location", None)
location = tool_parameters.get("location")
ltype = 1 if is_remote else None

View File

@@ -82,7 +82,7 @@ class GoogleNewsTool(BuiltinTool):
google_domain = tool_parameters.get("google_domain", "google.com")
gl = tool_parameters.get("gl", "us")
hl = tool_parameters.get("hl", "en")
location = tool_parameters.get("location", None)
location = tool_parameters.get("location")
api_key = self.runtime.credentials['searchapi_api_key']
result = SearchAPI(api_key).run(query, result_type=result_type, num=num, google_domain=google_domain, gl=gl, hl=hl, location=location)