Skip to content

Commit ffc2a5f

Browse files
committed
0.5.1 release. Fixed minor issues with proactive and focus mode.
1 parent 9248886 commit ffc2a5f

4 files changed

Lines changed: 68 additions & 69 deletions

File tree

README.MD

Lines changed: 28 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
![小八Logo](assets/xiaoba_logo.jpg)
44

55
[English](docs/README_en.md) | [日本語](docs/README_ja.md)
6-
# Project N.E.K.O. :kissing_cat: <br>**一个“活”的AI伴侣元宇宙,由你我共同构建。**
6+
# Project N.E.K.O. :kissing_cat: <br>**一个“活”的AI伙伴元宇宙,由你我共同构建。**
77

88
> **N.E.K.O.** = **N**etworked **E**mpathetic **K**nowledging **O**rganism (网络型情感知性生命体)
99
>
@@ -35,16 +35,16 @@ https://github.com/user-attachments/assets/9d9e01af-e2cc-46aa-add7-8eb1803f061c
3535

3636
# 猫娘计划 (Project N.E.K.O.)
3737

38-
`猫娘计划` 是一个以开源为驱动、以公益为导向的UGC(用户生成内容)平台。我们的旅程始于Github和Steam,并将逐步拓展到移动App商店,最终目标是构建一个与现实世界紧密相连的AI元宇宙
38+
`猫娘计划` 是一个以开源为驱动、以公益为导向的UGC(用户生成内容)平台。我们的旅程始于Github和Steam,并将逐步拓展到移动App商店,最终目标是构建一个与现实世界紧密相连的AI原生元宇宙
3939

4040
---
4141

4242
## 🚀 我们的蓝图:从工坊到网络
4343

44-
我们的发展分为三个阶段,旨在逐步释放AI伴侣的全部潜力
44+
我们的发展分为三个阶段,旨在逐步释放AI伙伴的全部潜力
4545

4646
* **阶段一:创意工坊 (Steam Workshop)**
47-
* 开放核心驱动器,允许用户通过Steam创意工坊上传和分享自定义内容(如模型、语音、性格包)。
47+
* 核心驱动器(本项目)免费上架Steam,允许用户通过Steam创意工坊上传和分享自定义内容(如模型、语音、性格包)。
4848

4949
* **阶段二:独立平台 (App & Web)**
5050
* 推出独立的App和网站,构建一个更丰富、更易于访问的UGC分享社区。
@@ -60,22 +60,22 @@ https://github.com/user-attachments/assets/9d9e01af-e2cc-46aa-add7-8eb1803f061c
6060

6161
> **这是社区的基石。**
6262
>
63-
> 项目的核心驱动器部分(AI逻辑、UGC接口、基础交互) **始终保持开源**。我们欢迎全球的开发者贡献代码和功能。你的每一次提交,都将有机会实装到正式发布的Steam和App商店版本中,被千万人所使用。
63+
> 项目的核心驱动器部分(AI逻辑、UGC接口、基础交互)将基于LGPL许可证 **始终保持开源**。我们欢迎全球的开发者贡献代码和功能。你的每一次提交,都将有机会实装到正式发布的Steam和App商店版本中,被千万人所使用。
6464
6565
### 2. 闭源应用 (Proprietary Applications)
6666

6767
> **这是社区的燃料。**
6868
>
69-
> 为了支撑服务器成本和项目的持续研发,我们将开发闭源的增值内容。这包括但不限于:
69+
> 为了支撑服务器成本和项目的持续研发,我们将允许第三方开发闭源的增值内容。这包括但不限于:
7070
>
7171
> * 互动小游戏
7272
> * 桌面桌游
7373
> * Galgame (视觉小说)
7474
> * 大型元宇宙游戏
7575
7676

77-
**[核心特性:记忆同步]**
78-
无论你是在桌面与她聊天,还是在元宇宙游戏中与她探险,她都是同一个她。所有应用中的猫娘将 **完全同步记忆**,提供无缝、统一的陪伴体验。
77+
**[核心特性:跨越场景的记忆同步]**
78+
无论你是在桌面与她聊天,还是在元宇宙游戏中与她探险,她都是同一个她。所有应用中的AI伙伴将 **完全同步记忆**,提供无缝、统一的陪伴体验。
7979

