chore: apply flake8-comprehensions Ruff rules to improve collection comprehensions (#5652)
Co-authored-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
parent
2e718b85e9
commit
dcb72e0067
58 changed files with 123 additions and 136 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue