Skip to content

Commit

Permalink
docs(guide): add active memory and simple audio generation features
Browse files Browse the repository at this point in the history
- Add documentation for active memory feature in Koishi's plugin system
- Include configuration and testing instructions for active memory
- Add documentation for simple audio generation feature
- Provide setup and test examples for audio generation
- Include relevant images for plugin configuration
  • Loading branch information
dingyi222666 committed Oct 26, 2024
1 parent 762c026 commit cce4db2
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 0 deletions.
35 changes: 35 additions & 0 deletions docs/guide/model-plugin-system/active-memory.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 主动记忆

相比被动的 [长期记忆](../session-related/long-term-memory.md),主动记忆工具更偏向于与人类交流般的主动记忆信息。

## 配置

- 在开始之前,确保 [长期记忆](../session-related/long-term-memory.md) 的前置配置已完成。(可以不启用长期记忆)
- 前往 Koishi 的插件市场,搜索 `chatluna-plugin-common`,并安装。
- 按照下图配置在 `plugin-common` 插件中启用 `memory` 功能。

![alt text](../../public/images/image-49.png)

## 测试

尝试和模型对话,让模型记住一些信息。
<chat-panel>
<chat-message nickname="User">chatluna.chat.text 记住我的生日 1995.11.11</chat-message>
<chat-message nickname="Bot">
{<br>
&nbsp;&nbsp;tool: 'memory_save',<br>
&nbsp;&nbsp;arg: '{"input":"生日是1995年11月11日"}'<br>
}
</chat-message>
<chat-message nickname="Bot">你的生日是1995年11月11日。</chat-message>
<chat-message nickname="User">chatluna.room.clear</chat-message>
<chat-message nickname="Bot">已清除房间 User 的房间 的聊天记录。</chat-message>
<chat-message nickname="User">chatluna.chat.text 我的生日是什么时候</chat-message>
<chat-message nickname="Bot">
{<br>
&nbsp;&nbsp;tool: 'memory_search',<br>
&nbsp;&nbsp;arg: '{"input":"birthday"}'<br>
}
</chat-message>
<chat-message nickname="Bot">你的生日是1995年11月11日。</chat-message>
</chat-panel>
43 changes: 43 additions & 0 deletions docs/guide/model-plugin-system/simple-audio-generation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# 简易音频生成

此工具基于 [@dgck81lnn/music](https://github.com/DGCK81LNN/koishi-plugin-music),提供一个简易的音频生成功能。

## 配置

- 前往 Koishi 插件市场安装 [@dgck81lnn/music](https://github.com/DGCK81LNN/koishi-plugin-music) 插件。
-`plugin-common` 插件中启用 `music` 功能。

![alt text](../../public/images/image-50.png)

## 测试

尝试和模型对话,让它生成一段音频。如果成功返回了音频,则说明配置成功。

<chat-panel>
<chat-message nickname="User">chatluna.chat.text 生成欢乐颂旋律的前 15 秒</chat-message>
<chat-message nickname="Bot">
{<br>
&nbsp;&nbsp;tool: 'music',<br>
&nbsp;&nbsp;arg: '{"input":"bpm = 120;\nbaseFrequency = 440;\ngain = 0.5;\n\ntime = 0;\nnote(0, 0.75); note(0, 0.75); note(2, 0.75); note(4, 0.75);\nnote(4, 0.75); note(2, 0.75); note(0, 0.75); note(-1, 0.75);\nnote(-3, 1.5);\nrest(0.5);\nnote(4, 0.75); note(4, 0.75); note(2, 0.75); note(0, 0.75);\nnote(-1, 0.75); note(0, 1.5);\nrest(0.5);\nnote(2, 1.5); note(4, 1.5);\nnote(4, 1.5); note(2, 1.5);\nnote(0, 1.5);\nrest(0.5);\n"}'<br>
}
</chat-message>
<chat-message nickname="Bot">[假装是一条音频]</chat-message>
<chat-message nickname="Bot">如下是旋律的前15秒钟:
bpm = 120;
baseFrequency = 440;
gain = 0.5;

time = 0;
note(0, 0.75); note(0, 0.75); note(2, 0.75); note(4, 0.75);
note(4, 0.75); note(2, 0.75); note(0, 0.75); note(-1, 0.75);
note(-3, 1.5);
rest(0.5);
note(4, 0.75); note(4, 0.75); note(2, 0.75); note(0, 0.75);
note(-1, 0.75); note(0, 1.5);
rest(0.5);
note(2, 1.5); note(4, 1.5);
note(4, 1.5); note(2, 1.5);
note(0, 1.5);
rest(0.5);
</chat-message>
</chat-panel>
Binary file added docs/public/images/image-49.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/public/images/image-50.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cce4db2

Please sign in to comment.