mirror of
https://github.com/BoardWare-Genius/jarvis-models.git
synced 2025-12-15 17:43:25 +00:00
feat: calculator;
This commit is contained in:
@ -4,12 +4,12 @@ from blackbox.blackbox import Blackbox
|
||||
|
||||
|
||||
class Calculator(Blackbox):
|
||||
|
||||
"""This class just for example, it show how to implement Blackbox interface."""
|
||||
|
||||
"""This class just for example, it show how to implement Blackbox interface."""
|
||||
|
||||
def valid(self, data: any) -> bool:
|
||||
return isinstance(data, dict) and "op" in data and "left" in data and "right" in data
|
||||
|
||||
|
||||
def processing(self, data: dict) -> any:
|
||||
if not self.valid(data):
|
||||
raise ValueError("Invalid data")
|
||||
|
||||
Reference in New Issue
Block a user