mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-12 00:36:03 +00:00
ruff
This commit is contained in:
@@ -74,15 +74,24 @@ class ConditionNode(WorkflowNode):
|
||||
left_num = float(left)
|
||||
right_num = float(right)
|
||||
|
||||
if operator == "==": return left_num == right_num
|
||||
elif operator == "!=": return left_num != right_num
|
||||
elif operator == ">": return left_num > right_num
|
||||
elif operator == "<": return left_num < right_num
|
||||
elif operator == ">=": return left_num >= right_num
|
||||
elif operator == "<=": return left_num <= right_num
|
||||
if operator == "==":
|
||||
return left_num == right_num
|
||||
elif operator == "!=":
|
||||
return left_num != right_num
|
||||
elif operator == ">":
|
||||
return left_num > right_num
|
||||
elif operator == "<":
|
||||
return left_num < right_num
|
||||
elif operator == ">=":
|
||||
return left_num >= right_num
|
||||
elif operator == "<=":
|
||||
return left_num <= right_num
|
||||
except ValueError:
|
||||
if operator == "==": return left == right
|
||||
elif operator == "!=": return left != right
|
||||
elif operator in (">", "<", ">=", "<="): return False
|
||||
if operator == "==":
|
||||
return left == right
|
||||
elif operator == "!=":
|
||||
return left != right
|
||||
elif operator in (">", "<", ">=", "<="):
|
||||
return False
|
||||
|
||||
return False
|
||||
|
||||
@@ -31,7 +31,6 @@ class DatabaseQueryNode(WorkflowNode):
|
||||
|
||||
async def execute(self, inputs: dict[str, Any], context: ExecutionContext) -> dict[str, Any]:
|
||||
connection_type = self.get_config("connection_type", "postgresql")
|
||||
connection_string = self.get_config("connection_string", "")
|
||||
query = self.get_config("query", "")
|
||||
query_type = self.get_config("query_type", "select")
|
||||
timeout = self.get_config("timeout", 30)
|
||||
|
||||
@@ -30,7 +30,6 @@ class ParameterExtractorNode(WorkflowNode):
|
||||
config_schema: ClassVar[list[NodeConfig]] = []
|
||||
|
||||
async def execute(self, inputs: dict[str, Any], context: ExecutionContext) -> dict[str, Any]:
|
||||
text = inputs.get("text", "")
|
||||
param_defs = self.get_config("parameters", [])
|
||||
|
||||
extracted = {}
|
||||
|
||||
@@ -30,7 +30,6 @@ class QuestionClassifierNode(WorkflowNode):
|
||||
config_schema: ClassVar[list[NodeConfig]] = []
|
||||
|
||||
async def execute(self, inputs: dict[str, Any], context: ExecutionContext) -> dict[str, Any]:
|
||||
question = inputs.get("question", "")
|
||||
categories = self.get_config("categories", [])
|
||||
|
||||
if categories:
|
||||
|
||||
@@ -30,7 +30,4 @@ class SendMessageNode(WorkflowNode):
|
||||
config_schema: ClassVar[list[NodeConfig]] = []
|
||||
|
||||
async def execute(self, inputs: dict[str, Any], context: ExecutionContext) -> dict[str, Any]:
|
||||
message = inputs.get("message", "")
|
||||
target = inputs.get("target") or self.get_config("target_id", "")
|
||||
|
||||
return {"status": "sent", "message_id": f"msg_{context.execution_id}"}
|
||||
|
||||
Reference in New Issue
Block a user