mirror of
https://github.com/leon-ai/leon.git
synced 2024-12-01 03:15:58 +03:00
feat(bridge/python): typing (WIP)
This commit is contained in:
parent
47d5a48ac9
commit
de17719537
@ -2,6 +2,7 @@ import random
|
|||||||
import sys
|
import sys
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
||||||
|
from types import
|
||||||
from ..constants import SKILL_SRC_CONFIG, SKILL_CONFIG, INTENT_OBJECT
|
from ..constants import SKILL_SRC_CONFIG, SKILL_CONFIG, INTENT_OBJECT
|
||||||
|
|
||||||
class Leon:
|
class Leon:
|
||||||
@ -11,7 +12,7 @@ class Leon:
|
|||||||
if not Leon.instance:
|
if not Leon.instance:
|
||||||
Leon.instance = self
|
Leon.instance = self
|
||||||
|
|
||||||
def get_src_config(key: str = None):
|
def get_src_config(self, key: str = None):
|
||||||
"""
|
"""
|
||||||
Get source configuration
|
Get source configuration
|
||||||
"""
|
"""
|
||||||
@ -24,7 +25,7 @@ class Leon:
|
|||||||
print('Error while getting source configuration:', e)
|
print('Error while getting source configuration:', e)
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
def set_answer_data(answer_key: str, data = None):
|
def set_answer_data(self, answer_key: str, data = None):
|
||||||
"""
|
"""
|
||||||
Apply data to the answer
|
Apply data to the answer
|
||||||
"""
|
"""
|
||||||
@ -66,7 +67,7 @@ class Leon:
|
|||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def answer(answer_input):
|
def answer(self, answer_input: AnswerInput) -> None:
|
||||||
"""
|
"""
|
||||||
Send an answer to the core
|
Send an answer to the core
|
||||||
"""
|
"""
|
||||||
|
22
bridges/python/src/sdk/types.py
Normal file
22
bridges/python/src/sdk/types.py
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
from typing import Dict, Any, Optional, List
|
||||||
|
|
||||||
|
# TODO
|
||||||
|
|
||||||
|
class Answer:
|
||||||
|
key: Optional[str]
|
||||||
|
widget: Optional[Any]
|
||||||
|
data: Optional[AnswerData]
|
||||||
|
core: Optional[Dict[str, Any]]
|
||||||
|
|
||||||
|
class AnswerInput:
|
||||||
|
key: Optional[str]
|
||||||
|
widget: Any
|
||||||
|
data: Optional[AnswerData]
|
||||||
|
core: Dict[str, Any]
|
||||||
|
|
||||||
|
class AnswerData:
|
||||||
|
pass
|
||||||
|
|
||||||
|
class AnswerConfig:
|
||||||
|
text: str
|
||||||
|
speech: str
|
Loading…
Reference in New Issue
Block a user