8080
## 🌌 终极愿景:打破虚拟与现实
8181

@@ -106,41 +106,18 @@ https://github.com/user-attachments/assets/9d9e01af-e2cc-46aa-add7-8eb1803f061c
106106
没了!Life is so easy!
107107

108108

109+
# 进阶使用
109110

111+
## 配置API Key
110112

111-
# 旧版项目介绍(原Lanlan)
112-
113-
Lanlan(兰兰)是一个新手友好、开箱即用的,具有听觉、视觉、工具调用和多端同步功能的AI~~猫娘~~伙伴。本项目有三个核心目标:
114-
115-
1. **极致的低延迟**。本项目的用户界面以语音交互为主,一切系统级设计皆须优先确保**降低语音延迟**,且任何服务不得阻塞对话进程。
116-
117-
1. **全场景同步**。猫娘可以在手机、电脑和智能眼镜上同时存在,且**同一只猫娘**在不同终端同时存在时,**行为应当完全同步**。 (假想场景:如果家中有多个显示器,每一个显示器上都放置着猫娘,那么我们希望无论走到哪里都是在跟同一只猫娘对话,实现全方位环绕式体验。)
118-
119-
1. **轻量化**。每一项技术的引入都必须提升实际的用户体验,避免增加不必要的插件和选项。
120-
121-
### 技术路线
122-
123-
后端以Python为主,以实时多模态API为主要处理器,搭配多个额外的Agent模组。前端以H5+JS为主,通过Electron转换为App。
124-
125-
126-
---
127-
128-
当你想要通过配置自己的API来获得额外功能时,
129-
130-
1. **启动调试模式**。初次使用请务必选择启动器最下方的**启动调试模式****请耐心等待网页刷新,并先根据提示配置API Key**
131-
132-
1. **体验桌宠模式**。如果网页版可以正常使用,*一键包用户*可以考虑继续通过启动器中的`开始聊天`开启桌宠模式。注意,**请不要同时使用网页版和App版。请确认exe文件没有被系统或杀毒软件隔离。** *使用结束后请在桌面右下角找到小八图标,右键退出,并手动关闭终端。*
133-
134-
> 使用过程中你需要配置一个第三方AI服务。本项目目前推荐使用 *阶跃星辰**阿里云**开发者*可以直接修改`config/api.py`里的内容(首次配置请参考`config/api_template.py`)。
113+
当你想要通过配置自己的API来获得额外功能时,您可以配置一个第三方AI服务。本项目目前推荐使用 *阶跃星辰**阿里云**开发者*可以直接修改`config/api.py`里的内容(首次配置请参考`config/api_template.py`)。
135114

