-
Notifications
You must be signed in to change notification settings - Fork 54.3k
Expand file tree
/
Copy pathconfig_registry.py
More file actions
2168 lines (2135 loc) · 74.6 KB
/
Copy pathconfig_registry.py
File metadata and controls
2168 lines (2135 loc) · 74.6 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
# -*- coding: utf-8 -*-
"""Configuration field metadata registry.
This module is the single source of truth for configuration UI metadata,
validation hints, and category grouping.
"""
from __future__ import annotations
from copy import deepcopy
from typing import Any, Dict, List, Optional
from src.config import AGENT_MAX_STEPS_DEFAULT
SCHEMA_VERSION = "2026-05-05"
_CATEGORY_DEFINITIONS: List[Dict[str, Any]] = [
{
"category": "base",
"title": "Base Settings",
"description": "Watchlist and foundational application settings.",
"display_order": 10,
},
{
"category": "ai_model",
"title": "AI Model",
"description": "Model providers, model names, and inference parameters.",
"display_order": 20,
},
{
"category": "data_source",
"title": "Data Source",
"description": "Market data provider credentials and priority settings.",
"display_order": 30,
},
{
"category": "notification",
"title": "Notification",
"description": "Bot, webhook, and push channel related settings.",
"display_order": 40,
},
{
"category": "system",
"title": "System",
"description": "Runtime and scheduling controls.",
"display_order": 50,
},
{
"category": "agent",
"title": "Agent",
"description": "Agent mode and strategy-skill settings.",
"display_order": 55,
},
{
"category": "backtest",
"title": "Backtest",
"description": "Backtest engine behavior and evaluation parameters.",
"display_order": 60,
},
{
"category": "uncategorized",
"title": "Uncategorized",
"description": "Keys not mapped in the field registry.",
"display_order": 99,
},
]
_FIELD_DEFINITIONS: Dict[str, Dict[str, Any]] = {
"STOCK_LIST": {
"title": "Stock List",
"description": "Comma-separated watchlist stock codes.",
"category": "base",
"data_type": "array",
"ui_control": "textarea",
"is_sensitive": False,
"is_required": False,
"is_editable": True,
"default_value": "600519,300750,002594",
"options": [],
"validation": {"min_items": 1},
"display_order": 10,
"help_key": "settings.base.STOCK_LIST",
"examples": [
"STOCK_LIST=600519,300750,002594",
"STOCK_LIST=600519,hk00700,AAPL",
],
"docs": [
{
"label": "完整指南:环境变量完整列表",
"href": "https://github.com/ZhuLinsen/daily_stock_analysis/blob/main/docs/full-guide.md#环境变量完整列表",
},
{
"label": "Tushare 股票列表指南",
"href": "https://github.com/ZhuLinsen/daily_stock_analysis/blob/main/docs/TUSHARE_STOCK_LIST_GUIDE.md",
},
],
"warning_codes": [],
},
# ------------------------------------------------------------------
# AI Model – LiteLLM unified config
# ------------------------------------------------------------------
"LITELLM_MODEL": {
"title": "Primary Model",
"description": "Primary model in provider/model format (e.g. gemini/gemini-3.1-pro-preview, deepseek/deepseek-v4-flash, anthropic/claude-sonnet-4-6). If empty, it is auto-inferred from available API keys or channel declarations.",
"category": "ai_model",
"data_type": "string",
"ui_control": "text",
"is_sensitive": False,
"is_required": False,
"is_editable": True,
"default_value": None,
"options": [],
"validation": {},
"display_order": 1,
"help_key": "settings.ai_model.LITELLM_MODEL",
"examples": [
"LITELLM_MODEL=deepseek/deepseek-v4-flash",
"LITELLM_MODEL=gemini/gemini-3.1-pro-preview",
"LITELLM_MODEL=ollama/qwen3:8b",
],
"docs": [
{
"label": "LLM 配置指南",
"href": "https://github.com/ZhuLinsen/daily_stock_analysis/blob/main/docs/LLM_CONFIG_GUIDE.md",
},
{
"label": "完整指南:AI 模型配置",
"href": "https://github.com/ZhuLinsen/daily_stock_analysis/blob/main/docs/full-guide.md#ai-模型配置",
},
],
"warning_codes": ["provider_prefix_required"],
},
"AGENT_LITELLM_MODEL": {
"title": "Agent Primary Model",
"description": "Optional Agent-only primary model in provider/model format. When empty, Agent inherits the primary model. Bare model names are normalized to openai/<model>.",
"category": "ai_model",
"data_type": "string",
"ui_control": "text",
"is_sensitive": False,
"is_required": False,
"is_editable": True,
"default_value": None,
"options": [],
"validation": {},
"display_order": 2,
},
"LITELLM_FALLBACK_MODELS": {
"title": "Fallback Models",
"description": "Comma-separated fallback models tried when the primary model fails (e.g. anthropic/claude-sonnet-4-6,openai/gpt-5.4-mini). Useful for cross-provider redundancy.",
"category": "ai_model",
"data_type": "string",
"ui_control": "text",
"is_sensitive": False,
"is_required": False,
"is_editable": True,
"default_value": None,
"options": [],
"validation": {},
"display_order": 2,
},
# ------------------------------------------------------------------
# AI Model – Multi-channel LLM configuration
# ------------------------------------------------------------------
"LITELLM_CONFIG": {
"title": "Advanced Model Routing Config",
"description": "Path to an advanced model routing YAML file (expert use). When valid/parseable and yields a model_list, it takes priority over channels and legacy keys; otherwise channels/legacy are used as fallback.",
"category": "ai_model",
"data_type": "string",
"ui_control": "text",
"is_sensitive": False,
"is_required": False,
"is_editable": True,
"default_value": None,
"options": [],
"validation": {},
"display_order": 3,
},
"LLM_CHANNELS": {
"title": "LLM Channels",
"description": "Channel names (comma-separated). Managed by the channel editor above.",
"category": "ai_model",
"data_type": "string",
"ui_control": "text",
"is_sensitive": False,
"is_required": False,
"is_editable": True,
"default_value": None,
"options": [],
"validation": {},
"display_order": 4,
"help_key": "settings.ai_model.LLM_CHANNELS",
"examples": [
"LLM_CHANNELS=deepseek,aihubmix",
"LLM_DEEPSEEK_BASE_URL=https://api.deepseek.com",
"LLM_DEEPSEEK_API_KEY=sk-xxxx",
"LLM_DEEPSEEK_MODELS=deepseek-v4-flash,deepseek-v4-pro",
],
"docs": [
{
"label": "LLM 配置指南:渠道模式",
"href": "https://github.com/ZhuLinsen/daily_stock_analysis/blob/main/docs/LLM_CONFIG_GUIDE.md#方式二渠道channels模式配置适合进阶多模型",
},
{
"label": "LLM 服务商配置速查",
"href": "https://github.com/ZhuLinsen/daily_stock_analysis/blob/main/docs/llm-providers.md",
},
],
"warning_codes": ["channels_override_legacy_keys"],
},
"LLM_TEMPERATURE": {
"title": "Temperature",
"description": "Unified sampling temperature for all LLM calls. Range [0.0, 2.0], default 0.7.",
"category": "ai_model",
"data_type": "number",
"ui_control": "number",
"is_sensitive": False,
"is_required": False,
"is_editable": True,
"default_value": "0.7",
"options": [],
"validation": {"min": 0.0, "max": 2.0},
"display_order": 5,
},
"AIHUBMIX_KEY": {
"title": "AIHubmix Key",
"description": "AIHubmix one-stop API key – access all mainstream models with a single key, no VPN required. Auto-sets base URL to aihubmix.com/v1. Get key: https://aihubmix.com/?aff=CfMq",
"category": "ai_model",
"data_type": "string",
"ui_control": "password",
"is_sensitive": True,
"is_required": False,
"is_editable": True,
"default_value": None,
"options": [],
"validation": {},
"display_order": 5,
},
"ANSPIRE_LLM_ENABLED": {
"title": "Anspire LLM Enabled",
"description": "Use ANSPIRE_API_KEYS as an OpenAI-compatible Anspire LLM key when no higher-priority LLM channel or OpenAI-compatible key is configured.",
"category": "ai_model",
"data_type": "boolean",
"ui_control": "switch",
"is_sensitive": False,
"is_required": False,
"is_editable": True,
"default_value": "true",
"options": [],
"validation": {},
"display_order": 6,
},
"ANSPIRE_LLM_BASE_URL": {
"title": "Anspire LLM Base URL",
"description": "Anspire OpenAI-compatible gateway. Default: https://open-gateway.anspire.cn/v6; global endpoint: https://open-gateway.anspire.ai/v6.",
"category": "ai_model",
"data_type": "string",
"ui_control": "text",
"is_sensitive": False,
"is_required": False,
"is_editable": True,
"default_value": "https://open-gateway.anspire.cn/v6",
"options": [],
"validation": {"format": "url"},
"display_order": 7,
},
"ANSPIRE_LLM_MODEL": {
"title": "Anspire LLM Model",
"description": "Default model used when ANSPIRE_API_KEYS enables the Anspire LLM gateway without an explicit LITELLM_MODEL.",
"category": "ai_model",
"data_type": "string",
"ui_control": "text",
"is_sensitive": False,
"is_required": False,
"is_editable": True,
"default_value": "Doubao-Seed-2.0-lite",
"options": [],
"validation": {},
"display_order": 8,
},
# ------------------------------------------------------------------
# AI Model – DeepSeek official (independent from OpenAI-compatible)
# ------------------------------------------------------------------
"DEEPSEEK_API_KEY": {
"title": "DeepSeek API Key",
"description": "Official DeepSeek API key (from https://platform.deepseek.com). For compatibility, a key set alone still auto-infers deepseek/deepseek-chat and logs a deprecation warning; new configs should migrate to deepseek/deepseek-v4-flash. Also works in multi-channel mode.",
"category": "ai_model",
"data_type": "string",
"ui_control": "password",
"is_sensitive": True,
"is_required": False,
"is_editable": True,
"default_value": None,
"options": [],
"validation": {},
"display_order": 6,
},
"DEEPSEEK_API_KEYS": {
"title": "DeepSeek API Keys (Multi)",
"description": "Comma-separated DeepSeek API keys for load balancing. Takes priority over DEEPSEEK_API_KEY.",
"category": "ai_model",
"data_type": "string",
"ui_control": "password",
"is_sensitive": True,
"is_required": False,
"is_editable": True,
"default_value": None,
"options": [],
"validation": {"multi_value": True, "delimiter": ","},
"display_order": 7,
},
"TUSHARE_TOKEN": {
"title": "Tushare Token",
"description": "Token for Tushare Pro API.",
"category": "data_source",
"data_type": "string",
"ui_control": "password",
"is_sensitive": True,
"is_required": False,
"is_editable": True,
"default_value": None,
"options": [],
"validation": {},
"display_order": 10,
},
"TICKFLOW_API_KEY": {
"title": "TickFlow API Key",
"description": "API key for TickFlow market review enhancement (A-share indices, plus market stats when universe queries are enabled).",
"category": "data_source",
"data_type": "string",
"ui_control": "password",
"is_sensitive": True,
"is_required": False,
"is_editable": True,
"default_value": None,
"options": [],
"validation": {},
"display_order": 15,
},
"REALTIME_SOURCE_PRIORITY": {
"title": "Realtime Source Priority",
"description": "Comma-separated priority for realtime quote providers.",
"category": "data_source",
"data_type": "string",
"ui_control": "text",
"is_sensitive": False,
"is_required": False,
"is_editable": True,
"default_value": "tencent,akshare_sina,efinance,akshare_em",
"options": [],
"validation": {},
"display_order": 20,
},
"ENABLE_REALTIME_TECHNICAL_INDICATORS": {
"title": "Realtime Technical Indicators",
"description": "Use intraday realtime price for MA5/MA10/MA20 and trend analysis (Issue #234). Disable to use yesterday close.",
"category": "data_source",
"data_type": "boolean",
"ui_control": "switch",
"is_sensitive": False,
"is_required": False,
"is_editable": True,
"default_value": "true",
"options": [],
"validation": {},
"display_order": 21,
},
"ANSPIRE_API_KEYS": {
"title": "Anspire API Keys",
"description": "Comma-separated Anspire Open API keys. Used by Anspire Search and, by default, the Anspire OpenAI-compatible LLM gateway.",
"category": "data_source",
"data_type": "string",
"ui_control": "password",
"is_sensitive": True,
"is_required": False,
"is_editable": True,
"default_value": None,
"options": [],
"validation": {"multi_value": True, "delimiter": ","},
"display_order": 22,
},
"TAVILY_API_KEYS": {
"title": "Tavily API Keys",
"description": "Comma-separated Tavily API keys.",
"category": "data_source",
"data_type": "string",
"ui_control": "password",
"is_sensitive": True,
"is_required": False,
"is_editable": True,
"default_value": None,
"options": [],
"validation": {"multi_value": True, "delimiter": ","},
"display_order": 30,
},
"SERPAPI_API_KEYS": {
"title": "SerpAPI Keys",
"description": "Comma-separated SerpAPI keys.",
"category": "data_source",
"data_type": "string",
"ui_control": "password",
"is_sensitive": True,
"is_required": False,
"is_editable": True,
"default_value": None,
"options": [],
"validation": {"multi_value": True, "delimiter": ","},
"display_order": 40,
},
"BRAVE_API_KEYS": {
"title": "Brave API Keys",
"description": "Comma-separated Brave Search API keys.",
"category": "data_source",
"data_type": "string",
"ui_control": "password",
"is_sensitive": True,
"is_required": False,
"is_editable": True,
"default_value": None,
"options": [],
"validation": {"multi_value": True, "delimiter": ","},
"display_order": 50,
},
"BOCHA_API_KEYS": {
"title": "Bocha API Keys",
"description": "Comma-separated Bocha Search API keys.",
"category": "data_source",
"data_type": "string",
"ui_control": "password",
"is_sensitive": True,
"is_required": False,
"is_editable": True,
"default_value": None,
"options": [],
"validation": {"multi_value": True, "delimiter": ","},
"display_order": 51,
},
"MINIMAX_API_KEYS": {
"title": "MiniMax API Key",
"description": "MiniMax API key (search priority: Bocha > Tavily > Brave > SerpAPI > MiniMax > SearXNG).",
"category": "data_source",
"data_type": "string",
"ui_control": "password",
"is_sensitive": True,
"is_required": False,
"is_editable": True,
"default_value": None,
"options": [],
"validation": {"multi_value": True, "delimiter": ","},
"display_order": 53,
},
"SEARXNG_BASE_URLS": {
"title": "SearXNG Base URLs",
"description": "Comma-separated SearXNG instance URLs (self-hosted, no quota). Enable format: json in settings.yml.",
"category": "data_source",
"data_type": "string",
"ui_control": "text",
"is_sensitive": False,
"is_required": False,
"is_editable": True,
"default_value": None,
"options": [],
"validation": {
"multi_value": True,
"delimiter": ",",
"item_type": "url",
"allowed_schemes": ["http", "https"],
},
"display_order": 52,
},
"SEARXNG_PUBLIC_INSTANCES_ENABLED": {
"title": "SearXNG Public Instances",
"description": "Auto-discover public SearXNG instances from searx.space when SEARXNG_BASE_URLS is empty. Default: true; set false to disable.",
"category": "data_source",
"data_type": "boolean",
"ui_control": "switch",
"is_sensitive": False,
"is_required": False,
"is_editable": True,
"default_value": "true",
"options": [],
"validation": {},
"display_order": 53,
},
"ENABLE_REALTIME_QUOTE": {
"title": "Enable Realtime Quote",
"description": "Enable realtime market quotes. Disable to only use historical close prices.",
"category": "data_source",
"data_type": "boolean",
"ui_control": "switch",
"is_sensitive": False,
"is_required": False,
"is_editable": True,
"default_value": "true",
"options": [],
"validation": {},
"display_order": 22,
},
"ENABLE_CHIP_DISTRIBUTION": {
"title": "Enable Chip Distribution",
"description": "Enable chip distribution analysis. May be unstable; recommended to disable on cloud deployments.",
"category": "data_source",
"data_type": "boolean",
"ui_control": "switch",
"is_sensitive": False,
"is_required": False,
"is_editable": True,
"default_value": "true",
"options": [],
"validation": {},
"display_order": 23,
},
"NEWS_MAX_AGE_DAYS": {
"title": "News Max Age (Days)",
"description": "Maximum age of news in days. Older articles are excluded from analysis context.",
"category": "data_source",
"data_type": "integer",
"ui_control": "number",
"is_sensitive": False,
"is_required": False,
"is_editable": True,
"default_value": "3",
"options": [],
"validation": {"min": 1, "max": 30},
"display_order": 60,
},
"NEWS_STRATEGY_PROFILE": {
"title": "News Strategy Profile",
"description": "News window profile: ultra_short(1d), short(3d), medium(7d), long(30d). Effective window = min(profile, NEWS_MAX_AGE_DAYS).",
"category": "data_source",
"data_type": "string",
"ui_control": "select",
"is_sensitive": False,
"is_required": False,
"is_editable": True,
"default_value": "short",
"options": ["ultra_short", "short", "medium", "long"],
"validation": {"enum": ["ultra_short", "short", "medium", "long"]},
"display_order": 61,
},
"BIAS_THRESHOLD": {
"title": "Bias Threshold (%)",
"description": "Deviation threshold from MA5 (%). Exceeding this triggers 'do not chase' warning. Strong trend stocks auto-widen to 1.5x.",
"category": "data_source",
"data_type": "number",
"ui_control": "number",
"is_sensitive": False,
"is_required": False,
"is_editable": True,
"default_value": "5.0",
"options": [],
"validation": {"min": 0.0, "max": 50.0},
"display_order": 62,
},
"PYTDX_HOST": {
"title": "Pytdx Host",
"description": "Tongdaxin data server IP. Used with PYTDX_PORT. Overrides built-in defaults.",
"category": "data_source",
"data_type": "string",
"ui_control": "text",
"is_sensitive": False,
"is_required": False,
"is_editable": True,
"default_value": None,
"options": [],
"validation": {},
"display_order": 55,
},
"PYTDX_PORT": {
"title": "Pytdx Port",
"description": "Tongdaxin data server port (e.g. 7709). Used with PYTDX_HOST.",
"category": "data_source",
"data_type": "string",
"ui_control": "text",
"is_sensitive": False,
"is_required": False,
"is_editable": True,
"default_value": None,
"options": [],
"validation": {},
"display_order": 56,
},
"PYTDX_SERVERS": {
"title": "Pytdx Servers",
"description": "Comma-separated ip:port (e.g. 192.168.1.1:7709,10.0.0.1:7709). Overrides PYTDX_HOST+PYTDX_PORT.",
"category": "data_source",
"data_type": "string",
"ui_control": "text",
"is_sensitive": False,
"is_required": False,
"is_editable": True,
"default_value": None,
"options": [],
"validation": {},
"display_order": 57,
},
"GEMINI_API_KEY": {
"title": "Gemini API Key",
"description": "Single API key for Gemini service (from https://aistudio.google.com).",
"category": "ai_model",
"data_type": "string",
"ui_control": "password",
"is_sensitive": True,
"is_required": False,
"is_editable": True,
"default_value": None,
"options": [],
"validation": {},
"display_order": 10,
},
"GEMINI_API_KEYS": {
"title": "Gemini API Keys (Multi)",
"description": "Comma-separated Gemini API keys for load balancing. Takes priority over GEMINI_API_KEY.",
"category": "ai_model",
"data_type": "string",
"ui_control": "password",
"is_sensitive": True,
"is_required": False,
"is_editable": True,
"default_value": None,
"options": [],
"validation": {"multi_value": True, "delimiter": ","},
"display_order": 11,
},
"GEMINI_MODEL": {
"title": "Gemini Model",
"description": "Gemini model name.",
"category": "ai_model",
"data_type": "string",
"ui_control": "text",
"is_sensitive": False,
"is_required": False,
"is_editable": True,
"default_value": "gemini-3.1-pro-preview",
"options": [],
"validation": {},
"display_order": 20,
},
"GEMINI_MODEL_FALLBACK": {
"title": "Gemini Fallback Model",
"description": "Fallback Gemini model name (used when LITELLM_FALLBACK_MODELS is not set and primary is Gemini).",
"category": "ai_model",
"data_type": "string",
"ui_control": "text",
"is_sensitive": False,
"is_required": False,
"is_editable": True,
"default_value": "gemini-3-flash-preview",
"options": [],
"validation": {},
"display_order": 21,
},
"GEMINI_TEMPERATURE": {
"title": "Gemini Temperature",
"description": "Temperature in range [0.0, 2.0].",
"category": "ai_model",
"data_type": "number",
"ui_control": "number",
"is_sensitive": False,
"is_required": False,
"is_editable": True,
"default_value": "0.7",
"options": [],
"validation": {"min": 0.0, "max": 2.0},
"display_order": 30,
},
"OPENAI_API_KEY": {
"title": "OpenAI API Key",
"description": "API key for OpenAI-compatible service.",
"category": "ai_model",
"data_type": "string",
"ui_control": "password",
"is_sensitive": True,
"is_required": False,
"is_editable": True,
"default_value": None,
"options": [],
"validation": {},
"display_order": 40,
},
"OPENAI_API_KEYS": {
"title": "OpenAI API Keys (Multi)",
"description": "Comma-separated OpenAI-compatible API keys for load balancing. Takes priority over AIHUBMIX_KEY and OPENAI_API_KEY.",
"category": "ai_model",
"data_type": "string",
"ui_control": "password",
"is_sensitive": True,
"is_required": False,
"is_editable": True,
"default_value": None,
"options": [],
"validation": {"multi_value": True, "delimiter": ","},
"display_order": 41,
},
"OPENAI_BASE_URL": {
"title": "OpenAI Base URL",
"description": "Base URL for OpenAI-compatible endpoint.",
"category": "ai_model",
"data_type": "string",
"ui_control": "text",
"is_sensitive": False,
"is_required": False,
"is_editable": True,
"default_value": None,
"options": [],
"validation": {},
"display_order": 50,
},
"OPENAI_MODEL": {
"title": "OpenAI Model",
"description": "Model name for OpenAI-compatible endpoint.",
"category": "ai_model",
"data_type": "string",
"ui_control": "text",
"is_sensitive": False,
"is_required": False,
"is_editable": True,
"default_value": "gpt-5.5",
"options": [],
"validation": {},
"display_order": 60,
},
"OPENAI_VISION_MODEL": {
"title": "OpenAI Vision Model",
"description": "Model for image extraction (some APIs e.g. DeepSeek lack vision). Leave empty to use OPENAI_MODEL.",
"category": "ai_model",
"data_type": "string",
"ui_control": "text",
"is_sensitive": False,
"is_required": False,
"is_editable": True,
"default_value": None,
"options": [],
"validation": {},
"display_order": 61,
},
"OPENAI_TEMPERATURE": {
"title": "OpenAI Temperature",
"description": "Temperature for OpenAI-compatible models in range [0.0, 2.0].",
"category": "ai_model",
"data_type": "number",
"ui_control": "number",
"is_sensitive": False,
"is_required": False,
"is_editable": True,
"default_value": "0.7",
"options": [],
"validation": {"min": 0.0, "max": 2.0},
"display_order": 62,
},
"ANTHROPIC_API_KEY": {
"title": "Anthropic API Key",
"description": "Anthropic Claude API key (from https://console.anthropic.com).",
"category": "ai_model",
"data_type": "string",
"ui_control": "password",
"is_sensitive": True,
"is_required": False,
"is_editable": True,
"default_value": None,
"options": [],
"validation": {},
"display_order": 35,
},
"ANTHROPIC_API_KEYS": {
"title": "Anthropic API Keys (Multi)",
"description": "Comma-separated Anthropic API keys for load balancing. Takes priority over ANTHROPIC_API_KEY.",
"category": "ai_model",
"data_type": "string",
"ui_control": "password",
"is_sensitive": True,
"is_required": False,
"is_editable": True,
"default_value": None,
"options": [],
"validation": {"multi_value": True, "delimiter": ","},
"display_order": 35,
},
"ANTHROPIC_MODEL": {
"title": "Anthropic Model",
"description": "Claude 模型名称(如 claude-sonnet-4-6)。",
"category": "ai_model",
"data_type": "string",
"ui_control": "text",
"is_sensitive": False,
"is_required": False,
"is_editable": True,
"default_value": "claude-sonnet-4-6",
"options": [],
"validation": {},
"display_order": 36,
},
"ANTHROPIC_TEMPERATURE": {
"title": "Anthropic Temperature",
"description": "温度参数,范围 [0.0, 1.0]。",
"category": "ai_model",
"data_type": "number",
"ui_control": "number",
"is_sensitive": False,
"is_required": False,
"is_editable": True,
"default_value": "0.7",
"options": [],
"validation": {"min": 0.0, "max": 1.0},
"display_order": 37,
},
"ANTHROPIC_MAX_TOKENS": {
"title": "Anthropic Max Tokens",
"description": "Anthropic API 响应最大 token 数(默认 8192)。",
"category": "ai_model",
"data_type": "number",
"ui_control": "number",
"is_sensitive": False,
"is_required": False,
"is_editable": True,
"default_value": "8192",
"options": [],
"validation": {"min": 256, "max": 8192},
"display_order": 38,
},
"WECHAT_WEBHOOK_URL": {
"title": "WeChat Webhook URL",
"description": "Webhook URL for enterprise WeChat bot.",
"category": "notification",
"data_type": "string",
"ui_control": "password",
"is_sensitive": True,
"is_required": False,
"is_editable": True,
"default_value": None,
"options": [],
"validation": {},
"display_order": 10,
},
"DINGTALK_APP_KEY": {
"title": "DingTalk App Key",
"description": "DingTalk app key.",
"category": "notification",
"data_type": "string",
"ui_control": "password",
"is_sensitive": True,
"is_required": False,
"is_editable": True,
"default_value": None,
"options": [],
"validation": {},
"display_order": 20,
},
"DINGTALK_APP_SECRET": {
"title": "DingTalk App Secret",
"description": "DingTalk app secret.",
"category": "notification",
"data_type": "string",
"ui_control": "password",
"is_sensitive": True,
"is_required": False,
"is_editable": True,
"default_value": None,
"options": [],
"validation": {},
"display_order": 30,
},
"PUSHPLUS_TOKEN": {
"title": "PushPlus Token",
"description": "Token for PushPlus notifications.",
"category": "notification",
"data_type": "string",
"ui_control": "password",
"is_sensitive": True,
"is_required": False,
"is_editable": True,
"default_value": None,
"options": [],
"validation": {},
"display_order": 40,
},
"CUSTOM_WEBHOOK_URLS": {
"title": "Custom Webhook URLs",
"description": "Comma-separated webhook URLs for custom notifications (DingTalk, Discord, Slack, etc.).",
"category": "notification",
"data_type": "array",
"ui_control": "textarea",
"is_sensitive": False,
"is_required": False,
"is_editable": True,
"default_value": None,
"options": [],
"validation": {"multi_value": True, "delimiter": ","},
"display_order": 50,
},
"CUSTOM_WEBHOOK_BEARER_TOKEN": {
"title": "Custom Webhook Bearer Token",
"description": "Bearer token for authenticated custom webhooks.",
"category": "notification",
"data_type": "string",
"ui_control": "password",
"is_sensitive": True,
"is_required": False,
"is_editable": True,
"default_value": None,
"options": [],
"validation": {},
"display_order": 51,
},
"CUSTOM_WEBHOOK_BODY_TEMPLATE": {
"title": "Custom Webhook Body Template",
"description": (
"Optional global JSON body template for custom webhooks. It is rendered before "
"URL auto-detected payloads such as Bark, Slack, or Discord, and must render to a "
"JSON object. Prefer $content_json and $title_json; raw $content and $title are "
"not JSON-escaped and can make the template invalid."
),
"category": "notification",
"data_type": "string",
"ui_control": "textarea",
"is_sensitive": False,
"is_required": False,
"is_editable": True,
"default_value": None,
"options": [],
"validation": {},
"display_order": 52,
},
"WEBHOOK_VERIFY_SSL": {
"title": "Webhook SSL Verify",
"description": "Verify HTTPS certificates for webhook requests. Set to false ONLY for self-signed certs in trusted internal networks. WARNING: Disabling allows MITM attacks—do NOT use on public networks.",
"category": "notification",
"data_type": "boolean",
"ui_control": "switch",
"is_sensitive": False,
"is_required": False,
"is_editable": True,
"default_value": "true",
"options": [],
"validation": {},
"display_order": 53,
},
"REPORT_SUMMARY_ONLY": {
"title": "Report Summary Only",
"description": "Push only analysis summary without per-stock details. Suitable for quick overview when tracking many stocks (Issue #262).",
"category": "notification",
"data_type": "boolean",
"ui_control": "switch",
"is_sensitive": False,
"is_required": False,
"is_editable": True,
"default_value": "false",
"options": [],
"validation": {},
"display_order": 53,
},
# ------------------------------------------------------------------
# Notification – Feishu
# ------------------------------------------------------------------
"FEISHU_WEBHOOK_URL": {
"title": "Feishu Webhook URL",
"description": "Feishu custom bot webhook URL for group notifications. This is the webhook push channel; FEISHU_APP_ID / FEISHU_APP_SECRET do not enable webhook delivery by themselves.",
"category": "notification",
"data_type": "string",
"ui_control": "password",
"is_sensitive": True,
"is_required": False,
"is_editable": True,
"default_value": None,
"options": [],
"validation": {
"item_type": "url",
"allowed_schemes": ["http", "https"],
},
"display_order": 12,
"help_key": "settings.notification.FEISHU_WEBHOOK_URL",
"examples": [
"FEISHU_WEBHOOK_URL=https://open.feishu.cn/open-apis/bot/v2/hook/your_hook_token",
"FEISHU_WEBHOOK_SECRET=your_feishu_webhook_secret",
"FEISHU_WEBHOOK_KEYWORD=股票日报",
],
"docs": [
{
"label": "完整指南:飞书通知配置",
"href": "https://github.com/ZhuLinsen/daily_stock_analysis/blob/main/docs/full-guide.md#飞书",
},
{
"label": "飞书机器人配置专题",
"href": "https://github.com/ZhuLinsen/daily_stock_analysis/blob/main/docs/bot/feishu-bot-config.md",
},
],
"warning_codes": ["feishu_webhook_not_app_secret"],
},
"FEISHU_WEBHOOK_SECRET": {
"title": "Feishu Webhook Secret",
"description": "Optional signing secret from Feishu custom bot security settings. Only used for webhook push mode.",
"category": "notification",
"data_type": "string",
"ui_control": "password",
"is_sensitive": True,
"is_required": False,
"is_editable": True,
"default_value": None,
"options": [],
"validation": {},
"display_order": 13,