实现 services
This commit is contained in:
@@ -7,11 +7,12 @@ import pathlib
|
||||
from heurams.services.config import ConfigFile
|
||||
|
||||
root_dir = pathlib.Path(__file__).parent
|
||||
|
||||
working_dir = pathlib.Path.cwd()
|
||||
|
||||
config_var: ContextVar[ConfigFile] = ContextVar('config_var', default=ConfigFile(working_dir / "config" / "config.toml")) # 配置文件
|
||||
|
||||
runtime_var: ContextVar = ContextVar('runtime_var', default=None) # 运行时共享数据
|
||||
runtime_var: ContextVar = ContextVar('runtime_var', default=dict()) # 运行时共享数据
|
||||
|
||||
class ConfigContext:
|
||||
"""
|
||||
|
||||
@@ -1 +1,6 @@
|
||||
# 音频服务
|
||||
from heurams.context import config_var
|
||||
from heurams.providers.audio import players
|
||||
from typing import Callable
|
||||
|
||||
player: Callable = players[config_var.get().get("player_provider")]
|
||||
@@ -1 +0,0 @@
|
||||
# 缓存服务
|
||||
@@ -1 +1,6 @@
|
||||
# 文本转语音服务
|
||||
from heurams.context import config_var
|
||||
from heurams.providers.tts import TTSs
|
||||
from typing import Callable
|
||||
|
||||
convert: Callable = TTSs[config_var.get().get("tts_provider")]
|
||||
@@ -1,3 +1,4 @@
|
||||
# 版本控制集成服务
|
||||
|
||||
ver = "0.4.0"
|
||||
ver = "0.4.0"
|
||||
stage = "prototype"
|
||||
Reference in New Issue
Block a user