Skip to content

Commit

Permalink
Add doc for turms-plugin-rasa turms-im#1131
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesChenX committed Feb 23, 2023
1 parent 17fc953 commit 7bdad63
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ Note: The main disadvantage of the current Turms project is that it does not pro
| <span style="white-space:nowrap;"> turms-plugin </span> | When events (such as user going online/offline, message receiving and forwarding, etc) are fired, turms-gateway and turms-service will trigger corresponding custom plugins to facilitate developers to implement custom features |
| <span style="white-space:nowrap;">turms-plugin-antispam</span> | A plugin based on turms-plugin for the anti-spam protection using Aho-Corasick automaton with double array trie (The time complexity of detection is O(n), and n is the length of target string code points) |
| <span style="white-space:nowrap;"> turms-plugin-minio</span> |A plugin based on turms-plugin for the storage service, and is used to interact with MinIO server|
| <span style="white-space:nowrap;">turms-plugin-rasa</span> |A plugin based on turms-plugin for the chatbot, and is used to interact with Rasa server|
| <span style="white-space:nowrap;"> turms-data (TODO)</span> | Not yet published. An independent data analysis system based on Flink ecosystem is responsible for business data analysis, and provides underlying data support for the statistics APIs of turms for admins and operational reports of turms-admin |

## Reference Architecture
Expand Down
1 change: 1 addition & 0 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ Turms基于读扩散消息模型进行架构设计,对业务数据变化感知
| <span style="white-space:nowrap;">turms-plugin</span> | 当指定事件(如用户上下线、消息接收与转发等)被触发时,turms-gateway和turms-service会调用对应的自定义插件以方便开发者实现各种各样定制化功能 |
| <span style="white-space:nowrap;">turms-plugin-antispam</span> | 基于双数组Trie的AC自动机算法实现的反垃圾机制(检测的时间复杂度为O(n),n为目标字符串code points的长度) |
| <span style="white-space:nowrap;">turms-plugin-minio</span> | 基于turms-plugin实现的存储服务插件。用于与MinIO服务端进行交互 |
| <span style="white-space:nowrap;">turms-plugin-rasa</span> | 基于turms-plugin实现的聊天机器人插件。用于与Rasa服务端进行交互 |
| <span style="white-space:nowrap;">turms-data(TODO)</span> | 尚未发布。基于Flink生态的独立数据分析系统,负责业务数据统计与分析,为turms的管理员统计API与turms-admin运营报表提供底层数据支持 |

## 参考架构
Expand Down
1 change: 1 addition & 0 deletions turms-docs/src/.vuepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export default defineUserConfig({
'/for-developers/observability.md',
'/for-developers/security.md',
'/for-developers/storage.md',
'/for-developers/chatbot.md',
'/for-developers/anti-spam.md',
'/for-developers/data-analytics.md'
]
Expand Down
1 change: 1 addition & 0 deletions turms-docs/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ Turms基于读扩散消息模型进行架构设计,对业务数据变化感知
| <span style="white-space:nowrap;">turms-plugin</span> | 当指定事件(如用户上下线、消息接收与转发等)被触发时,turms-gateway和turms-service会调用对应的自定义插件以方便开发者实现各种各样定制化功能 |
| <span style="white-space:nowrap;">turms-plugin-antispam</span> | 基于双数组Trie的AC自动机算法实现的反垃圾机制(检测的时间复杂度为O(n),n为目标字符串code points的长度) |
| <span style="white-space:nowrap;">turms-plugin-minio</span> | 基于turms-plugin实现的存储服务插件。用于与MinIO服务端进行交互 |
| <span style="white-space:nowrap;">turms-plugin-rasa</span> | 基于turms-plugin实现的聊天机器人插件。用于与Rasa服务端进行交互 |
| <span style="white-space:nowrap;">turms-data(TODO)</span> | 尚未发布。基于Flink生态的独立数据分析系统,负责业务数据统计与分析,为turms的管理员统计API与turms-admin运营报表提供底层数据支持 |

## 参考架构
Expand Down
23 changes: 23 additions & 0 deletions turms-docs/src/for-developers/chatbot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 聊天机器人

## turms-plugin-rasa

### 简介

turms-plugin-rasa是一个基于开源对话式AI框架[Rasa](https://rasa.com)而开发的turms-service聊天机器人实现插件。

turms-plugin-rasa的工作流程很简单,即:将用户发送的消息转发给Rasa服务端,等Rasa服务端返回响应后,Turms服务端再将响应以消息的形式发送给用户。

### 安装

- [Rasa服务端安装](https://rasa.com/docs/rasa/installation/installing-rasa-open-source)
- [插件的加载方式](https://turms-im.github.io/docs/for-developers/plugin.html#插件加载方式)

### 配置

| 配置项 | 默认值 | 说明 |
| ---------------------------------------------- | --------------------------------------------- | ------------------------------------------------------------ |
| turms-plugin.rasa.enabled | true | 是否启动插件 |
| turms-plugin.rasa.response-delimiter | `\n` | 当用户发送给Rasa服务端一条消息,且Rasa返回多个响应时,使用该字符串作为响应文本之间的分隔符 |
| turms-plugin.rasa.instances[?].chatbot-user-id | 0 | 当用户发送消息给该用户ID时,将消息转发给Rasa服务端 |
| turms-plugin.rasa.instances[?].url | `http://localhost:5005/webhooks/rest/webhook` | 用于接收用户消息的Rasa服务端地址 |

0 comments on commit 7bdad63

Please sign in to comment.