1
1
mirror of https://github.com/leon-ai/leon.git synced 2024-11-24 04:31:31 +03:00

feat(bridge/python): typing (WIP)

This commit is contained in:
louistiti 2023-05-20 23:28:44 +08:00
parent 47d5a48ac9
commit de17719537
No known key found for this signature in database
GPG Key ID: 92CD6A2E497E1669
2 changed files with 26 additions and 3 deletions

View File

@ -2,6 +2,7 @@ import random
import sys
from time import sleep
from types import
from ..constants import SKILL_SRC_CONFIG, SKILL_CONFIG, INTENT_OBJECT
class Leon:
@ -11,7 +12,7 @@ class Leon:
if not Leon.instance:
Leon.instance = self
def get_src_config(key: str = None):
def get_src_config(self, key: str = None):
"""
Get source configuration
"""
@ -24,7 +25,7 @@ class Leon:
print('Error while getting source configuration:', e)
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
"""
@ -66,7 +67,7 @@ class Leon:
return None
def answer(answer_input):
def answer(self, answer_input: AnswerInput) -> None:
"""
Send an answer to the core
"""

View 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