mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-15 22:06: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:
@@ -43,7 +43,7 @@ class GetMarkdownTool(BuiltinTool):
|
||||
Invoke the SerplyApi tool.
|
||||
"""
|
||||
url = tool_parameters["url"]
|
||||
location = tool_parameters.get("location", None)
|
||||
location = tool_parameters.get("location")
|
||||
|
||||
api_key = self.runtime.credentials["serply_api_key"]
|
||||
result = SerplyApi(api_key).run(url, location=location)
|
||||
|
||||
@@ -55,7 +55,7 @@ class SerplyApi:
|
||||
f"Employer: {job['employer']}",
|
||||
f"Location: {job['location']}",
|
||||
f"Link: {job['link']}",
|
||||
f"""Highest: {", ".join([h for h in job["highlights"]])}""",
|
||||
f"""Highest: {", ".join(list(job["highlights"]))}""",
|
||||
"---",
|
||||
])
|
||||
)
|
||||
@@ -78,7 +78,7 @@ class JobSearchTool(BuiltinTool):
|
||||
query = tool_parameters["query"]
|
||||
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["serply_api_key"]
|
||||
result = SerplyApi(api_key).run(query, gl=gl, hl=hl, location=location)
|
||||
|
||||
@@ -80,7 +80,7 @@ class NewsSearchTool(BuiltinTool):
|
||||
query = tool_parameters["query"]
|
||||
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["serply_api_key"]
|
||||
result = SerplyApi(api_key).run(query, gl=gl, hl=hl, location=location)
|
||||
|
||||
@@ -83,7 +83,7 @@ class ScholarSearchTool(BuiltinTool):
|
||||
query = tool_parameters["query"]
|
||||
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["serply_api_key"]
|
||||
result = SerplyApi(api_key).run(query, gl=gl, hl=hl, location=location)
|
||||
|
||||
Reference in New Issue
Block a user