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

feat(bridge/python): add constants

This commit is contained in:
louistiti 2023-05-20 22:40:38 +08:00
parent a2eacc3930
commit a32ad86342
No known key found for this signature in database
GPG Key ID: 92CD6A2E497E1669

View File

@ -0,0 +1,28 @@
import sys
import json
import os
INTENT_OBJ_FILE_PATH = sys.argv[1]
with open(INTENT_OBJ_FILE_PATH, 'r') as f:
INTENT_OBJECT = json.load(f)
SKILLS_ROOT_PATH = os.path.join(
os.getcwd(),
'skills'
)
SKILL_PATH = os.path.join(
SKILLS_ROOT_PATH,
INTENT_OBJECT['domain'],
INTENT_OBJECT['skill']
)
SKILLS_PATH = SKILLS_ROOT_PATH
with open(os.path.join(SKILL_PATH, 'config', INTENT_OBJECT['extra_context_data']['lang'] + '.json'), 'r') as f:
SKILL_CONFIG = json.load(f)
with open(os.path.join(SKILL_PATH, 'src', 'config.json'), 'r') as f:
SKILL_SRC_CONFIG = json.load(f)['configurations']