chore: refurish python code by applying Pylint linter rules (#8322)
This commit is contained in:
@@ -5,7 +5,7 @@ from urllib.parse import urlencode
|
||||
|
||||
import httpx
|
||||
|
||||
import core.helper.ssrf_proxy as ssrf_proxy
|
||||
from core.helper import ssrf_proxy
|
||||
from core.tools.entities.tool_bundle import ApiToolBundle
|
||||
from core.tools.entities.tool_entities import ToolInvokeMessage, ToolProviderType
|
||||
from core.tools.errors import ToolInvokeError, ToolParameterValidationError, ToolProviderCredentialValidationError
|
||||
@@ -191,7 +191,7 @@ class ApiTool(Tool):
|
||||
else:
|
||||
body = body
|
||||
|
||||
if method in ("get", "head", "post", "put", "delete", "patch"):
|
||||
if method in {"get", "head", "post", "put", "delete", "patch"}:
|
||||
response = getattr(ssrf_proxy, method)(
|
||||
url,
|
||||
params=params,
|
||||
@@ -224,9 +224,9 @@ class ApiTool(Tool):
|
||||
elif option["type"] == "string":
|
||||
return str(value)
|
||||
elif option["type"] == "boolean":
|
||||
if str(value).lower() in ["true", "1"]:
|
||||
if str(value).lower() in {"true", "1"}:
|
||||
return True
|
||||
elif str(value).lower() in ["false", "0"]:
|
||||
elif str(value).lower() in {"false", "0"}:
|
||||
return False
|
||||
else:
|
||||
continue # Not a boolean, try next option
|
||||
|
Reference in New Issue
Block a user