mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-28 01:53:53 +08:00
合并网友提交优化
This commit is contained in:
@@ -3,7 +3,7 @@ import sys
|
||||
from loguru import logger
|
||||
from config.config_loader import load_config
|
||||
|
||||
SERVER_VERSION = "0.3.3"
|
||||
SERVER_VERSION = "0.3.4"
|
||||
|
||||
|
||||
def get_module_abbreviation(module_name, module_dict):
|
||||
|
||||
@@ -269,8 +269,6 @@ class ConnectionHandler:
|
||||
self.config["selected_module"]["Intent"] = private_config[
|
||||
"selected_module"
|
||||
]["Intent"]
|
||||
if private_config.get("prompt", None) is not None:
|
||||
self.config["prompt"] = private_config["prompt"]
|
||||
try:
|
||||
modules = initialize_modules(
|
||||
self.logger,
|
||||
|
||||
@@ -237,7 +237,7 @@ def initialize_modules(
|
||||
|
||||
# 初始化LLM模块
|
||||
if init_llm:
|
||||
select_llm_module = config["selected_module"]["TTS"]
|
||||
select_llm_module = config["selected_module"]["LLM"]
|
||||
llm_type = (
|
||||
select_llm_module
|
||||
if "type" not in config["LLM"][select_llm_module]
|
||||
@@ -307,8 +307,8 @@ def initialize_modules(
|
||||
logger.bind(tag=TAG).info(f"初始化组件: asr成功 {select_asr_module}")
|
||||
|
||||
# 初始化自定义prompt
|
||||
if config["prompt"]:
|
||||
if config.get("prompt", None) is not None:
|
||||
modules["prompt"] = config["prompt"]
|
||||
logger.bind(tag=TAG).info(f"初始化组件: prompt成功 {modules['prompt'][:30]}")
|
||||
logger.bind(tag=TAG).info(f"初始化组件: prompt成功 {modules['prompt'][:50]}...")
|
||||
|
||||
return modules
|
||||
|
||||
Reference in New Issue
Block a user