-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathconfig.toml.example
More file actions
1961 lines (1871 loc) · 124 KB
/
Copy pathconfig.toml.example
File metadata and controls
1961 lines (1871 loc) · 124 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# zh: 机器人小号配置。
# en: Bot account settings.
[core]
# zh: 机器人QQ号。
# en: Bot QQ number.
bot_qq = 0
# zh: 超级管理员QQ号(唯一,可添加其他管理员)。
# en: Superadmin QQ number (unique).
superadmin_qq = 0
# zh: 初始管理员QQ号列表(逗号分隔,可选)。
# en: Initial admin QQ list (comma-separated, optional).
admin_qq = []
# zh: 音频转发代理QQ号(用于群聊音频转发,可选)。
# en: Audio forward proxy QQ number (for group audio forwarding, optional).
forward_proxy_qq = 0
# zh: 是否处理每条群消息。关闭后仅处理 @机器人、私聊和拍一拍(推荐默认开启)。
# en: Process every group message. If disabled, only @mentions, private chats, and pokes are handled (recommended: enabled).
process_every_message = true
# zh: 是否处理私聊消息。关闭后将只记录私聊历史,不触发 AI 回复。
# en: Process private messages. If disabled, private chat history is still recorded but AI replies are skipped.
process_private_message = true
# zh: 是否响应拍一拍。关闭后拍一拍事件将被忽略。
# en: Respond to poke events. If disabled, poke events are ignored.
process_poke_message = true
# zh: 注入给模型的最近历史消息条数(0 表示不注入;无固定上限,受 max_records 与存储约束)。
# en: Recent messages injected as model context (0 disables; no fixed cap; bounded by max_records/storage).
context_recent_messages_limit = 20
# zh: 单次 LLM 请求失败时最大静默重试次数(0=不重试,默认2)。失败的请求会回到原队列的第 2 个位置。
# en: Max silent retries for a single failed LLM request (0=no retry, default 2). Failed requests are reinserted at position 2 of their original queue lane.
ai_request_max_retries = 2
# zh: 模型返回纯文本但未调用 send_message/end 等工具时的最大纠正重试次数(0=不重试,默认3)。
# en: Max correction retries when the model returns plain text without tool calls (0=no retry, default 3).
missing_tool_call_retries = 3
# zh: 访问控制。mode 可选:off(不启用)/ blacklist(按黑名单)/ allowlist(按白名单)。
# en: Access control. mode options: off (disabled) / blacklist / allowlist.
[access]
# zh: 访问控制模式:off / blacklist / allowlist。
# en: Access control mode: off / blacklist / allowlist.
mode = "off"
# zh: 允许处理/发送的群号白名单(留空 = 不限制)。
# en: Allowed group IDs. Empty = no restriction.
allowed_group_ids = []
# zh: 禁止处理/发送的群号黑名单(优先级高于 allowed_group_ids)。
# en: Blocked group IDs. Higher priority than allowed_group_ids.
blocked_group_ids = []
# zh: 允许处理/发送的私聊 QQ 白名单(留空 = 不限制)。
# en: Allowed private-chat user IDs. Empty = no restriction.
allowed_private_ids = []
# zh: 禁止处理/发送的私聊 QQ 黑名单(blacklist 模式生效)。
# en: Blocked private-chat user IDs (effective in blacklist mode).
blocked_private_ids = []
# zh: 超级管理员是否可在私聊中绕过 "allowed_private_ids"(仅影响私聊收发;群聊仍严格按 "allowed_group_ids")。
# en: Allow superadmin to bypass "allowed_private_ids" for private chats only.
superadmin_bypass_allowlist = true
# zh: 超级管理员是否可在私聊中绕过 "blocked_private_ids"(仅影响私聊收发)。
# en: Allow superadmin to bypass "blocked_private_ids" for private chats only.
superadmin_bypass_private_blacklist = false
# zh: OneBot WebSocket 配置。
# en: OneBot WebSocket settings.
[onebot]
# zh: NapCat WebSocket地址。
# en: NapCat WebSocket URL.
ws_url = "ws://127.0.0.1:3001"
# zh: Access Token(可选)。
# en: Access token (optional).
token = ""
# zh: 本地文件发送方式:local(共享路径,默认,兼容旧部署)/ url(Runtime 临时链接)/ stream(NapCat Stream API)。支持热更新。
# en: Local file transport: local (shared paths, default for compatibility), url (temporary Runtime links), or stream (NapCat Stream API). Hot reload supported.
file_send_mode = "local"
# zh: 仅 URL 模式使用:OneBot 可访问的 Runtime 主机地址,支持 IPv4、IPv6 或域名,不包含协议、端口或路径;端口使用 Runtime 实际监听端口。
# en: URL mode only: Runtime host reachable by OneBot, as IPv4, IPv6 or a domain without scheme, port or path. Uses the actual Runtime listening port.
file_send_host = "127.0.0.1"
[models]
# zh: 对话模型配置(主模型,处理每一条消息)。
# en: Chat model config (the main model, processing each message).
[models.chat]
# zh: 是否让该模型请求使用 [proxy] 代理地址。默认关闭;模型池条目需在 entry 内单独配置。
# en: Whether this model uses proxy addresses from [proxy]. Disabled by default; pool entries configure this per entry.
use_proxy = false
# zh: Provider 基址;OpenAI 兼容接口通常为 .../v1,Anthropic 原生接口可写站点根地址或 .../v1。
# en: Provider base URL; OpenAI-compatible APIs usually use .../v1, while native Anthropic accepts the site root or .../v1.
api_url = ""
# zh: Chat 模型 API Key。
# en: Chat model API key.
api_key = ""
# zh: Chat 模型名称。
# en: Chat model name.
model_name = ""
# zh: 最大生成 tokens;OpenAI 模式下非正数会省略上限,Anthropic Messages 要求为正整数。
# en: Max generation tokens; non-positive values omit the limit in OpenAI modes, while Anthropic Messages requires a positive integer.
max_tokens = 8192
# zh: 模型上下文窗口上限(token),用于 /summary 分块与 Prompt 预算;须与上游模型能力一致。
# en: Model context window cap (tokens) for /summary chunking and prompt budgeting; must match upstream capability.
context_window_tokens = 32768
# zh: 队列发车间隔(秒;<=0 事件驱动立即发车且空闲不扫描,>0 按间隔扫描)。
# en: Queue interval (seconds; <=0 dispatches on arrival without idle polling; >0 polls periodically).
queue_interval_seconds = 1.0
# zh: API 模式:openai.chat_completions、openai.responses 或 anthropic.messages;旧无前缀值仍兼容但已弃用。
# en: API mode: openai.chat_completions, openai.responses, or anthropic.messages. Legacy unprefixed values remain compatible but are deprecated.
api_mode = "openai.chat_completions"
# zh: 是否启用 reasoning.effort。
# en: Enable reasoning.effort.
reasoning_enabled = false
# zh: 自定义 reasoning effort;值为 adaptive 时原样发送 adaptive,其余值也原样透传。
# en: Custom reasoning effort; adaptive is sent as adaptive and every other value is passed through unchanged.
reasoning_effort = "medium"
# zh: 是否发送由 thinking_enabled 自动生成的顶层 thinking 参数;调用方显式 thinking 不受影响。
# en: Send the top-level thinking parameter generated by thinking_enabled; explicit caller overrides are unaffected.
thinking_param_enabled = true
# zh: 是否启用 thinking(思维链)。
# en: Enable thinking (reasoning).
thinking_enabled = false
# zh: thinking 预算 tokens。
# en: Thinking-budget tokens.
thinking_budget_tokens = 20000
# zh: 是否发送手动 thinking 预算;anthropic.messages 下关闭时使用 adaptive thinking。
# en: Send a manual thinking budget; in anthropic.messages mode, disabling this selects adaptive thinking.
thinking_include_budget = true
# zh: 思维链工具调用兼容:在本地历史保留可读 reasoning_content;是否向上游回传由 reasoning_content_replay 控制。
# en: Thinking tool-call compatibility: retain readable reasoning_content locally; reasoning_content_replay controls upstream replay.
thinking_tool_call_compat = true
# zh: 是否原样回传推理结构(Chat 兼容字段、Responses reasoning items/encrypted_content、Anthropic thinking/redacted blocks)。默认开启。
# en: Replay native reasoning structures (Chat compatibility fields, Responses reasoning items/encrypted_content, Anthropic thinking/redacted blocks). Enabled by default.
reasoning_content_replay = true
# zh: 是否将所有 system 提示词合并注入第一条 user 消息(仅 openai.chat_completions)。默认关闭。
# en: Merge all system prompts into the first user message (openai.chat_completions only). Disabled by default.
system_prompt_as_user = false
# zh: Responses API 的 tool_choice 兼容模式:仅在关闭时请求仍返回 500、怀疑上游不兼容对象型 tool_choice 时再尝试开启;开启后上报为 "required" 并只保留目标工具。当前已在 new-api v0.11.4-alpha.3 发现该问题。默认关闭。
# en: Responses API tool_choice compatibility mode: only try enabling this when requests still return 500 with the default setting and you suspect the upstream does not support object-style tool_choice; it sends "required" and keeps only the selected tool. This issue is currently observed on new-api v0.11.4-alpha.3. Disabled by default.
responses_tool_choice_compat = false
# zh: Responses API 续轮强制降级:启用后,多轮工具调用将始终跳过 previous_response_id,直接使用完整消息重放(stateless replay)。仅在上游不兼容 responses 状态续轮时使用。默认关闭。
# en: Responses API force stateless replay: when enabled, multi-turn tool follow-ups always skip previous_response_id and replay the full message history instead. Use only when the upstream does not handle stateful responses follow-ups correctly. Disabled by default.
responses_force_stateless_replay = false
# zh: OpenAI 模式下是否自动生成 prompt_cache_key;Anthropic 模式请通过 request_params.cache_control 配置缓存。
# en: Generate prompt_cache_key in OpenAI modes; use request_params.cache_control for Anthropic caching.
prompt_cache_enabled = true
# zh: 是否对上游模型 API 启用流式请求。
# en: Enable streaming requests to the upstream model API.
stream_enabled = false
# zh: 额外请求体参数(可选),可用于 temperature 或供应商私有参数。
# en: Extra request-body params (optional), e.g. temperature or vendor-specific fields.
[models.chat.request_params]
# zh: 模型池配置(可选,支持多模型轮询/随机/用户指定)。
# en: Model pool configuration (optional, supports round-robin/random/user-specified).
[models.chat.pool]
# zh: 是否启用模型池。
# en: Enable model pool.
enabled = false
# zh: 分配策略:default(用户指定)/ round_robin(轮询)/ random(随机)。
# en: Strategy: default (user-specified) / round_robin / random.
strategy = "default"
# zh: 模型池列表(每项需填 model_name、api_url、api_key;可选 use_proxy,默认 false;其余字段可选,缺省继承主模型)。
# en: Model pool entries (model_name, api_url, api_key required; optional use_proxy defaults to false; other fields inherit from primary).
models = []
# zh: 视觉模型配置(用于图片描述和 OCR)。
# en: Vision model config (image description and OCR).
[models.vision]
# zh: 是否让该模型请求使用 [proxy] 代理地址。默认关闭。
# en: Whether this model uses proxy addresses from [proxy]. Disabled by default.
use_proxy = false
# zh: Provider 基址;OpenAI 兼容接口通常为 .../v1,Anthropic 原生接口可写站点根地址或 .../v1。
# en: Provider base URL; OpenAI-compatible APIs usually use .../v1, while native Anthropic accepts the site root or .../v1.
api_url = ""
# zh: Vision 模型 API Key。
# en: Vision model API key.
api_key = ""
# zh: Vision 模型名称。
# en: Vision model name.
model_name = ""
# zh: Vision 模型最大输出 tokens;OpenAI 模式下非正数会省略上限,Anthropic Messages 要求为正整数。启用 thinking 时需留足思维链和工具调用余量。
# en: Vision model max output tokens; non-positive values omit the limit in OpenAI modes, while Anthropic Messages requires a positive integer. Leave room for reasoning and tool calls when thinking is enabled.
max_tokens = 8192
# zh: 模型上下文窗口上限(token),用于 /summary 分块与 Prompt 预算;须与上游模型能力一致。
# en: Model context window cap (tokens) for /summary chunking and prompt budgeting; must match upstream capability.
context_window_tokens = 32768
# zh: 队列发车间隔(秒;<=0 事件驱动立即发车且空闲不扫描,>0 按间隔扫描)。
# en: Queue interval (seconds; <=0 dispatches on arrival without idle polling; >0 polls periodically).
queue_interval_seconds = 1.0
# zh: API 模式:openai.chat_completions、openai.responses 或 anthropic.messages;旧无前缀值仍兼容但已弃用。
# en: API mode: openai.chat_completions, openai.responses, or anthropic.messages. Legacy unprefixed values remain compatible but are deprecated.
api_mode = "openai.chat_completions"
# zh: 是否启用 reasoning.effort。
# en: Enable reasoning.effort.
reasoning_enabled = false
# zh: 自定义 reasoning effort;值为 adaptive 时原样发送 adaptive,其余值也原样透传。
# en: Custom reasoning effort; adaptive is sent as adaptive and every other value is passed through unchanged.
reasoning_effort = "medium"
# zh: 是否发送由 thinking_enabled 自动生成的顶层 thinking 参数;调用方显式 thinking 不受影响。
# en: Send the top-level thinking parameter generated by thinking_enabled; explicit caller overrides are unaffected.
thinking_param_enabled = true
# zh: 是否启用 thinking(思维链)。
# en: Enable thinking (reasoning).
thinking_enabled = false
# zh: thinking 预算 tokens。
# en: Thinking-budget tokens.
thinking_budget_tokens = 20000
# zh: 是否发送手动 thinking 预算;anthropic.messages 下关闭时使用 adaptive thinking。
# en: Send a manual thinking budget; in anthropic.messages mode, disabling this selects adaptive thinking.
thinking_include_budget = true
# zh: 思维链工具调用兼容:在本地历史保留可读 reasoning_content;是否向上游回传由 reasoning_content_replay 控制。
# en: Thinking tool-call compatibility: retain readable reasoning_content locally; reasoning_content_replay controls upstream replay.
thinking_tool_call_compat = true
# zh: 是否原样回传推理结构(Chat 兼容字段、Responses reasoning items/encrypted_content、Anthropic thinking/redacted blocks)。默认开启。
# en: Replay native reasoning structures (Chat compatibility fields, Responses reasoning items/encrypted_content, Anthropic thinking/redacted blocks). Enabled by default.
reasoning_content_replay = true
# zh: 是否将所有 system 提示词合并注入第一条 user 消息(仅 openai.chat_completions)。默认关闭。
# en: Merge all system prompts into the first user message (openai.chat_completions only). Disabled by default.
system_prompt_as_user = false
# zh: Responses API 的 tool_choice 兼容模式:仅在关闭时请求仍返回 500、怀疑上游不兼容对象型 tool_choice 时再尝试开启;开启后上报为 "required" 并只保留目标工具。当前已在 new-api v0.11.4-alpha.3 发现该问题。默认关闭。
# en: Responses API tool_choice compatibility mode: only try enabling this when requests still return 500 with the default setting and you suspect the upstream does not support object-style tool_choice; it sends "required" and keeps only the selected tool. This issue is currently observed on new-api v0.11.4-alpha.3. Disabled by default.
responses_tool_choice_compat = false
# zh: Responses API 续轮强制降级:启用后,多轮工具调用将始终跳过 previous_response_id,直接使用完整消息重放(stateless replay)。仅在上游不兼容 responses 状态续轮时使用。默认关闭。
# en: Responses API force stateless replay: when enabled, multi-turn tool follow-ups always skip previous_response_id and replay the full message history instead. Use only when the upstream does not handle stateful responses follow-ups correctly. Disabled by default.
responses_force_stateless_replay = false
# zh: OpenAI 模式下是否自动生成 prompt_cache_key;Anthropic 模式请通过 request_params.cache_control 配置缓存。
# en: Generate prompt_cache_key in OpenAI modes; use request_params.cache_control for Anthropic caching.
prompt_cache_enabled = true
# zh: 是否对上游模型 API 启用流式请求。
# en: Enable streaming requests to the upstream model API.
stream_enabled = false
# zh: 额外请求体参数(可选),可用于 temperature 或供应商私有参数。
# en: Extra request-body params (optional), e.g. temperature or vendor-specific fields.
[models.vision.request_params]
# zh: 安全模型配置(用于防注入检测和注入后回复生成)。
# en: Security model config (injection detection and post-injection responses).
[models.security]
# zh: 是否启用安全模型检测与注入响应(推荐开启)。
# en: Enable security-model detection and injection response (recommended).
enabled = true
# zh: 是否让该模型请求使用 [proxy] 代理地址。默认关闭。
# en: Whether this model uses proxy addresses from [proxy]. Disabled by default.
use_proxy = false
# zh: Provider 基址;OpenAI 兼容接口通常为 .../v1,Anthropic 原生接口可写站点根地址或 .../v1。
# en: Provider base URL; OpenAI-compatible APIs usually use .../v1, while native Anthropic accepts the site root or .../v1.
api_url = ""
# zh: Security 模型 API Key。
# en: Security model API key.
api_key = ""
# zh: Security 模型名称。
# en: Security model name.
model_name = ""
# zh: 可选限制:OpenAI 模式下非正数会省略上限,Anthropic Messages 要求为正整数。
# en: Optional generation limit; non-positive values omit it in OpenAI modes, while Anthropic Messages requires a positive integer.
max_tokens = 100
# zh: 模型上下文窗口上限(token),用于 /summary 分块与 Prompt 预算;须与上游模型能力一致。
# en: Model context window cap (tokens) for /summary chunking and prompt budgeting; must match upstream capability.
context_window_tokens = 8192
# zh: 队列发车间隔(秒;<=0 事件驱动立即发车且空闲不扫描,>0 按间隔扫描)。
# en: Queue interval (seconds; <=0 dispatches on arrival without idle polling; >0 polls periodically).
queue_interval_seconds = 1.0
# zh: API 模式:openai.chat_completions、openai.responses 或 anthropic.messages;旧无前缀值仍兼容但已弃用。
# en: API mode: openai.chat_completions, openai.responses, or anthropic.messages. Legacy unprefixed values remain compatible but are deprecated.
api_mode = "openai.chat_completions"
# zh: 是否启用 reasoning.effort。
# en: Enable reasoning.effort.
reasoning_enabled = false
# zh: 自定义 reasoning effort;值为 adaptive 时原样发送 adaptive,其余值也原样透传。
# en: Custom reasoning effort; adaptive is sent as adaptive and every other value is passed through unchanged.
reasoning_effort = "medium"
# zh: 是否发送由 thinking_enabled 自动生成的顶层 thinking 参数;调用方显式 thinking 不受影响。
# en: Send the top-level thinking parameter generated by thinking_enabled; explicit caller overrides are unaffected.
thinking_param_enabled = true
# zh: 是否启用 thinking(思维链)。
# en: Enable thinking (reasoning).
thinking_enabled = false
# zh: thinking 预算 tokens。
# en: Thinking-budget tokens.
thinking_budget_tokens = 0
# zh: 是否发送手动 thinking 预算;anthropic.messages 下关闭时使用 adaptive thinking。
# en: Send a manual thinking budget; in anthropic.messages mode, disabling this selects adaptive thinking.
thinking_include_budget = true
# zh: 思维链工具调用兼容:在本地历史保留可读 reasoning_content;是否向上游回传由 reasoning_content_replay 控制。
# en: Thinking tool-call compatibility: retain readable reasoning_content locally; reasoning_content_replay controls upstream replay.
thinking_tool_call_compat = true
# zh: 是否原样回传推理结构(Chat 兼容字段、Responses reasoning items/encrypted_content、Anthropic thinking/redacted blocks)。默认开启。
# en: Replay native reasoning structures (Chat compatibility fields, Responses reasoning items/encrypted_content, Anthropic thinking/redacted blocks). Enabled by default.
reasoning_content_replay = true
# zh: 是否将所有 system 提示词合并注入第一条 user 消息(仅 openai.chat_completions)。默认关闭。
# en: Merge all system prompts into the first user message (openai.chat_completions only). Disabled by default.
system_prompt_as_user = false
# zh: Responses API 的 tool_choice 兼容模式:仅在关闭时请求仍返回 500、怀疑上游不兼容对象型 tool_choice 时再尝试开启;开启后上报为 "required" 并只保留目标工具。当前已在 new-api v0.11.4-alpha.3 发现该问题。默认关闭。
# en: Responses API tool_choice compatibility mode: only try enabling this when requests still return 500 with the default setting and you suspect the upstream does not support object-style tool_choice; it sends "required" and keeps only the selected tool. This issue is currently observed on new-api v0.11.4-alpha.3. Disabled by default.
responses_tool_choice_compat = false
# zh: Responses API 续轮强制降级:启用后,多轮工具调用将始终跳过 previous_response_id,直接使用完整消息重放(stateless replay)。仅在上游不兼容 responses 状态续轮时使用。默认关闭。
# en: Responses API force stateless replay: when enabled, multi-turn tool follow-ups always skip previous_response_id and replay the full message history instead. Use only when the upstream does not handle stateful responses follow-ups correctly. Disabled by default.
responses_force_stateless_replay = false
# zh: OpenAI 模式下是否自动生成 prompt_cache_key;Anthropic 模式请通过 request_params.cache_control 配置缓存。
# en: Generate prompt_cache_key in OpenAI modes; use request_params.cache_control for Anthropic caching.
prompt_cache_enabled = true
# zh: 是否对上游模型 API 启用流式请求。
# en: Enable streaming requests to the upstream model API.
stream_enabled = false
# zh: 额外请求体参数(可选),可用于 temperature 或供应商私有参数。
# en: Extra request-body params (optional), e.g. temperature or vendor-specific fields.
[models.security.request_params]
# zh: Naga 外发消息审核模型配置(仅用于 Naga 通过 Runtime API 发消息前的内容审核)。
# zh: 若无必要可不填写;未配置时回退到 [models.security]。
# en: Naga outbound moderation model config (used only before Naga sends messages through the Runtime API).
# en: Optional; falls back to [models.security] when omitted.
[models.naga]
# zh: 是否让该模型请求使用 [proxy] 代理地址。默认关闭;即使回退 [models.security] endpoint,也使用本开关。
# en: Whether this model uses proxy addresses from [proxy]. Disabled by default; this switch is used even when falling back to [models.security].
use_proxy = false
# zh: Provider 基址;OpenAI 兼容接口通常为 .../v1,Anthropic 原生接口可写站点根地址或 .../v1。
# en: Provider base URL; OpenAI-compatible APIs usually use .../v1, while native Anthropic accepts the site root or .../v1.
api_url = ""
# zh: Naga 审核模型 API Key。
# en: Naga moderation model API key.
api_key = ""
# zh: Naga 审核模型名称。
# en: Naga moderation model name.
model_name = ""
# zh: 可选限制:OpenAI 模式下非正数会省略上限,Anthropic Messages 要求为正整数。
# en: Optional generation limit; non-positive values omit it in OpenAI modes, while Anthropic Messages requires a positive integer.
max_tokens = 160
# zh: 模型上下文窗口上限(token),用于 /summary 分块与 Prompt 预算;须与上游模型能力一致。
# en: Model context window cap (tokens) for /summary chunking and prompt budgeting; must match upstream capability.
context_window_tokens = 8192
# zh: 队列发车间隔(秒;<=0 事件驱动立即发车且空闲不扫描,>0 按间隔扫描)。
# en: Queue interval (seconds; <=0 dispatches on arrival without idle polling; >0 polls periodically).
queue_interval_seconds = 1.0
# zh: API 模式:openai.chat_completions、openai.responses 或 anthropic.messages;旧无前缀值仍兼容但已弃用。
# en: API mode: openai.chat_completions, openai.responses, or anthropic.messages. Legacy unprefixed values remain compatible but are deprecated.
api_mode = "openai.chat_completions"
# zh: 是否启用 reasoning.effort。
# en: Enable reasoning.effort.
reasoning_enabled = false
# zh: 自定义 reasoning effort;值为 adaptive 时原样发送 adaptive,其余值也原样透传。
# en: Custom reasoning effort; adaptive is sent as adaptive and every other value is passed through unchanged.
reasoning_effort = "medium"
# zh: 是否发送由 thinking_enabled 自动生成的顶层 thinking 参数;调用方显式 thinking 不受影响。
# en: Send the top-level thinking parameter generated by thinking_enabled; explicit caller overrides are unaffected.
thinking_param_enabled = true
# zh: 是否启用 thinking(思维链)。
# en: Enable thinking (reasoning).
thinking_enabled = false
# zh: thinking 预算 tokens。
# en: Thinking-budget tokens.
thinking_budget_tokens = 0
# zh: 是否发送手动 thinking 预算;anthropic.messages 下关闭时使用 adaptive thinking。
# en: Send a manual thinking budget; in anthropic.messages mode, disabling this selects adaptive thinking.
thinking_include_budget = true
# zh: 思维链工具调用兼容:在本地历史保留可读 reasoning_content;是否向上游回传由 reasoning_content_replay 控制。
# en: Thinking tool-call compatibility: retain readable reasoning_content locally; reasoning_content_replay controls upstream replay.
thinking_tool_call_compat = true
# zh: 是否原样回传推理结构(Chat 兼容字段、Responses reasoning items/encrypted_content、Anthropic thinking/redacted blocks)。默认开启。
# en: Replay native reasoning structures (Chat compatibility fields, Responses reasoning items/encrypted_content, Anthropic thinking/redacted blocks). Enabled by default.
reasoning_content_replay = true
# zh: 是否将所有 system 提示词合并注入第一条 user 消息(仅 openai.chat_completions)。默认关闭。
# en: Merge all system prompts into the first user message (openai.chat_completions only). Disabled by default.
system_prompt_as_user = false
# zh: Responses API 的 tool_choice 兼容模式。
# en: Responses API tool_choice compatibility mode.
responses_tool_choice_compat = false
# zh: Responses API 续轮强制降级。
# en: Responses API force stateless replay.
responses_force_stateless_replay = false
# zh: 是否对上游模型 API 启用流式请求。
# en: Enable streaming requests to the upstream model API.
stream_enabled = false
# zh: 额外请求体参数(可选),可用于 temperature 或供应商私有参数。
# en: Extra request-body params (optional), e.g. temperature or vendor-specific fields.
[models.naga.request_params]
# zh: Agent 模型配置(用于执行 agents)。
# en: Agent model config (used to run agents).
[models.agent]
# zh: 是否让该模型请求使用 [proxy] 代理地址。默认关闭;模型池条目需在 entry 内单独配置。
# en: Whether this model uses proxy addresses from [proxy]. Disabled by default; pool entries configure this per entry.
use_proxy = false
# zh: Provider 基址;OpenAI 兼容接口通常为 .../v1,Anthropic 原生接口可写站点根地址或 .../v1。
# en: Provider base URL; OpenAI-compatible APIs usually use .../v1, while native Anthropic accepts the site root or .../v1.
api_url = ""
# zh: Agent 模型 API Key。
# en: Agent model API key.
api_key = ""
# zh: Agent 模型名称。
# en: Agent model name.
model_name = ""
# zh: 可选限制:OpenAI 模式下非正数会省略上限,Anthropic Messages 要求为正整数。
# en: Optional generation limit; non-positive values omit it in OpenAI modes, while Anthropic Messages requires a positive integer.
max_tokens = 4096
# zh: 模型上下文窗口上限(token),用于 /summary 分块与 Prompt 预算;须与上游模型能力一致。
# en: Model context window cap (tokens) for /summary chunking and prompt budgeting; must match upstream capability.
context_window_tokens = 32768
# zh: 队列发车间隔(秒;<=0 事件驱动立即发车且空闲不扫描,>0 按间隔扫描)。
# en: Queue interval (seconds; <=0 dispatches on arrival without idle polling; >0 polls periodically).
queue_interval_seconds = 1.0
# zh: API 模式:openai.chat_completions、openai.responses 或 anthropic.messages;旧无前缀值仍兼容但已弃用。
# en: API mode: openai.chat_completions, openai.responses, or anthropic.messages. Legacy unprefixed values remain compatible but are deprecated.
api_mode = "openai.chat_completions"
# zh: 是否启用 reasoning.effort。
# en: Enable reasoning.effort.
reasoning_enabled = false
# zh: 自定义 reasoning effort;值为 adaptive 时原样发送 adaptive,其余值也原样透传。
# en: Custom reasoning effort; adaptive is sent as adaptive and every other value is passed through unchanged.
reasoning_effort = "medium"
# zh: 是否发送由 thinking_enabled 自动生成的顶层 thinking 参数;调用方显式 thinking 不受影响。
# en: Send the top-level thinking parameter generated by thinking_enabled; explicit caller overrides are unaffected.
thinking_param_enabled = true
# zh: 是否启用 thinking(思维链)。
# en: Enable thinking (reasoning).
thinking_enabled = false
# zh: thinking 预算 tokens。
# en: Thinking-budget tokens.
thinking_budget_tokens = 0
# zh: 是否发送手动 thinking 预算;anthropic.messages 下关闭时使用 adaptive thinking。
# en: Send a manual thinking budget; in anthropic.messages mode, disabling this selects adaptive thinking.
thinking_include_budget = true
# zh: 思维链工具调用兼容:在本地历史保留可读 reasoning_content;是否向上游回传由 reasoning_content_replay 控制。
# en: Thinking tool-call compatibility: retain readable reasoning_content locally; reasoning_content_replay controls upstream replay.
thinking_tool_call_compat = true
# zh: 是否原样回传推理结构(Chat 兼容字段、Responses reasoning items/encrypted_content、Anthropic thinking/redacted blocks)。默认开启。
# en: Replay native reasoning structures (Chat compatibility fields, Responses reasoning items/encrypted_content, Anthropic thinking/redacted blocks). Enabled by default.
reasoning_content_replay = true
# zh: 是否将所有 system 提示词合并注入第一条 user 消息(仅 openai.chat_completions)。默认关闭。
# en: Merge all system prompts into the first user message (openai.chat_completions only). Disabled by default.
system_prompt_as_user = false
# zh: Responses API 的 tool_choice 兼容模式:仅在关闭时请求仍返回 500、怀疑上游不兼容对象型 tool_choice 时再尝试开启;开启后上报为 "required" 并只保留目标工具。当前已在 new-api v0.11.4-alpha.3 发现该问题。默认关闭。
# en: Responses API tool_choice compatibility mode: only try enabling this when requests still return 500 with the default setting and you suspect the upstream does not support object-style tool_choice; it sends "required" and keeps only the selected tool. This issue is currently observed on new-api v0.11.4-alpha.3. Disabled by default.
responses_tool_choice_compat = false
# zh: Responses API 续轮强制降级:启用后,多轮工具调用将始终跳过 previous_response_id,直接使用完整消息重放(stateless replay)。仅在上游不兼容 responses 状态续轮时使用。默认关闭。
# en: Responses API force stateless replay: when enabled, multi-turn tool follow-ups always skip previous_response_id and replay the full message history instead. Use only when the upstream does not handle stateful responses follow-ups correctly. Disabled by default.
responses_force_stateless_replay = false
# zh: OpenAI 模式下是否自动生成 prompt_cache_key;Anthropic 模式请通过 request_params.cache_control 配置缓存。
# en: Generate prompt_cache_key in OpenAI modes; use request_params.cache_control for Anthropic caching.
prompt_cache_enabled = true
# zh: 是否对上游模型 API 启用流式请求。
# en: Enable streaming requests to the upstream model API.
stream_enabled = false
# zh: 额外请求体参数(可选),可用于 temperature 或供应商私有参数。
# en: Extra request-body params (optional), e.g. temperature or vendor-specific fields.
[models.agent.request_params]
# zh: Agent 模型池配置(可选,支持多模型轮询/随机/用户指定)。
# en: Agent model pool configuration (optional, supports round-robin/random/user-specified).
[models.agent.pool]
# zh: 是否启用 Agent 模型池。
# en: Enable agent model pool.
enabled = false
# zh: 分配策略:default(用户指定)/ round_robin(轮询)/ random(随机)。
# en: Strategy: default (user-specified) / round_robin / random.
strategy = "default"
# zh: Agent 模型池列表(每项需填 model_name、api_url、api_key;可选 use_proxy,默认 false;其余字段可选,缺省继承主模型)。
# en: Agent model pool entries (model_name, api_url, api_key required; optional use_proxy defaults to false; other fields inherit from primary).
models = []
# zh: 史官模型配置(认知记忆后台改写用,未配置时回退到 agent 模型)。
# en: Historian model config (for cognitive memory rewriting, falls back to agent model if unset).
[models.historian]
# zh: 是否让该模型请求使用 [proxy] 代理地址。默认关闭;即使回退 [models.agent] endpoint,也使用本开关。
# en: Whether this model uses proxy addresses from [proxy]. Disabled by default; this switch is used even when falling back to [models.agent].
use_proxy = false
# zh: Provider 基址;OpenAI 兼容接口通常为 .../v1,Anthropic 原生接口可写站点根地址或 .../v1。
# en: Provider base URL; OpenAI-compatible APIs usually use .../v1, while native Anthropic accepts the site root or .../v1.
api_url = ""
# zh: 史官模型 API Key。
# en: Historian model API key.
api_key = ""
# zh: 史官模型名称。
# en: Historian model name.
model_name = ""
# zh: 可选限制:OpenAI 模式下非正数会省略上限,Anthropic Messages 要求为正整数。
# en: Optional generation limit; non-positive values omit it in OpenAI modes, while Anthropic Messages requires a positive integer.
max_tokens = 4096
# zh: 模型上下文窗口上限(token),用于 /summary 分块与 Prompt 预算;须与上游模型能力一致。
# en: Model context window cap (tokens) for /summary chunking and prompt budgeting; must match upstream capability.
context_window_tokens = 32768
# zh: 队列发车间隔(秒;<=0 事件驱动立即发车且空闲不扫描,>0 按间隔扫描)。
# en: Queue interval (seconds; <=0 dispatches on arrival without idle polling; >0 polls periodically).
queue_interval_seconds = 1.0
# zh: API 模式:openai.chat_completions、openai.responses 或 anthropic.messages;旧无前缀值仍兼容但已弃用。
# en: API mode: openai.chat_completions, openai.responses, or anthropic.messages. Legacy unprefixed values remain compatible but are deprecated.
api_mode = "openai.chat_completions"
# zh: 是否启用 reasoning.effort。
# en: Enable reasoning.effort.
reasoning_enabled = false
# zh: 自定义 reasoning effort;值为 adaptive 时原样发送 adaptive,其余值也原样透传。
# en: Custom reasoning effort; adaptive is sent as adaptive and every other value is passed through unchanged.
reasoning_effort = "medium"
# zh: 是否发送由 thinking_enabled 自动生成的顶层 thinking 参数;调用方显式 thinking 不受影响。
# en: Send the top-level thinking parameter generated by thinking_enabled; explicit caller overrides are unaffected.
thinking_param_enabled = true
# zh: 是否启用 thinking(思维链)。
# en: Enable thinking (reasoning).
thinking_enabled = false
# zh: thinking 预算 tokens。
# en: Thinking-budget tokens.
thinking_budget_tokens = 0
# zh: 是否发送手动 thinking 预算;anthropic.messages 下关闭时使用 adaptive thinking。
# en: Send a manual thinking budget; in anthropic.messages mode, disabling this selects adaptive thinking.
thinking_include_budget = true
# zh: 思维链工具调用兼容:在本地历史保留可读 reasoning_content;是否向上游回传由 reasoning_content_replay 控制。
# en: Thinking tool-call compatibility: retain readable reasoning_content locally; reasoning_content_replay controls upstream replay.
thinking_tool_call_compat = true
# zh: 是否原样回传推理结构(Chat 兼容字段、Responses reasoning items/encrypted_content、Anthropic thinking/redacted blocks)。默认开启。
# en: Replay native reasoning structures (Chat compatibility fields, Responses reasoning items/encrypted_content, Anthropic thinking/redacted blocks). Enabled by default.
reasoning_content_replay = true
# zh: 是否将所有 system 提示词合并注入第一条 user 消息(仅 openai.chat_completions)。默认关闭。
# en: Merge all system prompts into the first user message (openai.chat_completions only). Disabled by default.
system_prompt_as_user = false
# zh: Responses API 的 tool_choice 兼容模式:仅在关闭时请求仍返回 500、怀疑上游不兼容对象型 tool_choice 时再尝试开启;开启后上报为 "required" 并只保留目标工具。当前已在 new-api v0.11.4-alpha.3 发现该问题。默认关闭。
# en: Responses API tool_choice compatibility mode: only try enabling this when requests still return 500 with the default setting and you suspect the upstream does not support object-style tool_choice; it sends "required" and keeps only the selected tool. This issue is currently observed on new-api v0.11.4-alpha.3. Disabled by default.
responses_tool_choice_compat = false
# zh: Responses API 续轮强制降级:启用后,多轮工具调用将始终跳过 previous_response_id,直接使用完整消息重放(stateless replay)。仅在上游不兼容 responses 状态续轮时使用。默认关闭。
# en: Responses API force stateless replay: when enabled, multi-turn tool follow-ups always skip previous_response_id and replay the full message history instead. Use only when the upstream does not handle stateful responses follow-ups correctly. Disabled by default.
responses_force_stateless_replay = false
# zh: OpenAI 模式下是否自动生成 prompt_cache_key;Anthropic 模式请通过 request_params.cache_control 配置缓存。
# en: Generate prompt_cache_key in OpenAI modes; use request_params.cache_control for Anthropic caching.
prompt_cache_enabled = true
# zh: 是否对上游模型 API 启用流式请求。
# en: Enable streaming requests to the upstream model API.
stream_enabled = false
# zh: 额外请求体参数(可选),可用于 temperature 或供应商私有参数。
# en: Extra request-body params (optional), e.g. temperature or vendor-specific fields.
[models.historian.request_params]
# zh: 消息总结模型配置(/summary /sum 与 SummaryService 专用;未配置时回退到 agent 模型;主 AI 调用 summary_agent 不使用此段配置)。
# en: Message-summary model config (used by /summary, /sum, and SummaryService; falls back to the agent model when unset; summary_agent invoked by the main AI does not use this section).
[models.summary]
# zh: 是否让该模型请求使用 [proxy] 代理地址。默认关闭;即使回退 [models.agent] endpoint,也使用本开关。
# en: Whether this model uses proxy addresses from [proxy]. Disabled by default; this switch is used even when falling back to [models.agent].
use_proxy = false
# zh: Provider 基址;OpenAI 兼容接口通常为 .../v1,Anthropic 原生接口可写站点根地址或 .../v1。
# en: Provider base URL; OpenAI-compatible APIs usually use .../v1, while native Anthropic accepts the site root or .../v1.
api_url = ""
# zh: 消息总结模型 API Key。
# en: Message-summary model API key.
api_key = ""
# zh: 消息总结模型名称。
# en: Message-summary model name.
model_name = ""
# zh: 可选限制:OpenAI 模式下非正数会省略上限,Anthropic Messages 要求为正整数。
# en: Optional generation limit; non-positive values omit it in OpenAI modes, while Anthropic Messages requires a positive integer.
max_tokens = 4096
# zh: 模型上下文窗口上限(token),用于 /summary 分块与 Prompt 预算;须与上游模型能力一致。
# en: Model context window cap (tokens) for /summary chunking and prompt budgeting; must match upstream capability.
context_window_tokens = 32768
# zh: 队列发车间隔(秒;<=0 事件驱动立即发车且空闲不扫描,>0 按间隔扫描)。
# en: Queue interval (seconds; <=0 dispatches on arrival without idle polling; >0 polls periodically).
queue_interval_seconds = 1.0
# zh: API 模式:openai.chat_completions、openai.responses 或 anthropic.messages;旧无前缀值仍兼容但已弃用。
# en: API mode: openai.chat_completions, openai.responses, or anthropic.messages. Legacy unprefixed values remain compatible but are deprecated.
api_mode = "openai.chat_completions"
# zh: 是否启用 reasoning.effort。
# en: Enable reasoning.effort.
reasoning_enabled = false
# zh: 自定义 reasoning effort;值为 adaptive 时原样发送 adaptive,其余值也原样透传。
# en: Custom reasoning effort; adaptive is sent as adaptive and every other value is passed through unchanged.
reasoning_effort = "medium"
# zh: 是否发送由 thinking_enabled 自动生成的顶层 thinking 参数;调用方显式 thinking 不受影响。
# en: Send the top-level thinking parameter generated by thinking_enabled; explicit caller overrides are unaffected.
thinking_param_enabled = true
# zh: 是否启用 thinking(思维链)。
# en: Enable thinking (reasoning).
thinking_enabled = false
# zh: thinking 预算 tokens。
# en: Thinking-budget tokens.
thinking_budget_tokens = 0
# zh: 是否发送手动 thinking 预算;anthropic.messages 下关闭时使用 adaptive thinking。
# en: Send a manual thinking budget; in anthropic.messages mode, disabling this selects adaptive thinking.
thinking_include_budget = true
# zh: 思维链工具调用兼容:在本地历史保留可读 reasoning_content;是否向上游回传由 reasoning_content_replay 控制。
# en: Thinking tool-call compatibility: retain readable reasoning_content locally; reasoning_content_replay controls upstream replay.
thinking_tool_call_compat = true
# zh: 是否原样回传推理结构(Chat 兼容字段、Responses reasoning items/encrypted_content、Anthropic thinking/redacted blocks)。默认开启。
# en: Replay native reasoning structures (Chat compatibility fields, Responses reasoning items/encrypted_content, Anthropic thinking/redacted blocks). Enabled by default.
reasoning_content_replay = true
# zh: 是否将所有 system 提示词合并注入第一条 user 消息(仅 openai.chat_completions)。默认关闭。
# en: Merge all system prompts into the first user message (openai.chat_completions only). Disabled by default.
system_prompt_as_user = false
# zh: Responses API 的 tool_choice 兼容模式:仅在关闭时请求仍返回 500、怀疑上游不兼容对象型 tool_choice 时再尝试开启;开启后上报为 "required" 并只保留目标工具。默认关闭。
# en: Responses API tool_choice compatibility mode: only try enabling this when requests still return 500 with the default setting and you suspect the upstream does not support object-style tool_choice; it sends "required" and keeps only the selected tool. Disabled by default.
responses_tool_choice_compat = false
# zh: Responses API 续轮强制降级:启用后,多轮工具调用将始终跳过 previous_response_id,直接使用完整消息重放(stateless replay)。仅在上游不兼容 responses 状态续轮时使用。默认关闭。
# en: Responses API force stateless replay: when enabled, multi-turn tool follow-ups always skip previous_response_id and replay the full message history instead. Use only when the upstream does not handle stateful responses follow-ups correctly. Disabled by default.
responses_force_stateless_replay = false
# zh: OpenAI 模式下是否自动生成 prompt_cache_key;Anthropic 模式请通过 request_params.cache_control 配置缓存。
# en: Generate prompt_cache_key in OpenAI modes; use request_params.cache_control for Anthropic caching.
prompt_cache_enabled = true
# zh: 是否对上游模型 API 启用流式请求。
# en: Enable streaming requests to the upstream model API.
stream_enabled = false
# zh: 额外请求体参数(可选),可用于 temperature 或供应商私有参数。
# en: Extra request-body params (optional), e.g. temperature or vendor-specific fields.
[models.summary.request_params]
# zh: Grok 搜索模型配置(仅供 web_agent 内的 grok_search 使用,支持与其他生成模型相同的 API/推理配置)。
# en: Grok search model config (used only by grok_search inside web_agent, with the same API/reasoning controls as other generation models).
[models.grok]
# zh: 是否让该模型请求使用 [proxy] 代理地址。默认关闭。
# en: Whether this model uses proxy addresses from [proxy]. Disabled by default.
use_proxy = false
# zh: Provider 基址;格式由 api_mode 决定。
# en: Provider base URL; its shape is determined by api_mode.
api_url = ""
# zh: Grok 搜索模型 API Key。
# en: Grok search model API key.
api_key = ""
# zh: Grok 搜索模型名称。
# en: Grok search model name.
model_name = ""
# zh: 可选限制:OpenAI 模式下非正数会省略上限,Anthropic Messages 要求为正整数。
# en: Optional generation limit; non-positive values omit it in OpenAI modes, while Anthropic Messages requires a positive integer.
max_tokens = 8192
# zh: 模型上下文窗口上限(token),用于 /summary 分块与 Prompt 预算;须与上游模型能力一致。
# en: Model context window cap (tokens) for /summary chunking and prompt budgeting; must match upstream capability.
context_window_tokens = 32768
# zh: 队列发车间隔(秒;<=0 事件驱动立即发车且空闲不扫描,>0 按间隔扫描)。
# en: Queue interval (seconds; <=0 dispatches on arrival without idle polling; >0 polls periodically).
queue_interval_seconds = 1.0
# zh: API 模式:openai.chat_completions、openai.responses 或 anthropic.messages;旧无前缀值仍兼容但已弃用。
# en: API mode: openai.chat_completions, openai.responses, or anthropic.messages. Legacy unprefixed values remain compatible but are deprecated.
api_mode = "openai.chat_completions"
# zh: 是否启用 reasoning.effort。
# en: Enable reasoning.effort.
reasoning_enabled = false
# zh: 自定义 reasoning effort;值为 adaptive 时原样发送 adaptive,其余值也原样透传。
# en: Custom reasoning effort; adaptive is sent as adaptive and every other value is passed through unchanged.
reasoning_effort = "medium"
# zh: 是否发送由 thinking_enabled 自动生成的顶层 thinking 参数;调用方显式 thinking 不受影响。
# en: Send the top-level thinking parameter generated by thinking_enabled; explicit caller overrides are unaffected.
thinking_param_enabled = true
# zh: 是否启用 thinking(思维链)。
# en: Enable thinking (reasoning).
thinking_enabled = false
# zh: thinking 预算 tokens。
# en: Thinking-budget tokens.
thinking_budget_tokens = 20000
# zh: 是否发送手动 thinking 预算;anthropic.messages 下关闭时使用 adaptive thinking。
# en: Send a manual thinking budget; in anthropic.messages mode, disabling this selects adaptive thinking.
thinking_include_budget = true
# zh: 思维链工具调用兼容:在本地历史保留可读 reasoning_content;是否向上游回传由 reasoning_content_replay 控制。
# en: Thinking tool-call compatibility: retain readable reasoning_content locally; reasoning_content_replay controls upstream replay.
thinking_tool_call_compat = true
# zh: 是否原样回传推理结构(Chat 兼容字段、Responses reasoning items/encrypted_content、Anthropic thinking/redacted blocks)。默认开启。
# en: Replay native reasoning structures (Chat compatibility fields, Responses reasoning items/encrypted_content, Anthropic thinking/redacted blocks). Enabled by default.
reasoning_content_replay = true
# zh: 是否将所有 system 提示词合并注入第一条 user 消息(仅 openai.chat_completions)。默认关闭。
# en: Merge all system prompts into the first user message (openai.chat_completions only). Disabled by default.
system_prompt_as_user = false
# zh: Responses API 对象型 tool_choice 的兼容开关。默认关闭。
# en: Compatibility switch for object-style Responses API tool_choice. Disabled by default.
responses_tool_choice_compat = false
# zh: Responses API 是否强制使用完整历史 stateless replay。默认关闭。
# en: Force full-history stateless replay for the Responses API. Disabled by default.
responses_force_stateless_replay = false
# zh: OpenAI 模式下是否自动生成 prompt_cache_key;Anthropic 模式请通过 request_params.cache_control 配置缓存。
# en: Generate prompt_cache_key in OpenAI modes; use request_params.cache_control for Anthropic caching.
prompt_cache_enabled = true
# zh: 是否对上游模型 API 启用流式请求。
# en: Enable streaming requests to the upstream model API.
stream_enabled = false
# zh: 额外请求体参数(可选),可用于 temperature 或供应商私有参数。
# en: Extra request-body params (optional), e.g. temperature or vendor-specific fields.
[models.grok.request_params]
# zh: 嵌入模型默认配置(知识库 / 认知记忆 / 梗库默认共用;各功能可在下方 features 中单独覆写)。
# en: Default embedding model config (shared by knowledge, cognitive memory and memes by default; override per feature below).
[models.embedding]
# zh: 是否让该模型请求使用 [proxy] 代理地址。默认关闭。
# en: Whether this model uses proxy addresses from [proxy]. Disabled by default.
use_proxy = false
# zh: OpenAI-compatible 基址 URL,例如 https://api.openai.com/v1。
# en: OpenAI-compatible base URL, e.g. https://api.openai.com/v1.
api_url = ""
# zh: Embedding 模型 API Key。
# en: Embedding model API key.
api_key = ""
# zh: Embedding 模型名称。
# en: Embedding model name.
model_name = ""
# zh: 模型上下文窗口上限(token,可选);嵌入/重排场景通常保持默认即可。
# en: Model context window cap (tokens, optional); embedding/rerank can usually keep the default.
context_window_tokens = 8192
# zh: 队列发车间隔(秒;<=0 请求到达立即发车,>0 控制发车间隔)。
# en: Queue interval (seconds; <=0 dispatches on arrival; >0 spaces dispatches).
queue_interval_seconds = 0.0
# zh: 向量维度(可选)。0 或留空表示使用模型默认维度。
# en: Embedding dimensions (optional). Use 0/empty to use model defaults.
dimensions = 0
# zh: 查询端指令前缀(可选,Qwen3/BGE 等模型常用)。指令与文本直接拼接,
# 首尾空白与换行原样保留;留空表示不使用指令。
# en: Query instruction prefix (optional, common for Qwen3/BGE-style models).
# The instruction is concatenated directly with the text, whitespace and
# newlines preserved; leave empty to disable.
query_instruction = ""
# zh: 文档端指令前缀(可选,E5 等模型常用,例如 "passage: ")。
# en: Document instruction prefix (optional, common for E5-style models, e.g. "passage: ").
document_instruction = ""
# zh: 额外请求体参数(可选),用于 embedding 供应商的扩展字段。
# en: Extra request-body params (optional) for embedding-provider-specific fields.
[models.embedding.request_params]
# zh: 按功能覆写的 embedding 配置。每个功能可完全继承 [models.embedding] 默认配置,
# 也可单独设置并按字段覆写;生效配置完全相同的功能共用一个发车队列。
# 通用哨兵规则:所有字符串字段(api_url / api_key / model_name / 指令前缀)
# 空字符串均表示继承默认配置、无法表达显式清空;数值与 use_proxy 的哨兵见各字段注释。
# en: Per-feature embedding overrides. Each feature either inherits the
# [models.embedding] defaults or overrides individual fields; features with
# the same effective config share one dispatch queue.
# Sentinel rule: empty strings in api_url / api_key / model_name / instruction
# prefixes all mean "inherit the default" and cannot express an explicit clear;
# numeric and use_proxy sentinels are documented on each field.
# zh: 按功能覆写示例:知识库(knowledge)。仅 use_default = false 时下方字段生效,取哨兵值仍表示继承默认配置。
# en: Per-feature override example: knowledge base (knowledge). Fields below apply only when use_default = false; sentinel values inherit the defaults.
[models.embedding.features.knowledge]
# zh: 是否完全使用 [models.embedding] 默认配置;true 时本表其余字段全部忽略。
# en: Whether to fully inherit the [models.embedding] defaults; when true, all other fields here are ignored.
use_default = true
# zh: 覆写 API 地址;空字符串表示继承默认配置。
# en: Override API URL; an empty string inherits the default.
api_url = ""
# zh: 覆写 API Key;空字符串表示继承默认配置。
# en: Override API key; an empty string inherits the default.
api_key = ""
# zh: 覆写模型名称;空字符串表示继承默认配置。
# en: Override model name; an empty string inherits the default.
model_name = ""
# zh: 覆写代理开关;"inherit"(或 "default")表示继承默认配置,也可写 true / false。
# en: Override the proxy switch; "inherit" (or "default") inherits the default, true / false override it.
use_proxy = "inherit"
# zh: 覆写上下文窗口上限(token);<=0 表示继承默认配置。
# en: Override the context window cap (tokens); <=0 inherits the default.
context_window_tokens = 0
# zh: 覆写队列发车间隔(秒);<0 表示继承默认配置,0 表示请求到达立即发车。
# en: Override the queue interval (seconds); <0 inherits the default, 0 dispatches on arrival.
queue_interval_seconds = -1.0
# zh: 覆写向量维度;<0 表示继承默认配置,0 表示使用模型默认维度。
# en: Override embedding dimensions; <0 inherits the default, 0 uses the model default.
dimensions = -1
# zh: 覆写查询端指令前缀;空字符串或纯空白都表示继承默认配置。覆写表无法表达
# 「显式清空」——若默认表带前缀而本功能不需要,请把默认前缀留空、只在需要
# 的功能上单独设置。
# en: Override the query instruction prefix; an empty or whitespace-only string
# inherits the default. Overrides cannot express "explicitly empty" — if the
# default table has a prefix this feature does not need, keep the default
# empty and set the prefix only on the features that need it.
query_instruction = ""
# zh: 覆写文档端指令前缀;语义同 query_instruction(空/纯空白 = 继承)。
# en: Override the document instruction prefix; same semantics as query_instruction (empty/whitespace = inherit).
document_instruction = ""
# zh: 覆写额外请求体参数,按 key 合并到默认 request_params 之上(同名以本表为准)。
# en: Override extra request-body params, merged over the default request_params (this table wins).
[models.embedding.features.knowledge.request_params]
# zh: 按功能覆写示例:认知记忆(cognitive)。仅 use_default = false 时下方字段生效,取哨兵值仍表示继承默认配置。
# en: Per-feature override example: cognitive memory (cognitive). Fields below apply only when use_default = false; sentinel values inherit the defaults.
[models.embedding.features.cognitive]
# zh: 是否完全使用 [models.embedding] 默认配置;true 时本表其余字段全部忽略。
# en: Whether to fully inherit the [models.embedding] defaults; when true, all other fields here are ignored.
use_default = true
# zh: 覆写 API 地址;空字符串表示继承默认配置。
# en: Override API URL; an empty string inherits the default.
api_url = ""
# zh: 覆写 API Key;空字符串表示继承默认配置。
# en: Override API key; an empty string inherits the default.
api_key = ""
# zh: 覆写模型名称;空字符串表示继承默认配置。
# en: Override model name; an empty string inherits the default.
model_name = ""
# zh: 覆写代理开关;"inherit"(或 "default")表示继承默认配置,也可写 true / false。
# en: Override the proxy switch; "inherit" (or "default") inherits the default, true / false override it.
use_proxy = "inherit"
# zh: 覆写上下文窗口上限(token);<=0 表示继承默认配置。
# en: Override the context window cap (tokens); <=0 inherits the default.
context_window_tokens = 0
# zh: 覆写队列发车间隔(秒);<0 表示继承默认配置,0 表示请求到达立即发车。
# en: Override the queue interval (seconds); <0 inherits the default, 0 dispatches on arrival.
queue_interval_seconds = -1.0
# zh: 覆写向量维度;<0 表示继承默认配置,0 表示使用模型默认维度。
# en: Override embedding dimensions; <0 inherits the default, 0 uses the model default.
dimensions = -1
# zh: 覆写查询端指令前缀;空字符串或纯空白都表示继承默认配置。覆写表无法表达
# 「显式清空」——若默认表带前缀而本功能不需要,请把默认前缀留空、只在需要
# 的功能上单独设置。
# en: Override the query instruction prefix; an empty or whitespace-only string
# inherits the default. Overrides cannot express "explicitly empty" — if the
# default table has a prefix this feature does not need, keep the default
# empty and set the prefix only on the features that need it.
query_instruction = ""
# zh: 覆写文档端指令前缀;语义同 query_instruction(空/纯空白 = 继承)。
# en: Override the document instruction prefix; same semantics as query_instruction (empty/whitespace = inherit).
document_instruction = ""
# zh: 覆写额外请求体参数,按 key 合并到默认 request_params 之上(同名以本表为准)。
# en: Override extra request-body params, merged over the default request_params (this table wins).
[models.embedding.features.cognitive.request_params]
# zh: 按功能覆写示例:梗库(memes)。仅 use_default = false 时下方字段生效,取哨兵值仍表示继承默认配置。
# en: Per-feature override example: meme library (memes). Fields below apply only when use_default = false; sentinel values inherit the defaults.
[models.embedding.features.memes]
# zh: 是否完全使用 [models.embedding] 默认配置;true 时本表其余字段全部忽略。
# en: Whether to fully inherit the [models.embedding] defaults; when true, all other fields here are ignored.
use_default = true
# zh: 覆写 API 地址;空字符串表示继承默认配置。
# en: Override API URL; an empty string inherits the default.
api_url = ""
# zh: 覆写 API Key;空字符串表示继承默认配置。
# en: Override API key; an empty string inherits the default.
api_key = ""
# zh: 覆写模型名称;空字符串表示继承默认配置。
# en: Override model name; an empty string inherits the default.
model_name = ""
# zh: 覆写代理开关;"inherit"(或 "default")表示继承默认配置,也可写 true / false。
# en: Override the proxy switch; "inherit" (or "default") inherits the default, true / false override it.
use_proxy = "inherit"
# zh: 覆写上下文窗口上限(token);<=0 表示继承默认配置。
# en: Override the context window cap (tokens); <=0 inherits the default.
context_window_tokens = 0
# zh: 覆写队列发车间隔(秒);<0 表示继承默认配置,0 表示请求到达立即发车。
# en: Override the queue interval (seconds); <0 inherits the default, 0 dispatches on arrival.
queue_interval_seconds = -1.0
# zh: 覆写向量维度;<0 表示继承默认配置,0 表示使用模型默认维度。
# en: Override embedding dimensions; <0 inherits the default, 0 uses the model default.
dimensions = -1
# zh: 覆写查询端指令前缀;空字符串或纯空白都表示继承默认配置。覆写表无法表达
# 「显式清空」——若默认表带前缀而本功能不需要,请把默认前缀留空、只在需要
# 的功能上单独设置。
# en: Override the query instruction prefix; an empty or whitespace-only string
# inherits the default. Overrides cannot express "explicitly empty" — if the
# default table has a prefix this feature does not need, keep the default
# empty and set the prefix only on the features that need it.
query_instruction = ""
# zh: 覆写文档端指令前缀;语义同 query_instruction(空/纯空白 = 继承)。
# en: Override the document instruction prefix; same semantics as query_instruction (empty/whitespace = inherit).
document_instruction = ""
# zh: 覆写额外请求体参数,按 key 合并到默认 request_params 之上(同名以本表为准)。
# en: Override extra request-body params, merged over the default request_params (this table wins).
[models.embedding.features.memes.request_params]
# zh: 重排模型配置(知识库二阶段检索使用)。
# en: Rerank model config (used in second-stage knowledge retrieval).
[models.rerank]
# zh: 是否让该模型请求使用 [proxy] 代理地址。默认关闭。
# en: Whether this model uses proxy addresses from [proxy]. Disabled by default.
use_proxy = false
# zh: OpenAI-compatible 基址 URL,例如 https://api.openai.com/v1。
# en: OpenAI-compatible base URL, e.g. https://api.openai.com/v1.
api_url = ""
# zh: Rerank 模型 API Key。
# en: Rerank model API key.
api_key = ""
# zh: Rerank 模型名称。
# en: Rerank model name.
model_name = ""
# zh: 模型上下文窗口上限(token,可选);嵌入/重排场景通常保持默认即可。
# en: Model context window cap (tokens, optional); embedding/rerank can usually keep the default.
context_window_tokens = 8192
# zh: 队列发车间隔(秒;<=0 请求到达立即发车,>0 控制发车间隔)。
# en: Queue interval (seconds; <=0 dispatches on arrival; >0 spaces dispatches).
queue_interval_seconds = 0.0
# zh: 查询端指令前缀(可选,部分 rerank 模型需要,如 "Instruct: ...\\nQuery: ")。
# en: Query instruction prefix (optional, required by some rerank models, e.g. "Instruct: ...\\nQuery: ").
query_instruction = ""
# zh: 额外请求体参数(可选),用于 rerank 供应商的扩展字段。
# en: Extra request-body params (optional) for rerank-provider-specific fields.
[models.rerank.request_params]
# zh: 生图模型配置(用于 image_gen.provider="models" 时调用 OpenAI 兼容的图片生成接口)。
# en: Image generation model config (used when image_gen.provider="models" to call OpenAI-compatible image generation API).
[models.image_gen]
# zh: 是否让该图片生成模型请求使用 [proxy] 代理地址。默认关闭。
# en: Whether this image-generation model uses proxy addresses from [proxy]. Disabled by default.
use_proxy = false
# zh: OpenAI-compatible 基址 URL,例如 https://api.openai.com/v1(最终请求路径为 /v1/images/generations)。
# en: OpenAI-compatible base URL, e.g. https://api.openai.com/v1 (final request path is /v1/images/generations).
api_url = ""
# zh: API Key。
# en: API key.
api_key = ""
# zh: 模型名称(如 dall-e-3、minimax-image-01 等),空则使用上游默认。
# en: Model name (e.g. dall-e-3, minimax-image-01, etc.), empty uses provider default.
model_name = ""
# zh: 额外请求体参数(可选)。
# en: Extra request-body params (optional).
[models.image_gen.request_params]
# zh: 参考图生图模型配置(用于 ai_draw_one 传入 reference_image_uids 时调用 OpenAI 兼容的图片编辑接口)。
# en: Reference-image generation model config (used when ai_draw_one receives reference_image_uids and calls the OpenAI-compatible image editing API).
[models.image_edit]
# zh: 是否让该图片编辑模型请求使用 [proxy] 代理地址。默认关闭。
# en: Whether this image-edit model uses proxy addresses from [proxy]. Disabled by default.
use_proxy = false
# zh: OpenAI-compatible 基址 URL,例如 https://api.openai.com/v1(最终请求路径为 /v1/images/edits)。
# en: OpenAI-compatible base URL, e.g. https://api.openai.com/v1 (final request path is /v1/images/edits).
api_url = ""
# zh: API Key。
# en: API key.
api_key = ""
# zh: 模型名称,空则回退到 [models.image_gen] 的 model_name。
# en: Model name, empty falls back to [models.image_gen].model_name.
model_name = ""
# zh: 额外请求体参数(可选)。
# en: Extra request-body params (optional).
[models.image_edit.request_params]
# zh: 本地知识库配置。
# en: Local knowledge base settings.
[knowledge]
# zh: 是否启用本地知识库。
# en: Enable local knowledge base.
enabled = false
# zh: 知识库根目录。
# en: Knowledge base root directory.
base_dir = "knowledge"
# zh: 是否定期扫描文本变更。
# en: Periodically scan text changes.
auto_scan = false
# zh: 是否自动执行嵌入。
# en: Automatically run embedding.
auto_embed = false
# zh: 扫描间隔(秒)。
# en: Scan interval (seconds).
scan_interval = 60.0
# zh: 每批嵌入块数。
# en: Embedding batch size.
embed_batch_size = 64
# zh: 每个向量块包含的行数(滑动窗口大小)。
# en: Number of lines per chunk (sliding window size).
chunk_size = 10
# zh: 相邻块重叠的行数。
# en: Overlap lines between adjacent chunks.
chunk_overlap = 2
# zh: 语义搜索默认召回数。
# en: Default semantic retrieval top-k.
default_top_k = 5
# zh: 是否启用语义检索后的重排。
# en: Enable reranking after semantic retrieval.
enable_rerank = false
# zh: 重排后返回条数(必须小于 default_top_k)。
# en: Number of results returned after rerank (must be less than default_top_k).
rerank_top_k = 3
# zh: 日志配置。
# en: Logging settings.
[logging]
# zh: 日志级别(DEBUG/INFO/WARNING/ERROR)。
# en: Log level (DEBUG/INFO/WARNING/ERROR).
level = "INFO"
# zh: 日志文件路径。
# en: Log file path.
# zh: 在 Windows 上建议使用正斜杠,如 D:/logs/bot.log,或使用单引号 'D:\logs\bot.log',或在双引号中写双反斜杠 "D:\\logs\\bot.log"。
# en: On Windows, prefer "D:/logs/bot.log", or "'D:\logs\bot.log'", or "D:\\logs\\bot.log".
file_path = "logs/bot.log"
# zh: 单个日志文件最大大小(MB)。
# en: Max log file size (MB).
max_size_mb = 10
# zh: 保留日志文件数量。
# en: Log backup count.
backup_count = 5
# zh: 是否输出到终端 TTY(默认关闭,避免后台运行时终端阻塞)。
# en: Enable logging to terminal TTY (default: off, prevents blocking in background runs).
tty_enabled = false
# zh: 是否在日志中输出思维链(默认开启)。
# en: Log thinking output (default: on).
log_thinking = true
# zh: Tools 兼容性(可选)。
# en: Tools compatibility (optional).
# zh: 部分 OpenAI-compatible 网关会对 tools schema 做更严格的校验(尤其是 tools[].function.name / description),可能触发 400。
# en: Some OpenAI-compatible gateways strictly validate tools schema (especially tools[].function.name/description) and may return 400.
[tools]