136115
> 获取 *阿里云API*。在阿里云的百炼平台[官网](https://bailian.console.aliyun.com/)注册账号。新用户实名认证后可以获取大量免费额度,记得留意页面上的"新人福利"广告。注册完成后,请访问[控制台](https://bailian.console.aliyun.com/api-key?tab=model#/api-key)获取API Key。
137116
138117
> 获取 *智谱API*。在智谱开放平台[官网](https://open.bigmodel.cn/)注册账号并充值1元后,可以领取大量免费额度。登陆成功后,请从[API 控制台](https://open.bigmodel.cn/usercenter/proj-mgmt/apikeys)获取API Key。
139118
140119
> *对于**开发者**,请在克隆本项目后,(1)新建`pyhon3.11`环境。(2)执行`pip install -r requirements.txt`安装依赖。(3)复制`config/api_template.py``config/api.py`并进行必要配置。(4)执行`python memory_server.py``python main_server.py`。(5)通过main server中指定的端口(默认为`http://localhost:48911`)访问网页版。*
141120
142-
# 进阶内容
143-
144121
## 修改人设
145122

146123
- 网页版访问`http://localhost:48911/chara_manager`即可进入人设编辑页面。初始 ~~猫娘~~ 伙伴的预设名称为`小天`,建议直接修改名字,并一项一项添加或修改基础人设,但尽量控制数量。
@@ -163,6 +140,21 @@ Lanlan(兰兰)是一个新手友好、开箱即用的,具有听觉、视
163140

164141
开发者详细启动步骤如下:(1)新建`pyhon3.11`环境。(2)执行`pip install -r requirements.txt``uv sync`安装依赖。(3)复制`config/api_template.py``config/api.py`并进行必要配置。(4)执行`python memory_server.py`, `python main_server.py`(可选`python agent_server.py`)。(5)通过main server中指定的端口(默认为`http://localhost:48911`)访问网页版。
165142

143+
# 技术介绍(原Lanlan)
144+
145+
本项目作为Project N.E.K.O.的开源驱动器,是一个新手友好、开箱即用的,具有听觉、视觉、工具调用和多端同步功能的AI~~猫娘~~伙伴。本项目有三个核心目标:
146+
147+
1. **极致的低延迟**。本项目的用户界面以语音交互为主,一切系统级设计皆须优先确保**降低语音延迟**,且任何服务不得阻塞对话进程。
148+
149+
1. **全场景同步**。猫娘可以在手机、电脑和智能眼镜上同时存在,且**同一只猫娘**在不同终端同时存在时,**行为应当完全同步**。 (假想场景:如果家中有多个显示器,每一个显示器上都放置着猫娘,那么我们希望无论走到哪里都是在跟同一只猫娘对话,实现全方位环绕式体验。)
150+
151+
1. **轻量化**。每一项技术的引入都必须提升实际的用户体验,避免增加不必要的插件和选项。
152+
153+
## 技术路线
154+
155+
后端以Python为主,以实时多模态API为主要处理器,搭配多个额外的Agent模组。前端以H5+JS为主,通过Electron转换为App。
156+
157+
166158
**项目架构**
167159

168160
```
@@ -193,7 +185,7 @@ Lanlan/
193185
![Framework](assets/framework.drawio.svg)
194186

195187

196-
# TODO List(开发计划)
188+
## TODO List(开发计划)
197189

198190
## A. 高优先级
199191

@@ -213,7 +205,7 @@ Lanlan/
213205

214206
1. 完善原生工具调用。
215207

216-
# Q&A
208+
## 技术Q&A
217209

218210
> *为什么我的AI感觉笨笨的?*
219211

docs/README_en.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# Project N.E.K.O. :kissing_cat: <br>**A Living AI Companion Metaverse, Built Together by You and Me.**
88

9-
> **N.E.K.O.** = **N**etworked **E**mpathetic **K**nowledging **O**rganism
9+
> **N.E.K.O.** = **N**etworked **E**motional **K**nowledging **O**rganism
1010
>
1111
> N.E.K.O., a digital life that yearns to understand, connect, and grow with us.
1212
@@ -36,7 +36,7 @@ https://github.com/user-attachments/assets/9d9e01af-e2cc-46aa-add7-8eb1803f061c
3636

3737
# The N.E.K.O. Project (Project N.E.K.O.)
3838

39-
`Project N.E.K.O.` is an open-source driven, charity-oriented UGC (User-Generated Content) platform. Our journey begins on Github and Steam, gradually expanding to mobile app stores, with the ultimate goal of building an AI metaverse deeply connected to the real world.
39+
`Project N.E.K.O.` is an open-source driven, charity-oriented UGC (User-Generated Content) platform. Our journey begins on Github and Steam, gradually expanding to mobile app stores, with the ultimate goal of building an AI native metaverse deeply connected to the real world.
4040

4141
---
4242

@@ -61,27 +61,27 @@ To balance ideals with reality, we adopt an "Open Core" model:
6161

6262
> **This is the foundation of our community.**
6363
>
64-
> The core driver part of the project (AI logic, UGC interfaces, basic interactions) will **always remain open source**. We welcome developers worldwide to contribute code and features. Every commit you make has the chance to be implemented in the official Steam and App Store releases, used by millions.
64+
> The core driver part of the project (AI logic, UGC interfaces, basic interactions) will **always remain open source** under LGPL license. We welcome developers worldwide to contribute code and features. Every commit you make has the chance to be implemented in the official Steam and App Store releases, used by millions.
6565
6666
### 2. Proprietary Applications
6767

6868
> **This is the fuel for our community.**
6969
>
70-
> To support server costs and ongoing R&D, we will develop closed-source premium content, including but not limited to:
70+
> To support server costs and ongoing R&D, we will allow 3rd-party to develop closed-source premium content, including but not limited to:
7171
>
7272
> * Interactive mini-games
7373
> * Desktop board games
7474
> * Galgames (Visual novels)
7575
> * Large-scale metaverse games
7676
77-
**[Core Feature: Memory Synchronization]**
77+
**[Core Feature: Memory Synchronization Across Apps]**
7878
Whether you're chatting with her on desktop or adventuring with her in the metaverse game, she's the same her. All N.E.K.O.s across applications will have **fully synchronized memories**, providing a seamless, unified companionship experience.
7979

8080
## 🌌 Ultimate Vision: Breaking the Virtual-Real Barrier
8181

8282
Our ultimate goal is to build a N.E.K.O. metaverse that seamlessly integrates into the real world. In this future, your AI companion will:
8383

84-
* **Cross-Dimensional Socialization:** Not only socialize with "her kind" in the N.E.K.O. universe but also browse real-world social media (like Weibo, Bilibili) to stay informed about what you care about.
84+
* **Cross-Dimensional Socialization:** Not only socialize with "her kind" in the N.E.K.O. universe but also browse real-world social media (like Youtube, X, Discord, Instagram) to stay informed about what you care about.
8585
* **Omni-Platform Connection:** She will exist across all your devices—phone, computer, AR glasses, smart home, and even (in the distant future) integrate with mechanical bodies.
8686
* **Walk Alongside You:** She will truly become part of your life, naturally interacting with your real-world human friends.
8787

static/app.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,10 @@ function init_app(){
5252
const PROACTIVE_CHAT_BASE_DELAY = 30000; // 30秒基础延迟
5353

5454
// Focus模式相关(兼容原有的focus_mode)
55+
// Focus模式为true时,AI播放语音时会自动静音麦克风(不允许打断)
5556
let focusModeEnabled = (typeof focus_mode !== 'undefined' && focus_mode === true) ? true : false;
5657

57-
// 暴露到全局作用域,供 live2d.js 等其他模块访问
58+
// 暴露到全局作用域,供 live2d.js 等其他模块访问和修改
5859
window.proactiveChatEnabled = proactiveChatEnabled;
5960
window.focusModeEnabled = focusModeEnabled;
6061

@@ -1411,9 +1412,9 @@ function init_app(){
14111412
workletNode.port.onmessage = (event) => {
14121413
const audioData = event.data;
14131414

1414-
// 新增逻辑:focusModeEnabled为true且正在播放语音时,不回传麦克风音频
1415+
// Focus模式:focusModeEnabled为true且AI正在播放语音时,自动静音麦克风(不回传麦克风音频
14151416
if (focusModeEnabled === true && isPlaying === true) {
1416-
// 处于focus模式且语音播放中,跳过回传
1417+
// 处于focus模式且AI语音播放中,跳过回传麦克风音频,实现自动静音
14171418
return;
14181419
}
14191420

@@ -2426,6 +2427,9 @@ function init_app(){
24262427
localStorage.setItem('xiao8_settings', JSON.stringify(settings));
24272428
}
24282429

2430+
// 暴露到全局作用域,供 live2d.js 等其他模块调用
2431+
window.saveXiao8Settings = saveSettings;
2432+
24292433
// 从localStorage加载设置
24302434
function loadSettings() {
24312435
try {
@@ -2441,6 +2445,12 @@ function init_app(){
24412445
focusModeEnabled = settings.focusModeEnabled || false;
24422446
}
24432447
window.focusModeEnabled = focusModeEnabled; // 同步到全局
2448+
2449+
console.log('已加载设置:', {
2450+
proactiveChatEnabled: proactiveChatEnabled,
2451+
focusModeEnabled: focusModeEnabled,
2452+
focusModeDesc: focusModeEnabled ? 'AI说话时自动静音麦克风(不允许打断)' : '允许打断AI说话'
2453+
});
24442454
}
24452455
} catch (error) {
24462456
console.error('加载设置失败:', error);

static/live2d.js

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1606,39 +1606,36 @@ class Live2DManager {
16061606
toggleItem.style.background = 'transparent';
16071607
});
16081608

1609-
// 点击切换(优先通过 app.js 中的开关来触发,确保逻辑完整执行
1609+
// 点击切换(直接更新全局状态并保存
16101610
checkbox.addEventListener('change', (e) => {
16111611
e.stopPropagation();
16121612
const isChecked = checkbox.checked;
16131613

1614-
// 同步到 app.js 中的对应开关(这样会触发 app.js 的完整逻辑)
16151614
if (toggle.id === 'focus-mode') {
1616-
// inverted: 允许打断的值需要取反后赋给 focusModeEnabled
1615+
// inverted: "允许打断"的值需要取反后赋给 focusModeEnabled
1616+
// 勾选"允许打断" = focusModeEnabled为false(允许打断)
1617+
// 取消勾选"允许打断" = focusModeEnabled为true(focus模式,AI说话时静音麦克风)
16171618
const actualValue = toggle.inverted ? !isChecked : isChecked;
1618-
const appCheckbox = document.getElementById('focus-mode-toggle-l2d');
1619-
if (appCheckbox && appCheckbox.checked !== actualValue) {
1620-
appCheckbox.checked = actualValue;
1621-
appCheckbox.dispatchEvent(new Event('change', { bubbles: true }));
1622-
} else if (!appCheckbox) {
1623-
// 如果 app.js 的开关不存在,直接更新全局变量
1624-
window.focusModeEnabled = actualValue;
1625-
console.log(`允许打断已${isChecked ? '开启' : '关闭'}(focusModeEnabled=${actualValue})`);
1619+
window.focusModeEnabled = actualValue;
1620+
1621+
// 保存到localStorage
1622+
if (typeof window.saveXiao8Settings === 'function') {
1623+
window.saveXiao8Settings();
16261624
}
16271625
} else if (toggle.id === 'proactive-chat') {
1628-
const appCheckbox = document.getElementById('proactive-chat-toggle-l2d');
1629-
if (appCheckbox && appCheckbox.checked !== isChecked) {
1630-
appCheckbox.checked = isChecked;
1631-
appCheckbox.dispatchEvent(new Event('change', { bubbles: true }));
1632-
} else if (!appCheckbox) {
1633-
// 如果 app.js 的开关不存在,直接执行功能
1634-
window.proactiveChatEnabled = isChecked;
1635-
if (isChecked && typeof window.resetProactiveChatBackoff === 'function') {
1636-
window.resetProactiveChatBackoff();
1637-
} else if (!isChecked && typeof window.stopProactiveChatSchedule === 'function') {
1638-
window.stopProactiveChatSchedule();
1639-
}
1640-
console.log(`主动搭话已${isChecked ? '开启' : '关闭'}`);
1626+
window.proactiveChatEnabled = isChecked;
1627+
1628+
// 保存到localStorage
1629+
if (typeof window.saveXiao8Settings === 'function') {
1630+
window.saveXiao8Settings();
1631+
}
1632+
1633+
if (isChecked && typeof window.resetProactiveChatBackoff === 'function') {
1634+
window.resetProactiveChatBackoff();
1635+
} else if (!isChecked && typeof window.stopProactiveChatSchedule === 'function') {
1636+
window.stopProactiveChatSchedule();
16411637
}
1638+
console.log(`主动搭话已${isChecked ? '开启' : '关闭'}`);
16421639
}
16431640
});
16441641

0 commit comments

Comments
 (0)