neuro-simulator 0.4.1__py3-none-any.whl → 0.4.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- neuro_simulator/agent/tools/manager.py +1 -1
- neuro_simulator/agent/tools/model_spin.py +41 -0
- neuro_simulator/agent/tools/model_zoom.py +41 -0
- neuro_simulator/assets/neuro_start.mp4 +0 -0
- neuro_simulator/cli.py +2 -2
- neuro_simulator/config.yaml.example +157 -0
- neuro_simulator/core/config.py +10 -6
- {neuro_simulator-0.4.1.dist-info → neuro_simulator-0.4.3.dist-info}/METADATA +60 -60
- {neuro_simulator-0.4.1.dist-info → neuro_simulator-0.4.3.dist-info}/RECORD +12 -8
- {neuro_simulator-0.4.1.dist-info → neuro_simulator-0.4.3.dist-info}/WHEEL +0 -0
- {neuro_simulator-0.4.1.dist-info → neuro_simulator-0.4.3.dist-info}/entry_points.txt +0 -0
- {neuro_simulator-0.4.1.dist-info → neuro_simulator-0.4.3.dist-info}/top_level.txt +0 -0
@@ -80,7 +80,7 @@ class ToolManager:
|
|
80
80
|
def _load_allocations(self):
|
81
81
|
"""Loads tool allocations from JSON files, creating defaults if they don't exist."""
|
82
82
|
default_allocations = {
|
83
|
-
"neuro_agent": ["speak", "get_core_memory_blocks", "get_core_memory_block"],
|
83
|
+
"neuro_agent": ["speak", "get_core_memory_blocks", "get_core_memory_block", "model_spin", "model_zoom"],
|
84
84
|
"memory_agent": ["add_temp_memory", "create_core_memory_block", "update_core_memory_block", "delete_core_memory_block", "add_to_core_memory_block", "remove_from_core_memory_block", "get_core_memory_blocks", "get_core_memory_block"]
|
85
85
|
}
|
86
86
|
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# neuro_simulator/agent/tools/model_spin.py
|
2
|
+
import logging
|
3
|
+
from typing import Dict, Any, List
|
4
|
+
|
5
|
+
from neuro_simulator.agent.tools.base import BaseTool
|
6
|
+
from neuro_simulator.services.stream import live_stream_manager
|
7
|
+
|
8
|
+
logger = logging.getLogger(__name__.replace("neuro_simulator", "server", 1))
|
9
|
+
|
10
|
+
class ModelSpinTool(BaseTool):
|
11
|
+
"""A tool to make the client-side avatar spin."""
|
12
|
+
|
13
|
+
def __init__(self, **kwargs):
|
14
|
+
# The base class might pass memory_manager, so we accept it but don't use it.
|
15
|
+
pass
|
16
|
+
|
17
|
+
@property
|
18
|
+
def name(self) -> str:
|
19
|
+
return "model_spin"
|
20
|
+
|
21
|
+
@property
|
22
|
+
def description(self) -> str:
|
23
|
+
return "Makes model spin once, dont got too dizzy when spining lol."
|
24
|
+
|
25
|
+
@property
|
26
|
+
def parameters(self) -> List[Dict[str, Any]]:
|
27
|
+
return []
|
28
|
+
|
29
|
+
async def execute(self, **kwargs: Any) -> Dict[str, Any]:
|
30
|
+
"""
|
31
|
+
Sends a WebSocket command to the client to trigger the avatar spin animation.
|
32
|
+
"""
|
33
|
+
logger.info(f"Executing {self.name} tool.")
|
34
|
+
try:
|
35
|
+
await live_stream_manager.event_queue.put({
|
36
|
+
"type": "model_spin"
|
37
|
+
})
|
38
|
+
return {"status": "success", "message": "Spin command sent."}
|
39
|
+
except Exception as e:
|
40
|
+
logger.error(f"Error in {self.name} tool: {e}", exc_info=True)
|
41
|
+
return {"status": "error", "message": str(e)}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# neuro_simulator/agent/tools/model_zoom.py
|
2
|
+
import logging
|
3
|
+
from typing import Dict, Any, List
|
4
|
+
|
5
|
+
from neuro_simulator.agent.tools.base import BaseTool
|
6
|
+
from neuro_simulator.services.stream import live_stream_manager
|
7
|
+
|
8
|
+
logger = logging.getLogger(__name__.replace("neuro_simulator", "server", 1))
|
9
|
+
|
10
|
+
class ModelZoomTool(BaseTool):
|
11
|
+
"""A tool to make the client-side avatar zoom in."""
|
12
|
+
|
13
|
+
def __init__(self, **kwargs):
|
14
|
+
# The base class might pass memory_manager, so we accept it but don't use it.
|
15
|
+
pass
|
16
|
+
|
17
|
+
@property
|
18
|
+
def name(self) -> str:
|
19
|
+
return "model_zoom"
|
20
|
+
|
21
|
+
@property
|
22
|
+
def description(self) -> str:
|
23
|
+
return "Makes model zoom in, just like got closer to fans."
|
24
|
+
|
25
|
+
@property
|
26
|
+
def parameters(self) -> List[Dict[str, Any]]:
|
27
|
+
return []
|
28
|
+
|
29
|
+
async def execute(self, **kwargs: Any) -> Dict[str, Any]:
|
30
|
+
"""
|
31
|
+
Sends a WebSocket command to the client to trigger the avatar zoom animation.
|
32
|
+
"""
|
33
|
+
logger.info(f"Executing {self.name} tool.")
|
34
|
+
try:
|
35
|
+
await live_stream_manager.event_queue.put({
|
36
|
+
"type": "model_zoom"
|
37
|
+
})
|
38
|
+
return {"status": "success", "message": "Zoom command sent."}
|
39
|
+
except Exception as e:
|
40
|
+
logger.error(f"Error in {self.name} tool: {e}", exc_info=True)
|
41
|
+
return {"status": "error", "message": str(e)}
|
Binary file
|
neuro_simulator/cli.py
CHANGED
@@ -40,7 +40,7 @@ def main():
|
|
40
40
|
path_manager.initialize_path_manager(os.getcwd())
|
41
41
|
|
42
42
|
# Define example_path early for config loading
|
43
|
-
example_path = Path(__file__).parent / "
|
43
|
+
example_path = Path(__file__).parent / "config.yaml.example"
|
44
44
|
|
45
45
|
# 2.2. Copy default config.yaml.example if it doesn't exist
|
46
46
|
try:
|
@@ -48,7 +48,7 @@ def main():
|
|
48
48
|
destination_config_example = path_manager.path_manager.working_dir / "config.yaml.example"
|
49
49
|
if not destination_config_example.exists():
|
50
50
|
shutil.copy(source_config_example, destination_config_example)
|
51
|
-
logging.info(f"
|
51
|
+
logging.info(f"Copyed default config.yaml.example to {destination_config_example}")
|
52
52
|
except Exception as e:
|
53
53
|
logging.warning(f"Could not copy default config.yaml.example: {e}")
|
54
54
|
|
@@ -0,0 +1,157 @@
|
|
1
|
+
# --- API密钥配置(无法通过外部控制面板修改) ---
|
2
|
+
api_keys:
|
3
|
+
# Letta API Token - 用于与 Letta 服务进行身份验证
|
4
|
+
# 如果你自建 Letta Server 且没有设置 token,可以留空
|
5
|
+
letta_token: "YOUR_LETTA_TOKEN_HERE"
|
6
|
+
|
7
|
+
# Letta Server 基础 URL - 如果你自建 Letta Server 请填写完整地址,否则留空以使用Letta Cloud
|
8
|
+
letta_base_url: ""
|
9
|
+
|
10
|
+
# Neuro Agent ID - 在 Letta 中创建的 Agent 的唯一标识符
|
11
|
+
neuro_agent_id: "YOUR_AGENT_ID_HERE"
|
12
|
+
|
13
|
+
# Gemini API Key - 用于调用 Google Gemini API 生成观众聊天内容
|
14
|
+
gemini_api_key: "YOUR_GEMINI_KEY_HERE"
|
15
|
+
|
16
|
+
# OpenAI API Key - 用于调用兼容 OpenAI 的 API 生成观众聊天内容
|
17
|
+
openai_api_key: "YOUR_OPENAI_KEY_HERE"
|
18
|
+
|
19
|
+
# OpenAI API 基础 URL - 如果使用第三方兼容 OpenAI API 服务(如 SiliconFlow)请填写对应地址
|
20
|
+
openai_api_base_url: "YOUR_OPENAI_BASE_URL_HERE"
|
21
|
+
|
22
|
+
# Azure 语音服务密钥 - 用于调用微软 Azure TTS 服务合成语音
|
23
|
+
azure_speech_key: "YOUR_AZURE_KEY_HERE"
|
24
|
+
|
25
|
+
# Azure 语音服务区域 - Azure 服务所在的区域,如 "eastus" 或 "westus"
|
26
|
+
azure_speech_region: "YOUR_AZURE_REGION_HERE"
|
27
|
+
|
28
|
+
# --- 直播元数据配置 ---
|
29
|
+
stream_metadata:
|
30
|
+
# 主播昵称 - 显示在直播中的主播名称(此设置无法通过外部控制面板修改)
|
31
|
+
streamer_nickname: "vedal987"
|
32
|
+
|
33
|
+
# 直播标题 - 显示在直播页面的标题
|
34
|
+
stream_title: "neuro-sama is here for u all"
|
35
|
+
|
36
|
+
# 直播分类 - 直播内容的分类标签
|
37
|
+
stream_category: "谈天说地"
|
38
|
+
|
39
|
+
# 直播标签 - 用于描述直播内容的标签列表
|
40
|
+
stream_tags: ["Vtuber", "AI", "Cute", "English", "Gremlin", "catgirl"]
|
41
|
+
|
42
|
+
# --- Agent 类型设置 ---
|
43
|
+
# 选择一个用来模拟Neuro的Agent提供方
|
44
|
+
# - "letta": 使用Letta作为Agent,需要在上方配置Letta API相关信息
|
45
|
+
# - "builtin": 使用内建Agent,请在下方填写配置
|
46
|
+
agent_type: "builtin"
|
47
|
+
|
48
|
+
# --- 内建Agent设置 ---
|
49
|
+
# 仅当agent_type设置为"builtin"时生效
|
50
|
+
agent:
|
51
|
+
# Agent的API服务商,支持"gemini"和"openai",API Key配置使用顶部填写的值
|
52
|
+
agent_provider: "gemini"
|
53
|
+
# Agent使用的模型,切换gemini/openai时记得更改
|
54
|
+
agent_model: "gemini-2.5-flash-lite"
|
55
|
+
|
56
|
+
# --- Neuro 行为与节奏控制 ---
|
57
|
+
neuro_behavior:
|
58
|
+
# 输入聊天采样数量 - 每次生成 Neuro 回复时从观众聊天中采样的消息数量,不建议太长
|
59
|
+
input_chat_sample_size: 10
|
60
|
+
|
61
|
+
# 说话后冷却时间(秒) - Neuro 每次说完话后的等待时间
|
62
|
+
post_speech_cooldown_sec: 1.0
|
63
|
+
|
64
|
+
# 初始问候语 - 直播开始时给 Neuro 的系统提示语
|
65
|
+
initial_greeting: "The stream has just started. Greet your audience and say hello!"
|
66
|
+
|
67
|
+
# --- Chatbot 配置 ---
|
68
|
+
audience_simulation:
|
69
|
+
# LLM 提供商 - 选择用于生成观众聊天的 AI 服务,只能是 'gemini' 或 'openai'
|
70
|
+
llm_provider: "gemini"
|
71
|
+
|
72
|
+
# Gemini 模型 - 使用 Gemini 服务时的具体模型名称
|
73
|
+
# 推荐使用gemma-3-27b-it,每天可免费调用14000次(15:00 GMT+8 刷新次数)
|
74
|
+
gemini_model: "gemma-3-27b-it"
|
75
|
+
|
76
|
+
# OpenAI 模型 - 使用 OpenAI 服务时的具体模型名称
|
77
|
+
# 推荐使用SiliconFlow,9B以下模型免费不限量调用(注意TPM限制)
|
78
|
+
openai_model: "THUDM/GLM-4-9B-0414"
|
79
|
+
|
80
|
+
# LLM 温度 - 控制 AI 生成内容的随机性,值越高越随机(0-2之间)
|
81
|
+
llm_temperature: 0.7
|
82
|
+
|
83
|
+
# 聊天生成间隔(秒) - 调用 Chatbot 生成新观众聊天的时间间隔
|
84
|
+
chat_generation_interval_sec: 2
|
85
|
+
|
86
|
+
# 每批聊天生成数量 - 每次调用 Chatbot 时生成的聊天消息数量
|
87
|
+
chats_per_batch: 3
|
88
|
+
|
89
|
+
# 最大输出 Token 数 - 单次调用 Chatbot 时允许生成的最大 token 数量
|
90
|
+
max_output_tokens: 300
|
91
|
+
|
92
|
+
# Chatbot 提示模板 - 用于指导 AI 生成观众聊天内容的提示词
|
93
|
+
# 其中 {neuro_speech} 和 {num_chats_to_generate} 会被动态替换
|
94
|
+
prompt_template: |
|
95
|
+
You are a Twitch live stream viewer. Your goal is to generate short, realistic, and relevant chat messages.
|
96
|
+
The streamer, Neuro-Sama, just said the following:
|
97
|
+
---
|
98
|
+
{neuro_speech}
|
99
|
+
---
|
100
|
+
Based on what Neuro-Sama said, generate a variety of chat messages. Your messages should be:
|
101
|
+
- Directly reacting to her words.
|
102
|
+
- Asking follow-up questions.
|
103
|
+
- Using relevant Twitch emotes (like LUL, Pog, Kappa, etc.).
|
104
|
+
- General banter related to the topic.
|
105
|
+
- Short and punchy, like real chat messages.
|
106
|
+
Do NOT act as the streamer. Do NOT generate full conversations.
|
107
|
+
Generate exactly {num_chats_to_generate} distinct chat messages. Each message must be prefixed with a DIFFERENT fictional username, like 'ChatterBoy: message text', 'EmoteFan: message text'.
|
108
|
+
|
109
|
+
# 用户名黑名单 - 当检测到这些用户名时会自动替换为 username_pool 中的用户名
|
110
|
+
username_blocklist: ["ChatterBoy", "EmoteFan", "Username", "User"]
|
111
|
+
|
112
|
+
# 用户名池 - 用于替换黑名单用户名或生成新用户名(有时候Chatbot LLM可能未给出用户名)的候选列表
|
113
|
+
username_pool:
|
114
|
+
- "ChatterBox"
|
115
|
+
- "EmoteLord"
|
116
|
+
- "QuestionMark"
|
117
|
+
- "StreamFan"
|
118
|
+
- "PixelPundit"
|
119
|
+
- "CodeSage"
|
120
|
+
- "DataDiver"
|
121
|
+
- "ByteBard"
|
122
|
+
|
123
|
+
# --- 音频合成 (TTS) 配置 ---
|
124
|
+
tts:
|
125
|
+
# 语音名称 - 不要调整这个设置
|
126
|
+
voice_name: "en-US-AshleyNeural"
|
127
|
+
|
128
|
+
# 语音音调 - 除非你不想听Neuro的声音
|
129
|
+
voice_pitch: 1.25
|
130
|
+
|
131
|
+
# --- 数据流与性能配置 ---
|
132
|
+
performance:
|
133
|
+
# 输入队列最大大小 - 可能被提供给 Neuro 作为输入的聊天消息最大数量
|
134
|
+
# 具体逻辑是在 neuro_input_queue_max_size 中抽取 input_chat_sample_size 条消息发送
|
135
|
+
neuro_input_queue_max_size: 200
|
136
|
+
|
137
|
+
# 观众聊天缓冲区最大大小 - 后端存储的聊天记录总量
|
138
|
+
audience_chat_buffer_max_size: 1000
|
139
|
+
|
140
|
+
# 客户端初始聊天数 - 向新客户端发送的历史聊天消息数量,主要用来应对中途加入的客户端
|
141
|
+
initial_chat_backlog_limit: 50
|
142
|
+
|
143
|
+
# --- 服务器配置 ---
|
144
|
+
server:
|
145
|
+
# 服务器主机地址 - 服务器监听的主机地址(使用 uvicorn 命令启动时此设置无效)
|
146
|
+
host: "127.0.0.1"
|
147
|
+
|
148
|
+
# 服务器端口 - 服务器监听的端口号(使用 uvicorn 命令启动时此设置无效)
|
149
|
+
port: 8000
|
150
|
+
|
151
|
+
# 面板密码 - 设置 API token 用于外部控制面板的身份验证,在公网持续部署时强烈建议开启
|
152
|
+
panel_password: "your-secret-api-token-here"
|
153
|
+
|
154
|
+
# 客户端来源 - 允许跨域访问的客户端地址列表,非本机访问时记得添加一下
|
155
|
+
client_origins:
|
156
|
+
- "http://localhost:5173"
|
157
|
+
- "http://127.0.0.1:5173"
|
neuro_simulator/core/config.py
CHANGED
@@ -133,9 +133,11 @@ class ConfigManager:
|
|
133
133
|
# Scenario 1: Both config and example are missing in the working directory.
|
134
134
|
if not config_path.exists() and not example_path.exists():
|
135
135
|
try:
|
136
|
-
import
|
137
|
-
|
138
|
-
|
136
|
+
import importlib.resources
|
137
|
+
# For Python 3.9+, prefer importlib.resources.files
|
138
|
+
ref = importlib.resources.files('neuro_simulator') / 'config.yaml.example'
|
139
|
+
with importlib.resources.as_file(ref) as package_example_path:
|
140
|
+
shutil.copy(package_example_path, example_path)
|
139
141
|
logging.info(f"Created '{example_path}' from package resource.")
|
140
142
|
logging.error(f"Configuration file '{config_path.name}' not found. A new '{example_path.name}' has been created. Please configure it and rename it to '{config_path.name}'.")
|
141
143
|
sys.exit(1)
|
@@ -151,9 +153,11 @@ class ConfigManager:
|
|
151
153
|
# Scenario 3: Config exists, but example is missing.
|
152
154
|
elif config_path.exists() and not example_path.exists():
|
153
155
|
try:
|
154
|
-
import
|
155
|
-
|
156
|
-
|
156
|
+
import importlib.resources
|
157
|
+
# For Python 3.9+, prefer importlib.resources.files
|
158
|
+
ref = importlib.resources.files('neuro_simulator') / 'config.yaml.example'
|
159
|
+
with importlib.resources.as_file(ref) as package_example_path:
|
160
|
+
shutil.copy(package_example_path, example_path)
|
157
161
|
logging.info(f"Created missing '{example_path.name}' from package resource.")
|
158
162
|
except Exception as e:
|
159
163
|
logging.warning(f"Could not create missing '{example_path.name}': {e}")
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: neuro_simulator
|
3
|
-
Version: 0.4.
|
3
|
+
Version: 0.4.3
|
4
4
|
Summary: Neuro Simulator Server
|
5
5
|
Author-email: Moha-Master <hongkongreporter@outlook.com>
|
6
6
|
License-Expression: MIT
|
@@ -53,66 +53,71 @@ Requires-Dist: flake8; extra == "dev"
|
|
53
53
|
neuro_simulator/
|
54
54
|
├── __init__.py
|
55
55
|
├── cli.py # 命令行启动脚本
|
56
|
-
├──
|
56
|
+
├── agent/
|
57
57
|
│ ├── __init__.py
|
58
|
-
│ ├──
|
59
|
-
│ ├──
|
60
|
-
│ ├──
|
61
|
-
│ ├──
|
62
|
-
│
|
63
|
-
├── agent/ # 内建Agent模块
|
64
|
-
│ ├── __init__.py
|
65
|
-
│ ├── base.py # Agent基类
|
66
|
-
│ ├── core.py # Agent核心实现
|
67
|
-
│ ├── factory.py # Agent工厂
|
68
|
-
│ ├── llm.py # LLM客户端
|
69
|
-
│ ├── memory/ # 记忆管理模块
|
58
|
+
│ ├── core.py
|
59
|
+
│ ├── llm.py
|
60
|
+
│ ├── memory_prompt.txt
|
61
|
+
│ ├── neuro_prompt.txt
|
62
|
+
│ ├── memory/
|
70
63
|
│ │ ├── __init__.py
|
71
|
-
│ │ ├──
|
72
|
-
│ │ ├──
|
73
|
-
│ │ ├──
|
74
|
-
│ │ ├──
|
75
|
-
│ │ └── temp_memory.json
|
76
|
-
│ └── tools/
|
77
|
-
│
|
78
|
-
|
79
|
-
├── api/ # API路由模块
|
64
|
+
│ │ ├── chat_history.json
|
65
|
+
│ │ ├── core_memory.json
|
66
|
+
│ │ ├── init_memory.json
|
67
|
+
│ │ ├── manager.py
|
68
|
+
│ │ └── temp_memory.json
|
69
|
+
│ └── tools/
|
70
|
+
│ └── ...
|
71
|
+
├── api/
|
80
72
|
│ ├── __init__.py
|
81
|
-
│
|
82
|
-
|
83
|
-
│ └──
|
84
|
-
├──
|
73
|
+
│ └── system.py
|
74
|
+
├── assets/
|
75
|
+
│ └── neuro_start.mp4
|
76
|
+
├── core/
|
85
77
|
│ ├── __init__.py
|
86
|
-
│ ├──
|
87
|
-
│ ├──
|
88
|
-
│ ├──
|
89
|
-
│ ├──
|
90
|
-
│
|
91
|
-
|
78
|
+
│ ├── agent_factory.py
|
79
|
+
│ ├── agent_interface.py
|
80
|
+
│ ├── application.py
|
81
|
+
│ ├── config.py
|
82
|
+
│ ├── config.yaml.example
|
83
|
+
│ └── path_manager.py
|
84
|
+
├── services/
|
92
85
|
│ ├── __init__.py
|
93
|
-
│ ├──
|
94
|
-
│ ├──
|
95
|
-
│ ├──
|
96
|
-
│ ├──
|
97
|
-
│ └──
|
98
|
-
|
99
|
-
|
100
|
-
├──
|
101
|
-
|
86
|
+
│ ├── audience.py
|
87
|
+
│ ├── audio.py
|
88
|
+
│ ├── builtin.py
|
89
|
+
│ ├── letta.py
|
90
|
+
│ └── stream.py
|
91
|
+
└── utils/
|
92
|
+
├── __init__.py
|
93
|
+
├── logging.py
|
94
|
+
├── process.py
|
95
|
+
├── queue.py
|
96
|
+
├── state.py
|
97
|
+
└── websocket.py
|
102
98
|
```
|
103
99
|
|
104
100
|
``` workin'dir
|
105
101
|
working_dir_example/ # 工作目录结构,请将这个目录重命名和复制到你想要的位置(推荐放到~/.config/neuro-simulator)
|
106
|
-
├── assets/
|
102
|
+
├── assets/ # 媒体文件夹,如缺失会使用自带资源覆盖
|
107
103
|
│ └── neuro_start.mp4 # 用来计算Start Soon长度,仅读取时长,请和客户端的视频保持一致
|
108
104
|
├── config.yaml # 由用户手工创建的配置文件
|
109
105
|
├── config.yaml.example # 自动生成的配置文件模板,必须手动重命名和填写
|
110
|
-
└──
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
106
|
+
└── agents/ # Agent相关文件夹
|
107
|
+
├── memories/ # Agent记忆文件夹
|
108
|
+
│ ├── core_memory.json
|
109
|
+
│ ├── init_memory.json
|
110
|
+
│ └── temp_memory.json
|
111
|
+
├── memory_manager/ # 记忆管理器Agent
|
112
|
+
│ ├── history.jsonl
|
113
|
+
│ ├── memory_prompt.txt
|
114
|
+
│ └── tools.json
|
115
|
+
├── neuro/ # Neuro主Agent
|
116
|
+
│ ├── history.jsonl
|
117
|
+
│ ├── neuro_prompt.txt
|
118
|
+
│ └── tools.json
|
119
|
+
└── tools/ # Agent工具文件夹
|
120
|
+
└── builtin_tools/
|
116
121
|
```
|
117
122
|
|
118
123
|
## 安装与配置
|
@@ -185,17 +190,12 @@ neuro -D /path/to/your/config -H 0.0.0.0 -P 8080
|
|
185
190
|
|
186
191
|
## API 接口
|
187
192
|
|
188
|
-
|
189
|
-
|
190
|
-
- `/api/stream/*` - 直播控制接口(启动/停止/重启/状态)
|
191
|
-
- `/api/configs/*` - 配置管理接口(获取/更新/重载配置)
|
192
|
-
- `api_keys` `server` 等敏感配置项无法从接口获取和修改
|
193
|
-
- `/api/logs` - 日志获取接口
|
194
|
-
- `/api/system/health` - 健康检查接口
|
195
|
-
- `/ws/stream` - 客户端使用的直播接口
|
196
|
-
- `/ws/admin` - 日志和内建 Agent的 Context 流接口
|
193
|
+
服务端的主要管理和控制功能已统一迁移至 WebSocket 接口 `/ws/admin`。原有的 HTTP API 仅保留 `/api/system/health` 用于建立 WS 连接前的健康检查
|
197
194
|
|
198
|
-
|
195
|
+
- `/ws/admin`: 用于控制面板的管理接口,提供直播控制、配置管理、日志监控、Agent交互等所有功能,详细规范请参阅 `WEBSOCKET_API.md`
|
196
|
+
- `/ws/stream`: 客户端使用的直播接口
|
197
|
+
- `/api/system/health`: 健康检查接口
|
198
|
+
- `/docs`: 自动生成的API文档 (Swagger UI)
|
199
199
|
|
200
200
|
## 配置说明
|
201
201
|
|
@@ -222,4 +222,4 @@ neuro -D /path/to/your/config -H 0.0.0.0 -P 8080
|
|
222
222
|
- 确保所有必需的 API 密钥都已正确配置
|
223
223
|
- 检查网络连接是否正常
|
224
224
|
- 查看日志文件获取错误信息
|
225
|
-
- 确保端口未被其他程序占用
|
225
|
+
- 确保端口未被其他程序占用
|
@@ -1,5 +1,6 @@
|
|
1
1
|
neuro_simulator/__init__.py,sha256=-tposzyvg6UckPcfSvtc03UjxBa9oCe_zRvlKf8splk,31
|
2
|
-
neuro_simulator/cli.py,sha256=
|
2
|
+
neuro_simulator/cli.py,sha256=gtmZZ7Y-lZqEtz9AIA4TuJ4vJw5pNFvPrqpxxIaDnl4,5455
|
3
|
+
neuro_simulator/config.yaml.example,sha256=RbSHEAFD9NEuIvgl5Smpasfz4jiZYQgzTovL3MrhhIs,6549
|
3
4
|
neuro_simulator/agent/__init__.py,sha256=t52CZlyTGWqcGjMs90qvpFpRckY2WSSlO7r_H3K_mSY,32
|
4
5
|
neuro_simulator/agent/core.py,sha256=_UkxMV1S33VHjD1JFlKz17GpaDhHQGNA9s9dsRgd3j0,9561
|
5
6
|
neuro_simulator/agent/llm.py,sha256=xPBEXpZ19WOt7YkERNaY9rscNI-ePASTjIt-_sZV7UI,4262
|
@@ -15,17 +16,20 @@ neuro_simulator/agent/tools/create_core_memory_block.py,sha256=uM2vF71Ai3NH2-Qbr
|
|
15
16
|
neuro_simulator/agent/tools/delete_core_memory_block.py,sha256=_t2NZWZaxuWJsm9Uof3Zscvucyz-xJfyC0KrssSXPGI,1379
|
16
17
|
neuro_simulator/agent/tools/get_core_memory_block.py,sha256=vFK6lrbOqdxWVpYa7yF96wkXKMcpQAn4E68GCZlu0Ow,1432
|
17
18
|
neuro_simulator/agent/tools/get_core_memory_blocks.py,sha256=UbK-GkPgha35n703bCKzdnoIKgXR4U4YxqsSYWimW6c,1059
|
18
|
-
neuro_simulator/agent/tools/manager.py,sha256
|
19
|
+
neuro_simulator/agent/tools/manager.py,sha256=VIOjgcWUiIzZaQw2yMT6W5kxlEpcnlGZwjGwQJ721Sg,7152
|
20
|
+
neuro_simulator/agent/tools/model_spin.py,sha256=MFRUOKumx-vPMq7f9fteW-KJhL_TBmKUEWQg3ezLunU,1374
|
21
|
+
neuro_simulator/agent/tools/model_zoom.py,sha256=12Mnd8Y-487Klxgz2Nf1Xno-yF0b4t26O5UpFp_RKmE,1368
|
19
22
|
neuro_simulator/agent/tools/remove_from_core_memory_block.py,sha256=uiY69y2iIJYp3Zh8EdtP2_G5Zqfs4YKSmTBd9zcIp_c,2372
|
20
23
|
neuro_simulator/agent/tools/speak.py,sha256=7vPbfWjllxSz39HmOUbKRPwPx64q2vsYrqDu-JsfZJk,1870
|
21
24
|
neuro_simulator/agent/tools/update_core_memory_block.py,sha256=CQgimyPNLmOuK_pDAiAxV9qEf3Tx6u7OKludlIR08BA,2272
|
22
25
|
neuro_simulator/api/__init__.py,sha256=5LWyDSayPGdQS8Rv13nmAKLyhPnMVPyTYDdvoMPB4xw,56
|
23
26
|
neuro_simulator/api/system.py,sha256=OJT6m6HIYATMCAKrgeBRhficaiUjIDl9f-WyUT-RoBw,1874
|
27
|
+
neuro_simulator/assets/neuro_start.mp4,sha256=xCLnNzv4THnzRYwkdV6EiqXc-XtFd867R2ZVLDvNp0Y,8226418
|
24
28
|
neuro_simulator/core/__init__.py,sha256=-ojq25c8XA0CU25b0OxcGjH4IWFEDHR-HXSRSZIuKe8,57
|
25
29
|
neuro_simulator/core/agent_factory.py,sha256=p3IKT6sNzSpUojQjvbZJu0pbmyyb258sGn_YNSJlqwI,1717
|
26
30
|
neuro_simulator/core/agent_interface.py,sha256=ZXUCtkQUvsBQ5iCb0gTILJaShn5KmSrEgKhd7PK18HE,2794
|
27
31
|
neuro_simulator/core/application.py,sha256=mW5SlqonSn5oQvb5xuGR8FTZ_-sEx3OUTXwfC_N_-2c,26703
|
28
|
-
neuro_simulator/core/config.py,sha256=
|
32
|
+
neuro_simulator/core/config.py,sha256=JNcZccxRa0oY_6ctRlue_2Wf2zxL0FONr8jXVE8xqfg,15568
|
29
33
|
neuro_simulator/core/path_manager.py,sha256=hfjI4s8-WXlgwvPWDSLYMQ2d0OaXPOMYWWlP5xe5NLg,2954
|
30
34
|
neuro_simulator/services/__init__.py,sha256=s3ZrAHg5TpJakadAAGY1h0wDw_xqN4Je4aJwJyRBmk4,61
|
31
35
|
neuro_simulator/services/audience.py,sha256=sAmvkz1ip1MNqaw7t-9abqfnmp0yh8EdG5bS5KYR-Us,4999
|
@@ -39,8 +43,8 @@ neuro_simulator/utils/process.py,sha256=9OYWx8fzaJZqmFUcjQX37AnBhl7YWvrLxDWBa30v
|
|
39
43
|
neuro_simulator/utils/queue.py,sha256=bg-mIFF8ycClwmmfcKSPjAXtvjImzTKf6z7xZc2VX20,2196
|
40
44
|
neuro_simulator/utils/state.py,sha256=DdBqSAYfjOFtJfB1hEGhYPh32r1ZvFuVlN_-29_-luA,664
|
41
45
|
neuro_simulator/utils/websocket.py,sha256=fjC-qipzjgM_e7XImP12DFmLhvxkMOSr2GnUWws7esE,2058
|
42
|
-
neuro_simulator-0.4.
|
43
|
-
neuro_simulator-0.4.
|
44
|
-
neuro_simulator-0.4.
|
45
|
-
neuro_simulator-0.4.
|
46
|
-
neuro_simulator-0.4.
|
46
|
+
neuro_simulator-0.4.3.dist-info/METADATA,sha256=2cAnGJWSywTFI4vjaTyogCXdh6n6T681-Bk4PBSg-hs,7675
|
47
|
+
neuro_simulator-0.4.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
48
|
+
neuro_simulator-0.4.3.dist-info/entry_points.txt,sha256=qVd5ypnRRgU8Cw7rWfZ7o0OXyS9P9hgY-cRoN_mgz9g,51
|
49
|
+
neuro_simulator-0.4.3.dist-info/top_level.txt,sha256=V8awSKpcrFnjJDiJxSfy7jtOrnuE2BgAR9hLmfMDWK8,16
|
50
|
+
neuro_simulator-0.4.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|