-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathconfig.toml.example
More file actions
1788 lines (1704 loc) · 110 KB
/
Copy pathconfig.toml.example
File metadata and controls
1788 lines (1704 loc) · 110 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 = ""
[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: 嵌入模型配置(知识库语义检索使用)。
# en: Embedding model config (used by knowledge semantic retrieval).
[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).
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: 重排模型配置(知识库二阶段检索使用)。
# 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]
# zh: 工具名分隔符:当工具原始名称包含 '.'(例如 automation.create / mcp.server.tool)时,发送给模型前会把 '.' 映射为该分隔符。
# en: Tool-name delimiter: map '.' to this delimiter before sending tools to the model.
dot_delimiter = "-_-"
# zh: 是否启用 tools.description 截断。关闭时不会按长度截断,仅做清理/规范化。
# en: Enable truncation for tools.description. If disabled, no length-based truncation is applied.
description_truncate_enabled = false
# zh: description 最大长度(仅在开启 description_truncate_enabled 时生效)。
# en: Description max length (used only when description_truncate_enabled is enabled).
description_max_len = 1024
# zh: 是否输出逐条清洗详情日志(INFO)。
# en: Log per-item sanitization details (INFO).
sanitize_verbose = false
# zh: 日志中 description 预览长度。
# en: Description preview length in logs.
description_preview_len = 160
# zh: 功能开关。
# en: Feature flags.
[features]
# zh: 是否启用 NagaAgent 模式:
# zh: - true: 使用 `res/prompts/undefined_nagaagent.xml`,并向模型暴露/允许调用相关 Agent
# zh: - false: 使用 `res/prompts/undefined.xml`,并隐藏/禁用相关 Agent(避免无关提及)
# en: Enable NagaAgent mode:
# en: - true: use `res/prompts/undefined_nagaagent.xml` and expose related agents
# en: - false: use `res/prompts/undefined.xml` and hide/disable related agents
nagaagent_mode_enabled = false
# zh: 多模型池全局开关(关闭后所有多模型功能禁用,行为与原版一致)。无特殊需求不建议启用。
# en: Global model pool switch. When disabled, all multi-model features are disabled. Not recommended unless you have specific needs.
pool_enabled = false
# zh: 彩蛋功能(可选)。
# en: Easter egg features (optional)
[easter_egg]
# zh: 彩蛋提示发送模式。模式:"none"(关闭)/"agent"(主 AI 调用 Agent 时发送)/"tools"(主 AI 或 Agent 调用 Tool 时发送,含虚拟 tool_search)/"clean"(过滤自动预取、send_message、end 等噪声,但提示正常 tool_search)/"all"(包括 Agent 内部调用其子工具即 "agent_tool" 的场景也发送)。默认:"none"。
# en: Easter-egg announcement mode. Modes: "none" (off) / "agent" (send when the main AI calls an Agent) / "tools" (send when the main AI or an Agent calls a Tool, including virtual tool_search) / "clean" (filter automatic prefetch, send_message, and end noise while still announcing normal tool_search calls) / "all" (also send when an Agent internally calls its sub-tools, i.e. "agent_tool"). Default: "none".
agent_call_message_enabled = "none"
# zh: 是否启用群聊关键词("心理委员")自动回复。
# en: Enable keyword auto-replies("心理委员") in group chats.
keyword_reply_enabled = false
# zh: 是否启用群聊复读功能(连续 N 条相同消息时复读,N 由 repeat_threshold 控制;若期间有 bot 自身发言则重置链)。
# en: Enable repeat feature in group chats (repeat when N consecutive identical messages arrive, N set by repeat_threshold; resets if bot itself sent the same text in between).
repeat_enabled = false
# zh: 复读触发所需的连续相同消息条数(来自不同发送者),范围 2–20,默认 3。
# en: Number of consecutive identical messages (from different senders) required to trigger repeat, range 2–20, default 3.
repeat_threshold = 3
# zh: 复读冷却时间(分钟)。同一内容被复读后,在冷却时间内不再重复复读。0 = 无冷却。问号类消息(?/?)视为等价。
# en: Repeat cooldown (minutes). After repeating the same content, won't repeat it again within this cooldown. 0 = no cooldown. Question marks (?/?) are treated as equivalent.
repeat_cooldown_minutes = 60
# zh: 是否启用倒问号(复读触发时,若消息为问号则发送倒问号 ¿)。
# en: Enable inverted question mark (when repeat triggers on "?" messages, send "¿" instead).
inverted_question_enabled = false
# zh: 同 sender 短时多消息合并器。把同一用户在短时间内连续发送的多条消息合并到同一轮 AI 触发,避免重复回复 / 行为打架。
# en: Same-sender short-window message batcher. Merges several messages a single user sends in quick succession into one AI turn to avoid duplicate replies / conflicting actions.
[message_batcher]
# zh: 是否启用合并器(关闭后所有消息按现行流程逐条触发 AI)。
# en: Enable the batcher (when disabled all messages trigger the AI individually as before).
enabled = true
# zh: 等待窗口(秒)。期间同一用户发的新消息合并到同一批;<= 0 等同于关闭。
# en: Wait window in seconds. New messages from the same sender within this window are merged; <= 0 disables the feature.
window_seconds = 5.0
# zh: 等待策略:extend(每来一条新消息重置 timer,"打字就继续等")/ fixed(首条到达起定时,期间到达的消息只合并不重置)。
# en: Wait strategy: extend (reset timer on each new message; keeps waiting while the user types) / fixed (timer fixed at the first message; new arrivals only merge but do not reset).
strategy = "extend"
# zh: extend 模式下的硬顶(秒),防止用户一直打字导致永远不发车;0 = 不限制(仅靠 window_seconds + max_messages_per_batch 触发发车)。
# en: Hard cap in seconds for extend mode, prevents the timer from being reset forever; 0 = no limit (rely on window_seconds + max_messages_per_batch).
max_window_seconds = 30.0
# zh: 单批最多消息条数,超出立即发车;0 = 不限制。
# en: Max messages per batch; exceeding triggers immediate dispatch. 0 = no limit.
max_messages_per_batch = 0
# zh: 是否在群聊启用合并。
# en: Enable batching in group chats.
group_enabled = true
# zh: 是否在私聊启用合并。
# en: Enable batching in private chats.
private_enabled = true
# zh: 收到斜杠命令时是否顺便把当前 buffer 一起发出(默认 false:命令独立执行,buffer 继续等到时间到再发)。
# en: When a slash command arrives, also flush the current buffer to the AI (default false: commands are executed independently and the buffer keeps waiting).
flush_on_command = false
# zh: 投机预发送阈值(秒)。0 < pre_send_seconds < window_seconds 时启用:静默到该阈值就提前把当前 batch 发给 LLM 抢时间,但 batch 不结束;T1(window_seconds)才正式结束。0 或 >= window_seconds 视为关闭。
# en: Speculative pre-fire threshold in seconds. Enabled when 0 < pre_send_seconds < window_seconds: once the user has been silent that long, the current batch is dispatched to the LLM early to save latency, while the batch itself only ends at window_seconds. 0 or >= window_seconds disables speculation.
pre_send_seconds = 0.0
# zh: 投机调用已经向用户发出过任何消息后,新消息到达是否仍然取消该 inflight 调用。默认 false(安全:不取消,新消息开新 batch),开启后可能造成重复发送。
# en: Whether to cancel an in-flight speculative LLM call even when it has already sent at least one message to the user. Default false (safe: do not cancel; the new message starts a new batch). Enabling this may cause duplicate replies.
allow_cancel_after_send = false
# zh: 条件驱动自动化(青春版工作流)。消息命中后可接管本轮 AI;时间类仍走 APScheduler。
# en: Condition-driven automations (lightweight workflows). A matching inbound event can consume the AI loop; time triggers still use APScheduler.
[automations]
# zh: 总开关。关闭后不匹配事件、时间任务进入后也会直接跳过。
# en: Master switch. When false, events are not matched and time jobs return immediately.
enabled = true
# zh: 单张图最多节点数(含 start / 分支 / 循环体),建议 30。
# en: Max nodes per graph including start, branches and loop bodies. Suggested 30.
max_nodes = 30
# zh: 同时运行的自动化上限。支持热更新;调小不会取消正在运行的工作流,而是等待并发自然收敛。
# en: Max concurrent automation runs. Hot-reloadable; lowering it lets active runs drain without cancellation.
max_concurrent = 16
# zh: 单个节点超时(秒)。
# en: Per-node timeout in seconds.
node_timeout_seconds = 600.0
# zh: 整张图超时(秒)。
# en: Whole-graph timeout in seconds.
workflow_timeout_seconds = 1200.0
# zh: llm.blank 工具迭代上限。
# en: Max tool-calling iterations for llm.blank nodes.
blank_llm_max_iterations = 100
# zh: 循环迭代上限,默认 25;仅保留下限 1,可按需调大。节点可用 max_iterations 收窄。
# en: Loop iteration cap. Defaults to 25 with a floor of 1 and no built-in maximum. Nodes can lower it via max_iterations.
loop_max_iterations = 25
# zh: 事件类自动化默认冷却(秒)。0 表示不冷却。时间类默认不冷却。
# en: Default cooldown in seconds for event automations. 0 disables cooldown. Time triggers default to no cooldown.
default_cooldown_seconds = 0
# zh: 历史记录配置。
# en: History settings.
[history]
# zh: 每个会话最多保留的消息条数(0 = 无限制,注意内存占用)。
# en: Max messages to keep per conversation (0 = unlimited, mind memory usage).
max_records = 10000
# zh: 工具过滤查询返回的最大消息条数。
# en: Max messages returned by tool filtered queries.
filtered_result_limit = 200
# zh: 工具过滤搜索时扫描的最大消息条数。
# en: Max messages to scan when tools perform filtered searches.
search_scan_limit = 10000
# zh: /summary 按条数拉取时的最大消息条数(可配置,无固定 500 上限;受 max_records 约束)。
# en: Max messages fetched per /summary count request (configurable; no fixed 500 cap; bounded by max_records).
summary_fetch_limit = 1000
# zh: /summary 按时间范围查询时的最大扫描条数(可配置)。
# en: Max messages scanned for /summary time-range queries (configurable).
summary_time_fetch_limit = 5000
# zh: OneBot API 回退获取的最大消息条数。
# en: Max messages to fetch via OneBot API fallback.
onebot_fetch_limit = 10000
# zh: 群分析工具的消息/成员返回上限。
# en: Max messages/members returned by group analysis tools.
group_analysis_limit = 500
# zh: 附件缓存配置。
# en: Attachment cache settings.
[attachments]
# zh: 是否让远程附件下载/回源使用 [proxy] 代理地址。默认关闭。
# en: Whether remote attachment downloads/backfills use proxy addresses from [proxy]. Disabled by default.
use_proxy = false
# zh: 远程附件自动下载并缓存的最大大小(MB)。超过上限或设为 0 时只保留 URL 引用,不下载文件内容。
# en: Max remote attachment size (MB) to download into cache. Above the limit, or 0, keeps only a URL reference.
remote_download_max_size_mb = 25