mirror of
https://github.com/BoardWare-Genius/jarvis-models.git
synced 2025-12-14 17:13:25 +00:00
feat: dotchain
This commit is contained in:
24
src/blackbox/sum.py
Normal file
24
src/blackbox/sum.py
Normal file
@ -0,0 +1,24 @@
|
||||
from .blackbox import Blackbox
|
||||
from injector import singleton
|
||||
|
||||
@singleton
|
||||
class Sum(Blackbox):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
def __call__(self, *args, **kwargs):
|
||||
return self.processing(*args, **kwargs)
|
||||
|
||||
def processing(self, *args, **kwargs):
|
||||
total = 0
|
||||
for arg in args[0]:
|
||||
total += arg
|
||||
return total
|
||||
|
||||
def valid(self, *args, **kwargs) -> bool:
|
||||
return super().valid(*args, **kwargs)
|
||||
|
||||
async def fast_api_handler(self, request):
|
||||
json = await request.json()
|
||||
return self.processing(json)
|
||||
Reference in New Issue
Block a user