(self, credentials: BundleCredentials, plugin_input: PluginInput)
| 4 | |
| 5 | class Evaluate(PluginHandler): |
| 6 | async def execute(self, credentials: BundleCredentials, plugin_input: PluginInput) -> PluginOutput: |
| 7 | expression: str = plugin_input.input_params.get("expression") |
| 8 | try: |
| 9 | expression = sp.sympify(expression) |
| 10 | result = expression.evalf() |
| 11 | return PluginOutput(data={"result": str(result)}) |
| 12 | except Exception as e: |
| 13 | raise_http_error( |
| 14 | ErrorCode.REQUEST_VALIDATION_ERROR, "Invalid expression. Please provide a valid expression." |
| 15 | ) |
nothing calls this directly
no test coverage detected