flow moduoles (#161)

* flow intro

* docs:flow modules

* docs:flow modules
This commit is contained in:
Archer
2023-08-09 18:07:58 +08:00
committed by GitHub
parent b6f9f77ed4
commit 657d0ad374
52 changed files with 485 additions and 56 deletions

View File

@@ -0,0 +1,64 @@
# AI 对话
- 可重复添加(复杂编排时候防止线太乱,可以更美观)
- 有外部输入
- 有静态配置
- 触发执行
- 核心模块
![](./imgs/aichat.png)
## 参数说明
### 对话模型
可以通过 [data/config.json](/docs/develop/data_config/chat_models) 配置可选的对话模型,通过 [OneAPI](http://localhost:3000/docs/develop/oneapi) 来实现多模型接入。
### 温度 & 回复上限
温度:越低回答越严谨,少废话(实测下来,感觉差别不大)
回复上限:最大回复 token 数量(只有 OpenAI 模型有效)。注意,是回复!不是总 tokens。
### 系统提示词(可被外部输入覆盖)
被防止在上下文数组的最前面role 为 system用于引导模型。具体用法参考各搜索引擎的教程~
### 限定词(可被外部输入覆盖)
与系统提示词类似role 也是 system 类型,只不过位置会被放置在问题前,拥有更强的引导作用。
### 引用内容
接收一个外部输入的数组,主要是由【知识库搜索】模块生成,也可以由 Http 模块从外部引入。数据结构例子如下:
```ts
type DataType = {
kb_id?: string;
id?: string;
q: string;
a: string;
source?: string;
};
// 如果是外部引入的内容,尽量不要携带 kb_id 和 id
const quoteList: DataType[] = [
{ kb_id: '11', id: '222', q: '你还', a: '哈哈', source: '' },
{ kb_id: '11', id: '333', q: '你还', a: '哈哈', source: '' },
{ kb_id: '11', id: '444', q: '你还', a: '哈哈', source: '' }
];
```
## 完整上下文组成
最终发送给 LLM 大模型的数据是一个数组,内容和顺序如下:
```
[
系统提示词
引用内容
聊天记录
限定词
问题
]
```