dsh-feiyu-memgate 0.3.2 → 0.4.0
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.
- package/CHANGELOG.md +73 -12
- package/README.md +68 -11
- package/README.zh.md +93 -36
- package/client/README.md +267 -0
- package/client/art/mascot-asleep.webp +0 -0
- package/client/art/mascot-busy.webp +0 -0
- package/client/art/mascot-nag.webp +0 -0
- package/client/art/mascot-ready.webp +0 -0
- package/client/art/mascot-trouble.webp +0 -0
- package/client/client.js +4226 -1269
- package/client/src/clipboard.cjs +52 -0
- package/client/src/constants.cjs +43 -0
- package/client/src/fields.cjs +960 -0
- package/client/src/hooks.cjs +220 -0
- package/client/src/i18n.cjs +444 -0
- package/client/src/index.cjs +69 -0
- package/client/src/kit/controls.cjs +189 -0
- package/client/src/kit/icons.cjs +40 -0
- package/client/src/kit/layout.cjs +124 -0
- package/client/src/layout.cjs +143 -0
- package/client/src/model/changelog.cjs +29 -0
- package/client/src/model/feedback.cjs +168 -0
- package/client/src/model/form.cjs +83 -0
- package/client/src/model/models.cjs +87 -0
- package/client/src/model/overview.cjs +111 -0
- package/client/src/model/page.cjs +104 -0
- package/client/src/model/status.cjs +57 -0
- package/client/src/model/trial.cjs +111 -0
- package/client/src/net.cjs +101 -0
- package/client/src/react.cjs +11 -0
- package/client/src/theme/page.css +1284 -0
- package/client/src/theme/styles.cjs +43 -0
- package/client/src/view/feedback.cjs +180 -0
- package/client/src/view/field-row.cjs +98 -0
- package/client/src/view/hero.cjs +54 -0
- package/client/src/view/markdown.cjs +96 -0
- package/client/src/view/models.cjs +154 -0
- package/client/src/view/page.cjs +199 -0
- package/client/src/view/settings-tab.cjs +78 -0
- package/client/src/view/tabs.cjs +71 -0
- package/client/src/view/trial.cjs +84 -0
- package/docs/DETAIL.en.md +55 -6
- package/docs/DETAIL.md +63 -14
- package/locale/zh.json +1 -1
- package/package.json +2 -1
- package/python/GATEWAY_VERSION.json +37 -31
- package/python/feiyu_memgate/backends/_sqlfile.py +293 -0
- package/python/feiyu_memgate/backends/base.py +121 -6
- package/python/feiyu_memgate/backends/embedding.py +265 -178
- package/python/feiyu_memgate/backends/hybrid.py +330 -83
- package/python/feiyu_memgate/backends/inmemory.py +115 -24
- package/python/feiyu_memgate/backends/openviking.py +7 -10
- package/python/feiyu_memgate/backends/sqlite.py +129 -145
- package/python/feiyu_memgate/builtins.py +1 -0
- package/python/feiyu_memgate/cli.py +124 -20
- package/python/feiyu_memgate/client/block.py +4 -2
- package/python/feiyu_memgate/client/http.py +106 -19
- package/python/feiyu_memgate/client/local.py +4 -3
- package/python/feiyu_memgate/config.py +118 -24
- package/python/feiyu_memgate/core/limits.py +2 -1
- package/python/feiyu_memgate/core/pool.py +29 -2
- package/python/feiyu_memgate/core/recall.py +179 -10
- package/python/feiyu_memgate/core/redact.py +4 -2
- package/python/feiyu_memgate/core/stages.py +52 -9
- package/python/feiyu_memgate/core/tidy.py +2 -1
- package/python/feiyu_memgate/core/watch.py +3 -2
- package/python/feiyu_memgate/core/write.py +9 -3
- package/python/feiyu_memgate/forgetting/archive.py +38 -10
- package/python/feiyu_memgate/forgetting/engine.py +46 -10
- package/python/feiyu_memgate/forgetting/stage.py +4 -2
- package/python/feiyu_memgate/gateway/app.py +168 -272
- package/python/feiyu_memgate/gateway/fields.py +121 -0
- package/python/feiyu_memgate/gateway/policies.py +162 -0
- package/python/feiyu_memgate/gateway/server.py +12 -4
- package/python/feiyu_memgate/gateway/tokens.py +137 -0
- package/python/feiyu_memgate/gateway/validate.py +120 -0
- package/python/feiyu_memgate/identity.py +152 -0
- package/python/feiyu_memgate/model.py +170 -2
- package/python/feiyu_memgate/registry.py +6 -3
- package/python/feiyu_memgate/tools/crypto.py +5 -4
- package/python/feiyu_memgate/tools/evaluate.py +2 -1
- package/python/feiyu_memgate/tools/tenants.py +2 -0
- package/src/block.js +9 -3
- package/src/capture.js +98 -0
- package/src/catalogue.js +4 -4
- package/src/changelog.js +72 -0
- package/src/client.js +145 -10
- package/src/commands.js +112 -62
- package/src/config.js +139 -62
- package/src/followup.js +139 -0
- package/src/gateway.js +79 -4
- package/src/migrate.py +54 -9
- package/src/mirror.py +44 -7
- package/src/plugin.js +416 -412
- package/src/pool.js +298 -0
- package/src/recent.js +68 -0
- package/src/relevance.js +80 -0
- package/src/routes.js +320 -0
- package/src/setup.js +36 -36
- package/src/shared.js +77 -0
- package/src/tiers.js +4 -4
- package/src/time.js +27 -0
- package/src/tools.js +164 -0
|
@@ -0,0 +1,960 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
// GENERATED from src/config.js by scripts/sync-client.mjs: do not edit; change the settings there and run
|
|
4
|
+
// npm run sync-client. FIELDS is the settings field table of the page; INDEX is the same fields by their
|
|
5
|
+
// "group.key" name, each with its group added.
|
|
6
|
+
|
|
7
|
+
const FIELDS = [
|
|
8
|
+
{
|
|
9
|
+
"group": "modules",
|
|
10
|
+
"label": {
|
|
11
|
+
"en": "Features",
|
|
12
|
+
"zh": "功能"
|
|
13
|
+
},
|
|
14
|
+
"help": {
|
|
15
|
+
"en": "Each feature is switched on or off on its own; a switched-off feature leaves nothing behind in the host.",
|
|
16
|
+
"zh": "各项功能可单独开关;关闭的功能不会在宿主中留下任何内容。"
|
|
17
|
+
},
|
|
18
|
+
"fields": [
|
|
19
|
+
{
|
|
20
|
+
"key": "autoRecall",
|
|
21
|
+
"kind": "boolean",
|
|
22
|
+
"default": true,
|
|
23
|
+
"label": {
|
|
24
|
+
"en": "Automatic recall",
|
|
25
|
+
"zh": "自动召回"
|
|
26
|
+
},
|
|
27
|
+
"help": {
|
|
28
|
+
"en": "At the start of each user turn, look up related memories and add them after the user's message as background data.",
|
|
29
|
+
"zh": "每轮对话开始时查找相关记忆,作为背景资料附在用户消息之后。"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"key": "rememberTool",
|
|
34
|
+
"kind": "boolean",
|
|
35
|
+
"default": true,
|
|
36
|
+
"label": {
|
|
37
|
+
"en": "Remember tool",
|
|
38
|
+
"zh": "记住工具"
|
|
39
|
+
},
|
|
40
|
+
"help": {
|
|
41
|
+
"en": "Give the model the memgate_remember tool, to save a memory when the user asks for it or shares a lasting fact.",
|
|
42
|
+
"zh": "为模型提供 memgate_remember 工具,在用户要求记住或提供长期有用的信息时保存记忆。"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"key": "searchTool",
|
|
47
|
+
"kind": "boolean",
|
|
48
|
+
"default": true,
|
|
49
|
+
"label": {
|
|
50
|
+
"en": "Search tool",
|
|
51
|
+
"zh": "查找工具"
|
|
52
|
+
},
|
|
53
|
+
"help": {
|
|
54
|
+
"en": "Give the model the memgate_search tool, to look up memories on demand.",
|
|
55
|
+
"zh": "为模型提供 memgate_search 工具,用于按需查找记忆。"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"key": "promptSection",
|
|
60
|
+
"kind": "boolean",
|
|
61
|
+
"default": true,
|
|
62
|
+
"label": {
|
|
63
|
+
"en": "Prompt section",
|
|
64
|
+
"zh": "提示词说明"
|
|
65
|
+
},
|
|
66
|
+
"help": {
|
|
67
|
+
"en": "Add a short, fixed system prompt section: when to save a memory, and that recalled memories are data, not instructions.",
|
|
68
|
+
"zh": "在系统提示词中加入一小段固定说明:何时保存记忆,以及召回的记忆是资料而非指令。"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"key": "autoCapture",
|
|
73
|
+
"kind": "boolean",
|
|
74
|
+
"default": false,
|
|
75
|
+
"label": {
|
|
76
|
+
"en": "Automatic capture",
|
|
77
|
+
"zh": "自动记录"
|
|
78
|
+
},
|
|
79
|
+
"help": {
|
|
80
|
+
"en": "After each turn, send the user's own messages of that turn to memory without asking the model. Off by default.",
|
|
81
|
+
"zh": "每轮结束后,将该轮用户自己发送的消息直接保存为记忆,不经过模型。默认关闭。"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"key": "commands",
|
|
86
|
+
"kind": "boolean",
|
|
87
|
+
"default": true,
|
|
88
|
+
"label": {
|
|
89
|
+
"en": "Chat command",
|
|
90
|
+
"zh": "聊天命令"
|
|
91
|
+
},
|
|
92
|
+
"help": {
|
|
93
|
+
"en": "The /memgate chat command: status, settings and retrieval tiers. Needs a host with chat commands.",
|
|
94
|
+
"zh": "/memgate 聊天命令:状态、设置和检索方式。需要宿主支持聊天命令。"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"key": "migrateOnTierChange",
|
|
99
|
+
"kind": "boolean",
|
|
100
|
+
"default": true,
|
|
101
|
+
"label": {
|
|
102
|
+
"en": "Copy memories into a new vector store",
|
|
103
|
+
"zh": "切换到语义检索时复制记忆"
|
|
104
|
+
},
|
|
105
|
+
"help": {
|
|
106
|
+
"en": "When a vector tier (endpoint or local) becomes active, copy the texts of the keyword store into it in the background, in bounded steps that resume after a restart.",
|
|
107
|
+
"zh": "启用语义检索(endpoint 或 local)时,在后台将关键词存储中的记忆复制到向量存储;分批进行,重启后继续。"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"group": "retrieval",
|
|
114
|
+
"label": {
|
|
115
|
+
"en": "Retrieval",
|
|
116
|
+
"zh": "检索"
|
|
117
|
+
},
|
|
118
|
+
"help": {
|
|
119
|
+
"en": "How the bundled gateway finds memories. Each tier keeps its own store file: memories saved under one tier are not searched under another unless they were copied (see the features above), and switching back finds them again.",
|
|
120
|
+
"zh": "内置网关查找记忆的方式。每种方式使用各自的存储文件:在一种方式下保存的记忆,切换到另一种方式后不会被检索到,除非已复制过去(见上方的功能设置);切换回来后可再次检索到。"
|
|
121
|
+
},
|
|
122
|
+
"fields": [
|
|
123
|
+
{
|
|
124
|
+
"key": "tier",
|
|
125
|
+
"kind": "choice",
|
|
126
|
+
"default": "auto",
|
|
127
|
+
"options": [
|
|
128
|
+
{
|
|
129
|
+
"value": "auto",
|
|
130
|
+
"label": {
|
|
131
|
+
"en": "auto: local when the embedding add-on is ready, else keyword",
|
|
132
|
+
"zh": "auto:本地向量插件就绪时使用 local,否则使用 keyword"
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"value": "keyword",
|
|
137
|
+
"label": {
|
|
138
|
+
"en": "keyword: keyword (SQLite, no model)",
|
|
139
|
+
"zh": "keyword:关键词检索(SQLite,无需模型)"
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"value": "endpoint",
|
|
144
|
+
"label": {
|
|
145
|
+
"en": "endpoint: embeddings endpoint (OpenAI-compatible)",
|
|
146
|
+
"zh": "endpoint:向量接口(OpenAI 兼容)"
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"value": "local",
|
|
151
|
+
"label": {
|
|
152
|
+
"en": "local: local model (dsh-feiyu-memgate-embed add-on)",
|
|
153
|
+
"zh": "local:本地向量模型(dsh-feiyu-memgate-embed 插件)"
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
],
|
|
157
|
+
"label": {
|
|
158
|
+
"en": "Retrieval tier",
|
|
159
|
+
"zh": "检索方式"
|
|
160
|
+
},
|
|
161
|
+
"help": {
|
|
162
|
+
"en": "auto uses local while the dsh-feiyu-memgate-embed add-on has a model ready, and keyword otherwise.",
|
|
163
|
+
"zh": "auto:dsh-feiyu-memgate-embed 插件的模型就绪时使用 local,否则使用 keyword。"
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"key": "hybrid",
|
|
168
|
+
"kind": "boolean",
|
|
169
|
+
"default": false,
|
|
170
|
+
"label": {
|
|
171
|
+
"en": "Combine with keyword search (hybrid)",
|
|
172
|
+
"zh": "同时使用关键词检索(混合检索)"
|
|
173
|
+
},
|
|
174
|
+
"help": {
|
|
175
|
+
"en": "Applies to the vector tiers (endpoint, local, and auto while it resolves to local); under keyword it does nothing. Keyword and vector search are both asked and their results fused. It uses the same vector store file as the tier without it, plus a keyword index file next to it, so switching it on or off loses no memory.",
|
|
176
|
+
"zh": "适用于语义检索(endpoint、local,以及 auto 选择 local 时);在 keyword 下无效。同时进行关键词检索和语义检索,并合并结果。使用的向量存储文件与不开启时相同,另在其旁增加一个关键词索引文件,因此开启或关闭都不会丢失记忆。"
|
|
177
|
+
},
|
|
178
|
+
"needs": {
|
|
179
|
+
"key": "retrieval.tier",
|
|
180
|
+
"in": [
|
|
181
|
+
"auto",
|
|
182
|
+
"endpoint",
|
|
183
|
+
"local"
|
|
184
|
+
]
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"key": "url",
|
|
189
|
+
"kind": "string",
|
|
190
|
+
"default": "",
|
|
191
|
+
"format": "url",
|
|
192
|
+
"needs": {
|
|
193
|
+
"key": "retrieval.tier",
|
|
194
|
+
"in": [
|
|
195
|
+
"endpoint"
|
|
196
|
+
]
|
|
197
|
+
},
|
|
198
|
+
"label": {
|
|
199
|
+
"en": "Endpoint URL",
|
|
200
|
+
"zh": "向量接口地址"
|
|
201
|
+
},
|
|
202
|
+
"help": {
|
|
203
|
+
"en": "endpoint tier: base URL of an OpenAI-compatible embeddings API, for example http://127.0.0.1:11434/v1.",
|
|
204
|
+
"zh": "endpoint 方式:OpenAI 兼容向量接口的基础地址,例如 http://127.0.0.1:11434/v1。"
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"key": "model",
|
|
209
|
+
"kind": "string",
|
|
210
|
+
"default": "",
|
|
211
|
+
"needs": {
|
|
212
|
+
"key": "retrieval.tier",
|
|
213
|
+
"in": [
|
|
214
|
+
"endpoint"
|
|
215
|
+
]
|
|
216
|
+
},
|
|
217
|
+
"label": {
|
|
218
|
+
"en": "Endpoint model",
|
|
219
|
+
"zh": "向量模型"
|
|
220
|
+
},
|
|
221
|
+
"help": {
|
|
222
|
+
"en": "endpoint tier: the embeddings model name. A different model starts a new, empty store.",
|
|
223
|
+
"zh": "endpoint 方式:向量模型的名称。更换模型会使用新的空存储。"
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"key": "apiKey",
|
|
228
|
+
"kind": "string",
|
|
229
|
+
"default": "",
|
|
230
|
+
"secret": true,
|
|
231
|
+
"needs": {
|
|
232
|
+
"key": "retrieval.tier",
|
|
233
|
+
"in": [
|
|
234
|
+
"endpoint"
|
|
235
|
+
]
|
|
236
|
+
},
|
|
237
|
+
"label": {
|
|
238
|
+
"en": "Endpoint API key",
|
|
239
|
+
"zh": "向量接口密钥"
|
|
240
|
+
},
|
|
241
|
+
"help": {
|
|
242
|
+
"en": "endpoint tier: the API key of the embeddings endpoint, if it needs one. It is never shown again after saving.",
|
|
243
|
+
"zh": "endpoint 方式:向量接口的密钥(如需要)。保存后不再显示。"
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
]
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
"group": "gateway",
|
|
250
|
+
"label": {
|
|
251
|
+
"en": "Gateway",
|
|
252
|
+
"zh": "网关"
|
|
253
|
+
},
|
|
254
|
+
"help": {
|
|
255
|
+
"en": "Where memories are kept: the bundled gateway (managed) or a gateway you run yourself (external).",
|
|
256
|
+
"zh": "记忆的存放位置:插件内置的网关(managed),或自行运行的外部网关(external)。"
|
|
257
|
+
},
|
|
258
|
+
"fields": [
|
|
259
|
+
{
|
|
260
|
+
"key": "mode",
|
|
261
|
+
"kind": "choice",
|
|
262
|
+
"default": "managed",
|
|
263
|
+
"options": [
|
|
264
|
+
{
|
|
265
|
+
"value": "managed",
|
|
266
|
+
"label": {
|
|
267
|
+
"en": "managed: start the bundled gateway (needs Python 3.11 or newer)",
|
|
268
|
+
"zh": "managed:启动内置网关(需要 Python 3.11 或更高版本)"
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"value": "external",
|
|
273
|
+
"label": {
|
|
274
|
+
"en": "external: use a running gateway (see External gateway)",
|
|
275
|
+
"zh": "external:使用已在运行的网关(见“外部网关”)"
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
],
|
|
279
|
+
"label": {
|
|
280
|
+
"en": "Gateway mode",
|
|
281
|
+
"zh": "网关模式"
|
|
282
|
+
},
|
|
283
|
+
"help": {
|
|
284
|
+
"en": "managed starts the gateway that ships with the plugin; external talks to the address under External gateway.",
|
|
285
|
+
"zh": "managed 启动插件内置的网关;external 连接“外部网关”中填写的地址。"
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
"key": "python",
|
|
290
|
+
"kind": "string",
|
|
291
|
+
"default": "",
|
|
292
|
+
"needs": {
|
|
293
|
+
"key": "gateway.mode",
|
|
294
|
+
"in": [
|
|
295
|
+
"managed"
|
|
296
|
+
]
|
|
297
|
+
},
|
|
298
|
+
"label": {
|
|
299
|
+
"en": "Python interpreter",
|
|
300
|
+
"zh": "Python 解释器"
|
|
301
|
+
},
|
|
302
|
+
"help": {
|
|
303
|
+
"en": "managed: the Python to use (3.11 or newer). Empty: the desktop app's bundled Python, then python3, python and py -3.",
|
|
304
|
+
"zh": "managed:使用的 Python(3.11 或更高版本)。留空:依次使用桌面版内置的 Python、python3、python、py -3。"
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"key": "dataDir",
|
|
309
|
+
"kind": "string",
|
|
310
|
+
"default": "",
|
|
311
|
+
"needs": {
|
|
312
|
+
"key": "gateway.mode",
|
|
313
|
+
"in": [
|
|
314
|
+
"managed"
|
|
315
|
+
]
|
|
316
|
+
},
|
|
317
|
+
"label": {
|
|
318
|
+
"en": "Data folder",
|
|
319
|
+
"zh": "数据文件夹"
|
|
320
|
+
},
|
|
321
|
+
"help": {
|
|
322
|
+
"en": "managed: the folder for the memory stores, the generated gateway configuration and its log. Empty: data/feiyu-memgate in the DSH home folder.",
|
|
323
|
+
"zh": "managed:存放记忆存储、生成的网关配置和日志的文件夹。留空:DSH 主目录下的 data/feiyu-memgate。"
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
]
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"group": "external",
|
|
330
|
+
"label": {
|
|
331
|
+
"en": "External gateway",
|
|
332
|
+
"zh": "外部网关"
|
|
333
|
+
},
|
|
334
|
+
"help": {
|
|
335
|
+
"en": "Used only in external mode.",
|
|
336
|
+
"zh": "仅在 external 模式下使用。"
|
|
337
|
+
},
|
|
338
|
+
"fields": [
|
|
339
|
+
{
|
|
340
|
+
"key": "url",
|
|
341
|
+
"kind": "string",
|
|
342
|
+
"default": "",
|
|
343
|
+
"format": "url",
|
|
344
|
+
"needs": {
|
|
345
|
+
"key": "gateway.mode",
|
|
346
|
+
"in": [
|
|
347
|
+
"external"
|
|
348
|
+
]
|
|
349
|
+
},
|
|
350
|
+
"label": {
|
|
351
|
+
"en": "Gateway URL",
|
|
352
|
+
"zh": "网关地址"
|
|
353
|
+
},
|
|
354
|
+
"help": {
|
|
355
|
+
"en": "The gateway address, for example http://127.0.0.1:8080.",
|
|
356
|
+
"zh": "网关地址,例如 http://127.0.0.1:8080。"
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
"key": "token",
|
|
361
|
+
"kind": "string",
|
|
362
|
+
"default": "",
|
|
363
|
+
"secret": true,
|
|
364
|
+
"needs": {
|
|
365
|
+
"key": "gateway.mode",
|
|
366
|
+
"in": [
|
|
367
|
+
"external"
|
|
368
|
+
]
|
|
369
|
+
},
|
|
370
|
+
"label": {
|
|
371
|
+
"en": "Client token",
|
|
372
|
+
"zh": "客户端令牌"
|
|
373
|
+
},
|
|
374
|
+
"help": {
|
|
375
|
+
"en": "The client token that gateway issued for this client. It is never shown again after saving.",
|
|
376
|
+
"zh": "该网关为此客户端签发的令牌。保存后不再显示。"
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
]
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
"group": "advanced",
|
|
383
|
+
"label": {
|
|
384
|
+
"en": "Advanced",
|
|
385
|
+
"zh": "高级"
|
|
386
|
+
},
|
|
387
|
+
"help": {
|
|
388
|
+
"en": "Recall details and the rules of the bundled gateway (the rules apply to managed mode only; an external gateway follows its own configuration).",
|
|
389
|
+
"zh": "召回细节和内置网关的规则(规则仅用于 managed 模式;外部网关按其自身配置)。"
|
|
390
|
+
},
|
|
391
|
+
"fields": [
|
|
392
|
+
{
|
|
393
|
+
"key": "recallLimit",
|
|
394
|
+
"kind": "integer",
|
|
395
|
+
"default": 8,
|
|
396
|
+
"min": 1,
|
|
397
|
+
"max": 10,
|
|
398
|
+
"unit": {
|
|
399
|
+
"en": "memories",
|
|
400
|
+
"zh": "条"
|
|
401
|
+
},
|
|
402
|
+
"label": {
|
|
403
|
+
"en": "Memories per turn",
|
|
404
|
+
"zh": "每轮记忆条数"
|
|
405
|
+
},
|
|
406
|
+
"help": {
|
|
407
|
+
"en": "Most memories added per turn (1 to 10); also the default number of memgate_search results.",
|
|
408
|
+
"zh": "每轮最多加入的记忆条数(1 到 10),也是 memgate_search 默认返回的条数。"
|
|
409
|
+
}
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
"key": "recallTimeoutMs",
|
|
413
|
+
"kind": "integer",
|
|
414
|
+
"default": 4000,
|
|
415
|
+
"min": 500,
|
|
416
|
+
"max": 20000,
|
|
417
|
+
"unit": {
|
|
418
|
+
"en": "ms",
|
|
419
|
+
"zh": "毫秒"
|
|
420
|
+
},
|
|
421
|
+
"label": {
|
|
422
|
+
"en": "Recall time limit (ms)",
|
|
423
|
+
"zh": "召回等待上限(毫秒)"
|
|
424
|
+
},
|
|
425
|
+
"help": {
|
|
426
|
+
"en": "How long a turn waits for automatic recall (500 to 20000 ms). A slower lookup is skipped for that turn.",
|
|
427
|
+
"zh": "每轮等待自动召回的最长时间(500 到 20000 毫秒)。超时则该轮不加入记忆。"
|
|
428
|
+
}
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
"key": "language",
|
|
432
|
+
"kind": "choice",
|
|
433
|
+
"default": "auto",
|
|
434
|
+
"options": [
|
|
435
|
+
{
|
|
436
|
+
"value": "auto",
|
|
437
|
+
"label": {
|
|
438
|
+
"en": "auto: follow the system language",
|
|
439
|
+
"zh": "auto:跟随系统语言"
|
|
440
|
+
}
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
"value": "zh",
|
|
444
|
+
"label": {
|
|
445
|
+
"en": "zh: Chinese",
|
|
446
|
+
"zh": "zh:中文"
|
|
447
|
+
}
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
"value": "en",
|
|
451
|
+
"label": {
|
|
452
|
+
"en": "en: English",
|
|
453
|
+
"zh": "en:英文"
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
],
|
|
457
|
+
"label": {
|
|
458
|
+
"en": "Language",
|
|
459
|
+
"zh": "语言"
|
|
460
|
+
},
|
|
461
|
+
"help": {
|
|
462
|
+
"en": "Language of the memory block, the tool replies and the /memgate command.",
|
|
463
|
+
"zh": "记忆块、工具回复和 /memgate 命令使用的语言。"
|
|
464
|
+
}
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
"key": "skipRepeats",
|
|
468
|
+
"kind": "boolean",
|
|
469
|
+
"default": true,
|
|
470
|
+
"label": {
|
|
471
|
+
"en": "Skip repeated memories",
|
|
472
|
+
"zh": "不重复提供同一条记忆"
|
|
473
|
+
},
|
|
474
|
+
"help": {
|
|
475
|
+
"en": "Leave out a memory that an earlier memory block of this conversation still shows, compared by its text. If nothing new is left, no block is added. Off: only a block identical to the previous one is left out.",
|
|
476
|
+
"zh": "本对话中,之前的记忆块仍包含的记忆不再重复提供(按记忆的文字比较)。没有新记忆时不加入记忆块。关闭:仅当与上一个记忆块完全相同时才不加入。"
|
|
477
|
+
}
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
"key": "linkedRecall",
|
|
481
|
+
"kind": "boolean",
|
|
482
|
+
"default": true,
|
|
483
|
+
"label": {
|
|
484
|
+
"en": "Recall linked memories",
|
|
485
|
+
"zh": "召回相关联的记忆"
|
|
486
|
+
},
|
|
487
|
+
"help": {
|
|
488
|
+
"en": "With vector retrieval (the endpoint and local tiers, with or without retrieval.hybrid), after the usual lookup the gateway follows the first two memories it found to the memories closest to them and adds at most two, never beyond advanced.recallLimit. Under keyword retrieval it does nothing, and with advanced.profile set to precise it adds nothing.",
|
|
489
|
+
"zh": "使用语义检索时(endpoint 和 local 两档,是否开启 retrieval.hybrid 均适用),网关在常规检索之后,以找到的前两条记忆为起点查找与它们最接近的记忆,最多再加入两条,总数不超过 advanced.recallLimit。使用 keyword 检索时无效;advanced.profile 为 precise 时也不加入。"
|
|
490
|
+
}
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
"key": "showAge",
|
|
494
|
+
"kind": "boolean",
|
|
495
|
+
"default": true,
|
|
496
|
+
"label": {
|
|
497
|
+
"en": "Show today's date and each memory's age",
|
|
498
|
+
"zh": "显示今天的日期和每条记忆的时间"
|
|
499
|
+
},
|
|
500
|
+
"help": {
|
|
501
|
+
"en": "The memory block says today's date (the date on this computer) and how long ago each dated memory is, for example 3 weeks ago. Off: the block shows only the absolute dates.",
|
|
502
|
+
"zh": "记忆块中写明今天的日期(本机日期),以及每条带日期的记忆距今多久,例如“3 周前”。关闭:只写具体日期。"
|
|
503
|
+
}
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
"key": "failureNote",
|
|
507
|
+
"kind": "boolean",
|
|
508
|
+
"default": true,
|
|
509
|
+
"label": {
|
|
510
|
+
"en": "Tell the model when recall failed",
|
|
511
|
+
"zh": "召回失败时告诉模型"
|
|
512
|
+
},
|
|
513
|
+
"help": {
|
|
514
|
+
"en": "When the lookup of a turn times out, fails, or the bundled gateway is still starting, add one short note after the user message, so the model does not take it for \"no related memory\". Only on the first turn of a failure streak.",
|
|
515
|
+
"zh": "本轮检索超时、出错,或内置网关仍在启动时,在用户消息之后加一行说明,避免模型误认为“没有相关记忆”。连续失败时仅在第一轮加入。"
|
|
516
|
+
}
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
"key": "captureMinChars",
|
|
520
|
+
"kind": "integer",
|
|
521
|
+
"default": 4,
|
|
522
|
+
"min": 0,
|
|
523
|
+
"max": 50,
|
|
524
|
+
"unit": {
|
|
525
|
+
"en": "characters",
|
|
526
|
+
"zh": "字"
|
|
527
|
+
},
|
|
528
|
+
"needs": {
|
|
529
|
+
"key": "modules.autoCapture",
|
|
530
|
+
"in": [
|
|
531
|
+
true
|
|
532
|
+
]
|
|
533
|
+
},
|
|
534
|
+
"label": {
|
|
535
|
+
"en": "Automatic capture: shortest message",
|
|
536
|
+
"zh": "自动记录:最短消息长度"
|
|
537
|
+
},
|
|
538
|
+
"help": {
|
|
539
|
+
"en": "With automatic capture on, a message is not saved when it is a command, only filler, or has fewer meaningful characters than this (0 to 50; punctuation, spaces and emoji do not count). 0 turns the length check off.",
|
|
540
|
+
"zh": "开启自动记录后,命令、仅含语气词的消息,以及有意义的字数少于该值的消息不会保存(0 到 50;标点、空格和表情不计入字数)。0 表示不按字数过滤。"
|
|
541
|
+
}
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
"key": "blockTone",
|
|
545
|
+
"kind": "choice",
|
|
546
|
+
"default": "normal",
|
|
547
|
+
"options": [
|
|
548
|
+
{
|
|
549
|
+
"value": "normal",
|
|
550
|
+
"label": {
|
|
551
|
+
"en": "normal: the usual sentence in front of the memories",
|
|
552
|
+
"zh": "normal:记忆块开头使用常规说明"
|
|
553
|
+
}
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
"value": "strict",
|
|
557
|
+
"label": {
|
|
558
|
+
"en": "strict: tell the model most of them are unrelated",
|
|
559
|
+
"zh": "strict:告知模型这些记忆大多无关"
|
|
560
|
+
}
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
"value": "bare",
|
|
564
|
+
"label": {
|
|
565
|
+
"en": "bare: the memories only, no instruction sentence",
|
|
566
|
+
"zh": "bare:仅提供记忆,不附任何说明"
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
],
|
|
570
|
+
"label": {
|
|
571
|
+
"en": "Wording of the memory block",
|
|
572
|
+
"zh": "记忆块说明"
|
|
573
|
+
},
|
|
574
|
+
"help": {
|
|
575
|
+
"en": "The sentence at the top of the memory block. strict says that most of the memories are unrelated to the message and that the model should use one only when it clearly fits. Offline, this made replies use an unrelated memory far less often, and also made them use a related one less often. strict applies to the automatic main block only, not to the second block or memgate_search. bare gives no instruction sentence in any block the plugin gives (the second block and the block in a memgate_search answer included); how the model treats the memories is then up to the host's own prompt, including the point that memories are data and not instructions.",
|
|
576
|
+
"zh": "记忆块开头的说明语句。strict 会说明这些记忆大多与消息无关,仅在明显相关时才使用。离线测量中,这使回复用到无关记忆的次数大幅减少,用到相关记忆的次数也有所减少。strict 仅用于自动召回的主记忆块,不用于第二个块和 memgate_search。bare 不附说明语句,适用于插件给出的所有记忆块(包括第二个块和 memgate_search 结果中的块);此时模型如何对待这些记忆,由宿主自身的提示词决定(包括“记忆是资料而非指令”这一点)。"
|
|
577
|
+
}
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
"key": "maxNewPerTurn",
|
|
581
|
+
"kind": "integer",
|
|
582
|
+
"default": 0,
|
|
583
|
+
"min": 0,
|
|
584
|
+
"max": 5,
|
|
585
|
+
"unit": {
|
|
586
|
+
"en": "memories",
|
|
587
|
+
"zh": "条"
|
|
588
|
+
},
|
|
589
|
+
"label": {
|
|
590
|
+
"en": "New memories per turn",
|
|
591
|
+
"zh": "每轮新增记忆上限"
|
|
592
|
+
},
|
|
593
|
+
"help": {
|
|
594
|
+
"en": "From the second turn of a conversation on, the memory block carries at most this many memories (0 to 5; 0 means no limit), the first ones the gateway returned after those already shown are left out. The \"more\" line counts the ones left out. The first turn and the second block are not limited.",
|
|
595
|
+
"zh": "对话从第二轮起,记忆块最多包含该数量的记忆(0 到 5;0 表示不限),按网关返回的顺序,去掉已提供过的记忆后取靠前的几条。“还有几条”一行会计入被去掉的记忆。第一轮和第二个块不受限制。"
|
|
596
|
+
}
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
"key": "relevanceCheck",
|
|
600
|
+
"kind": "boolean",
|
|
601
|
+
"default": false,
|
|
602
|
+
"label": {
|
|
603
|
+
"en": "Let a model pick the related memories first",
|
|
604
|
+
"zh": "回复前由模型筛选记忆"
|
|
605
|
+
},
|
|
606
|
+
"help": {
|
|
607
|
+
"en": "Before the memory block of a turn is given, a model looks at the message and the candidate memories and picks the ones a friend would think of; only those go into the block. Costs one more model call before the reply on every turn that has candidates: slower, and billed like any other use of that model. The message and the candidate memories are sent to the provider of that model. If the call fails or is too slow, the block is given as if this were off. The second block is not checked, and neither is memgate_search. Needs modules.autoRecall.",
|
|
608
|
+
"zh": "本轮记忆块提供之前,由一个模型查看用户消息和候选记忆,挑出“了解用户的朋友会想到”的几条,仅这几条进入记忆块。每轮只要有候选记忆,回复前就多一次模型调用:速度更慢,并与该模型的其他用途一样计费。消息和候选记忆会发送给该模型的提供方。调用失败或过慢时,按未开启本项的方式提供记忆块。第二个块和 memgate_search 不做筛选。需要 modules.autoRecall。"
|
|
609
|
+
},
|
|
610
|
+
"experimental": true
|
|
611
|
+
},
|
|
612
|
+
{
|
|
613
|
+
"key": "relevanceProvider",
|
|
614
|
+
"kind": "string",
|
|
615
|
+
"default": "",
|
|
616
|
+
"needs": {
|
|
617
|
+
"key": "advanced.relevanceCheck",
|
|
618
|
+
"in": [
|
|
619
|
+
true
|
|
620
|
+
]
|
|
621
|
+
},
|
|
622
|
+
"label": {
|
|
623
|
+
"en": "Provider of the model that picks",
|
|
624
|
+
"zh": "筛选模型的提供方"
|
|
625
|
+
},
|
|
626
|
+
"help": {
|
|
627
|
+
"en": "Together with the model setting: names another provider and model for the check, for example a cheaper one. Both empty means the model of the conversation. Only one of the two set counts as both empty.",
|
|
628
|
+
"zh": "与“筛选模型”一起填写:为这一步指定另一个提供方和模型,例如费用更低的。两项都留空表示使用对话本身的模型。只填其中一项等同于两项都留空。"
|
|
629
|
+
}
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
"key": "relevanceModel",
|
|
633
|
+
"kind": "string",
|
|
634
|
+
"default": "",
|
|
635
|
+
"needs": {
|
|
636
|
+
"key": "advanced.relevanceCheck",
|
|
637
|
+
"in": [
|
|
638
|
+
true
|
|
639
|
+
]
|
|
640
|
+
},
|
|
641
|
+
"label": {
|
|
642
|
+
"en": "Model that picks",
|
|
643
|
+
"zh": "筛选模型"
|
|
644
|
+
},
|
|
645
|
+
"help": {
|
|
646
|
+
"en": "Together with the provider setting. Both empty means the model of the conversation.",
|
|
647
|
+
"zh": "与“筛选模型的提供方”一起填写。两项都留空表示使用对话本身的模型。"
|
|
648
|
+
}
|
|
649
|
+
},
|
|
650
|
+
{
|
|
651
|
+
"key": "relevanceTimeoutMs",
|
|
652
|
+
"kind": "integer",
|
|
653
|
+
"default": 3000,
|
|
654
|
+
"min": 500,
|
|
655
|
+
"max": 10000,
|
|
656
|
+
"unit": {
|
|
657
|
+
"en": "ms",
|
|
658
|
+
"zh": "毫秒"
|
|
659
|
+
},
|
|
660
|
+
"needs": {
|
|
661
|
+
"key": "advanced.relevanceCheck",
|
|
662
|
+
"in": [
|
|
663
|
+
true
|
|
664
|
+
]
|
|
665
|
+
},
|
|
666
|
+
"label": {
|
|
667
|
+
"en": "Time limit of the check (ms)",
|
|
668
|
+
"zh": "筛选时限(毫秒)"
|
|
669
|
+
},
|
|
670
|
+
"help": {
|
|
671
|
+
"en": "With the check on: how long the pick may take (500 to 10000 ms). A slower one is given up and the block is given as if the check were off.",
|
|
672
|
+
"zh": "开启筛选后:该步骤最长等待时间(500 到 10000 毫秒)。超时则放弃,按未开启筛选的方式提供记忆块。"
|
|
673
|
+
}
|
|
674
|
+
},
|
|
675
|
+
{
|
|
676
|
+
"key": "afterthought",
|
|
677
|
+
"kind": "boolean",
|
|
678
|
+
"default": false,
|
|
679
|
+
"label": {
|
|
680
|
+
"en": "Recall again after replying",
|
|
681
|
+
"zh": "回复后再次召回"
|
|
682
|
+
},
|
|
683
|
+
"help": {
|
|
684
|
+
"en": "Experimental. After each reply, look memories up once more in the background with the reply as the query, and give the ones this conversation has not had yet on the next turn, in a second block after the memory block. Costs one more lookup per turn; the added block makes the context longer, and it may hold memories unrelated to the new message. Under keyword retrieval the second lookup matches words of the reply. Needs modules.autoRecall.",
|
|
685
|
+
"zh": "实验性功能。每次回复之后,在后台以该回复为查询词再检索一次记忆,将本对话中尚未提供过的记忆,在下一轮放入记忆块之后的第二个块中。每轮多一次检索;多出的块会使上下文变长,其中可能包含与新消息无关的记忆。使用 keyword 检索时,第二次检索匹配的是回复中的词。需要 modules.autoRecall。"
|
|
686
|
+
},
|
|
687
|
+
"experimental": true
|
|
688
|
+
},
|
|
689
|
+
{
|
|
690
|
+
"key": "afterthoughtMax",
|
|
691
|
+
"kind": "integer",
|
|
692
|
+
"default": 2,
|
|
693
|
+
"min": 1,
|
|
694
|
+
"max": 5,
|
|
695
|
+
"unit": {
|
|
696
|
+
"en": "memories",
|
|
697
|
+
"zh": "条"
|
|
698
|
+
},
|
|
699
|
+
"needs": {
|
|
700
|
+
"key": "advanced.afterthought",
|
|
701
|
+
"in": [
|
|
702
|
+
true
|
|
703
|
+
]
|
|
704
|
+
},
|
|
705
|
+
"label": {
|
|
706
|
+
"en": "Memories a second lookup may add",
|
|
707
|
+
"zh": "回复后再次召回的条数上限"
|
|
708
|
+
},
|
|
709
|
+
"help": {
|
|
710
|
+
"en": "With advanced.afterthought on: the most memories one second lookup keeps for the next turn (1 to 5).",
|
|
711
|
+
"zh": "开启“回复后再次召回”后:一次再次检索最多留给下一轮的记忆条数(1 到 5)。"
|
|
712
|
+
}
|
|
713
|
+
},
|
|
714
|
+
{
|
|
715
|
+
"key": "conversationPool",
|
|
716
|
+
"kind": "boolean",
|
|
717
|
+
"default": false,
|
|
718
|
+
"label": {
|
|
719
|
+
"en": "Conversation pool",
|
|
720
|
+
"zh": "对话池"
|
|
721
|
+
},
|
|
722
|
+
"help": {
|
|
723
|
+
"en": "Experimental. Remember in memory what this conversation was given. When the host has compacted the history and those memory blocks are gone, give the few that were still in play once more, in a second block after the memory block. A memory stays in play for about five turns after it was given, longer when your messages or the replies of the model keep using it. The block makes the context longer and may hold memories unrelated to the new message. Nothing is written to disk. Needs modules.autoRecall.",
|
|
724
|
+
"zh": "实验性功能。在内存中记录本对话提供过哪些记忆。宿主压缩历史、原有记忆块消失后,将仍在讨论中的几条再提供一次,放在记忆块之后的第二个块中。一条记忆提供后约五轮内视为仍在讨论中,若你的消息或模型的回复持续用到它,则时间更长。多出的块会使上下文变长,其中可能包含与新消息无关的记忆。不写入磁盘。需要 modules.autoRecall。"
|
|
725
|
+
},
|
|
726
|
+
"experimental": true
|
|
727
|
+
},
|
|
728
|
+
{
|
|
729
|
+
"key": "poolSize",
|
|
730
|
+
"kind": "integer",
|
|
731
|
+
"default": 3,
|
|
732
|
+
"min": 1,
|
|
733
|
+
"max": 5,
|
|
734
|
+
"unit": {
|
|
735
|
+
"en": "memories",
|
|
736
|
+
"zh": "条"
|
|
737
|
+
},
|
|
738
|
+
"needs": {
|
|
739
|
+
"key": "advanced.conversationPool",
|
|
740
|
+
"in": [
|
|
741
|
+
true
|
|
742
|
+
]
|
|
743
|
+
},
|
|
744
|
+
"label": {
|
|
745
|
+
"en": "Memories the pool brings back",
|
|
746
|
+
"zh": "对话池每次带回的条数"
|
|
747
|
+
},
|
|
748
|
+
"help": {
|
|
749
|
+
"en": "With advanced.conversationPool on: the most memories the pool brings back in one turn (1 to 5).",
|
|
750
|
+
"zh": "开启“对话池”后:每轮最多带回的记忆条数(1 到 5)。"
|
|
751
|
+
}
|
|
752
|
+
},
|
|
753
|
+
{
|
|
754
|
+
"key": "recentPool",
|
|
755
|
+
"kind": "boolean",
|
|
756
|
+
"default": false,
|
|
757
|
+
"label": {
|
|
758
|
+
"en": "Recent pool",
|
|
759
|
+
"zh": "近期池"
|
|
760
|
+
},
|
|
761
|
+
"help": {
|
|
762
|
+
"en": "Experimental. When a new conversation starts, give once, at its first turn, the memories the previous conversation was still using, in a second block after the memory block. To do that a small file (recent-pool.json) with those memories is kept in the data folder. Switching this off deletes the file. The block makes the context longer and may hold memories unrelated to the new message. Needs modules.autoRecall.",
|
|
763
|
+
"zh": "实验性功能。新对话开始时,在其第一轮提供一次上一个对话仍在使用的记忆,放在记忆块之后的第二个块中。为此会在数据文件夹中保存一个小文件(recent-pool.json),内含这几条记忆。关闭本项会删除该文件。多出的块会使上下文变长,其中可能包含与新消息无关的记忆。需要 modules.autoRecall。"
|
|
764
|
+
},
|
|
765
|
+
"experimental": true
|
|
766
|
+
},
|
|
767
|
+
{
|
|
768
|
+
"key": "recentSize",
|
|
769
|
+
"kind": "integer",
|
|
770
|
+
"default": 3,
|
|
771
|
+
"min": 1,
|
|
772
|
+
"max": 5,
|
|
773
|
+
"unit": {
|
|
774
|
+
"en": "memories",
|
|
775
|
+
"zh": "条"
|
|
776
|
+
},
|
|
777
|
+
"needs": {
|
|
778
|
+
"key": "advanced.recentPool",
|
|
779
|
+
"in": [
|
|
780
|
+
true
|
|
781
|
+
]
|
|
782
|
+
},
|
|
783
|
+
"label": {
|
|
784
|
+
"en": "Memories the recent pool carries",
|
|
785
|
+
"zh": "近期池每次带入的条数"
|
|
786
|
+
},
|
|
787
|
+
"help": {
|
|
788
|
+
"en": "With advanced.recentPool on: the most memories carried into a new conversation (1 to 5).",
|
|
789
|
+
"zh": "开启“近期池”后:带入新对话的记忆最多条数(1 到 5)。"
|
|
790
|
+
}
|
|
791
|
+
},
|
|
792
|
+
{
|
|
793
|
+
"key": "recentDays",
|
|
794
|
+
"kind": "integer",
|
|
795
|
+
"default": 7,
|
|
796
|
+
"min": 1,
|
|
797
|
+
"max": 30,
|
|
798
|
+
"unit": {
|
|
799
|
+
"en": "days",
|
|
800
|
+
"zh": "天"
|
|
801
|
+
},
|
|
802
|
+
"needs": {
|
|
803
|
+
"key": "advanced.recentPool",
|
|
804
|
+
"in": [
|
|
805
|
+
true
|
|
806
|
+
]
|
|
807
|
+
},
|
|
808
|
+
"label": {
|
|
809
|
+
"en": "Days the recent pool is kept",
|
|
810
|
+
"zh": "近期池保留天数"
|
|
811
|
+
},
|
|
812
|
+
"help": {
|
|
813
|
+
"en": "With advanced.recentPool on: a saved conversation older than this many days is not carried into a new one (1 to 30).",
|
|
814
|
+
"zh": "开启“近期池”后:保存的对话超过该天数,就不再带入新对话(1 到 30)。"
|
|
815
|
+
}
|
|
816
|
+
},
|
|
817
|
+
{
|
|
818
|
+
"key": "profile",
|
|
819
|
+
"kind": "choice",
|
|
820
|
+
"default": "broad",
|
|
821
|
+
"options": [
|
|
822
|
+
{
|
|
823
|
+
"value": "broad",
|
|
824
|
+
"label": {
|
|
825
|
+
"en": "broad: more memories per turn, misses less, more noise",
|
|
826
|
+
"zh": "broad:每轮条数较多,遗漏少,噪声多"
|
|
827
|
+
}
|
|
828
|
+
},
|
|
829
|
+
{
|
|
830
|
+
"value": "precise",
|
|
831
|
+
"label": {
|
|
832
|
+
"en": "precise: about one memory per turn, closer matches, misses more",
|
|
833
|
+
"zh": "precise:每轮约一条,更贴题,遗漏较多"
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
],
|
|
837
|
+
"label": {
|
|
838
|
+
"en": "Recall profile",
|
|
839
|
+
"zh": "召回档位"
|
|
840
|
+
},
|
|
841
|
+
"help": {
|
|
842
|
+
"en": "How strict the gateway is about what counts as related. The memory block stays in the conversation, so broad makes the context grow faster.",
|
|
843
|
+
"zh": "网关判断“相关”的严格程度。记忆块会保留在对话中,broad 会使上下文增长更快。"
|
|
844
|
+
}
|
|
845
|
+
},
|
|
846
|
+
{
|
|
847
|
+
"key": "dailyWrites",
|
|
848
|
+
"kind": "integer",
|
|
849
|
+
"default": 50,
|
|
850
|
+
"min": 0,
|
|
851
|
+
"max": 100000,
|
|
852
|
+
"unit": {
|
|
853
|
+
"en": "per day",
|
|
854
|
+
"zh": "条/天"
|
|
855
|
+
},
|
|
856
|
+
"needs": {
|
|
857
|
+
"key": "gateway.mode",
|
|
858
|
+
"in": [
|
|
859
|
+
"managed"
|
|
860
|
+
]
|
|
861
|
+
},
|
|
862
|
+
"label": {
|
|
863
|
+
"en": "Daily write cap",
|
|
864
|
+
"zh": "每日写入上限"
|
|
865
|
+
},
|
|
866
|
+
"help": {
|
|
867
|
+
"en": "Most memories the gateway accepts per day; 0 means no cap. The count starts again whenever the gateway restarts.",
|
|
868
|
+
"zh": "网关每天最多接收的记忆条数;0 表示不限。网关重启后重新计数。"
|
|
869
|
+
}
|
|
870
|
+
},
|
|
871
|
+
{
|
|
872
|
+
"key": "redaction",
|
|
873
|
+
"kind": "boolean",
|
|
874
|
+
"default": true,
|
|
875
|
+
"label": {
|
|
876
|
+
"en": "Redact secrets",
|
|
877
|
+
"zh": "屏蔽敏感信息"
|
|
878
|
+
},
|
|
879
|
+
"help": {
|
|
880
|
+
"en": "Remove secrets such as keys, tokens and passwords from memories when they are saved and when they are recalled.",
|
|
881
|
+
"zh": "保存和召回记忆时,清除其中的密钥、令牌、密码等敏感信息。"
|
|
882
|
+
},
|
|
883
|
+
"needs": {
|
|
884
|
+
"key": "gateway.mode",
|
|
885
|
+
"in": [
|
|
886
|
+
"managed"
|
|
887
|
+
]
|
|
888
|
+
}
|
|
889
|
+
},
|
|
890
|
+
{
|
|
891
|
+
"key": "newerFirst",
|
|
892
|
+
"kind": "boolean",
|
|
893
|
+
"default": true,
|
|
894
|
+
"label": {
|
|
895
|
+
"en": "Newer first",
|
|
896
|
+
"zh": "较新的优先"
|
|
897
|
+
},
|
|
898
|
+
"help": {
|
|
899
|
+
"en": "Among nearly equal matches, put newer memories first.",
|
|
900
|
+
"zh": "相关度相近时,较新的记忆排在前面。"
|
|
901
|
+
},
|
|
902
|
+
"needs": {
|
|
903
|
+
"key": "gateway.mode",
|
|
904
|
+
"in": [
|
|
905
|
+
"managed"
|
|
906
|
+
]
|
|
907
|
+
}
|
|
908
|
+
},
|
|
909
|
+
{
|
|
910
|
+
"key": "forgetting",
|
|
911
|
+
"kind": "boolean",
|
|
912
|
+
"default": false,
|
|
913
|
+
"label": {
|
|
914
|
+
"en": "Forgetting curve",
|
|
915
|
+
"zh": "遗忘曲线"
|
|
916
|
+
},
|
|
917
|
+
"help": {
|
|
918
|
+
"en": "Memories unused for a long time rank lower and are eventually archived and removed (at most a few per day). Archived memories stay in the data folder for 90 days.",
|
|
919
|
+
"zh": "长期未被使用的记忆排名靠后,最终会被存档并删除(每天最多几条)。存档的记忆在数据文件夹中保留 90 天。"
|
|
920
|
+
},
|
|
921
|
+
"needs": {
|
|
922
|
+
"key": "gateway.mode",
|
|
923
|
+
"in": [
|
|
924
|
+
"managed"
|
|
925
|
+
]
|
|
926
|
+
}
|
|
927
|
+
},
|
|
928
|
+
{
|
|
929
|
+
"key": "speakerAccount",
|
|
930
|
+
"kind": "string",
|
|
931
|
+
"default": "dsh:local",
|
|
932
|
+
"label": {
|
|
933
|
+
"en": "Speaker account",
|
|
934
|
+
"zh": "说话人账号"
|
|
935
|
+
},
|
|
936
|
+
"help": {
|
|
937
|
+
"en": "The account the plugin reports to the gateway with every write and recall, written dsh:name (lower-case letters, digits and _ . -). The bundled gateway maps it to the owner. With an external gateway that other programs share, list this account in the gateway's table of people.",
|
|
938
|
+
"zh": "插件每次写入和召回时向网关报告的账号,写成 dsh:名字(小写字母、数字和 _ . -)。内置网关把它对应到所有者。使用外部网关并与别的程序共用时,把这个账号写进网关的对照表。"
|
|
939
|
+
}
|
|
940
|
+
},
|
|
941
|
+
{
|
|
942
|
+
"key": "toolFields",
|
|
943
|
+
"kind": "boolean",
|
|
944
|
+
"default": false,
|
|
945
|
+
"label": {
|
|
946
|
+
"en": "Kind and event date on the memory tool",
|
|
947
|
+
"zh": "记忆工具可填写类型和日期"
|
|
948
|
+
},
|
|
949
|
+
"help": {
|
|
950
|
+
"en": "When on, the memgate_remember tool takes two more optional arguments, the kind of the memory (identity, preference, event, plan, entity) and the date of the event, filled in by the model and stored with the memory. When off, the tool's arguments are exactly as before.",
|
|
951
|
+
"zh": "开启后,memgate_remember 工具多两个可选参数:记忆的类型(身份、偏好、事件、计划、实体)和事情发生的日期,由模型填写,和记忆一起保存。关闭时工具的参数和以前完全一样。"
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
]
|
|
955
|
+
}
|
|
956
|
+
]
|
|
957
|
+
const INDEX = {}
|
|
958
|
+
for (const group of FIELDS) for (const field of group.fields) INDEX[group.group + '.' + field.key] = Object.assign({ group: group.group }, field)
|
|
959
|
+
|
|
960
|
+
module.exports = { FIELDS, INDEX }
|