mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-20 08:16:52 +08:00
chore: apply flake8-comprehensions Ruff rules to improve collection comprehensions (#5652)
Co-authored-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user