mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-29 05:09:46 +01:00
* 修改了coze的实现方式,使用了v3接口,修复了只能对话一次的bug * 使用mem0ai api实现记忆功能 * Fix docker space (#179) * update:调试docker编译缓存 * update:调试docker编译 * update:调试docker编译容量 * update:调试docker编译 --------- Co-authored-by: hrz <1710360675@qq.com> * TTS处理增加index信息,完善TTS出错时的处理 (#177) * TTS处理增加index信息,完善TTS出错时的处理 * 第一句语音index处理,歌曲播放index处理 * update:去掉了无用变量,修复continuebug --------- Co-authored-by: hrz <1710360675@qq.com> * update:更新demo (#180) Co-authored-by: hrz <1710360675@qq.com> * 优化chat中异步调用方式 * 记忆增加时间,以便大模型判断先后关系 * 记忆对时间戳排序,便于梳理前后关系 * add: 不跟踪music下的文件的更改 (#187) * Mem0ai (#199) * update:增加mem0ai包依赖 * update:文档增加mem0ai的描述 --------- Co-authored-by: hrz <1710360675@qq.com> * Update config.yaml * Update config.yaml * Update config.yaml * Update config.yaml --------- Co-authored-by: strix214 <a1425699467@gmail.com> Co-authored-by: 玄凤科技 <eric230308@gmail.com> Co-authored-by: HonestQiao <honestqiao@163.com> Co-authored-by: 欣南科技 <huangrongzhuang@xin-nan.com> Co-authored-by: hrz <1710360675@qq.com> Co-authored-by: TOM88812 <ttangxs0808@163.com> Co-authored-by: 香草味的纳西妲 <151599587+NyaOH-Nahida@users.noreply.github.com>
17 lines
638 B
Python
17 lines
638 B
Python
import os
|
|
import sys
|
|
import importlib
|
|
from config.logger import setup_logging
|
|
from core.utils.util import read_config, get_project_dir
|
|
|
|
logger = setup_logging()
|
|
|
|
def create_instance(class_name, *args, **kwargs):
|
|
if os.path.exists(os.path.join('core', 'providers', 'memory', class_name, f'{class_name}.py')):
|
|
lib_name = f'core.providers.memory.{class_name}.{class_name}'
|
|
if lib_name not in sys.modules:
|
|
sys.modules[lib_name] = importlib.import_module(f'{lib_name}')
|
|
return sys.modules[lib_name].MemoryProvider(*args, **kwargs)
|
|
|
|
raise ValueError(f"不支持的记忆服务类型: {class_name}")
|
|
|