cnhkmcp 2.2.0__py3-none-any.whl → 2.3.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cnhkmcp/__init__.py +1 -1
- cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/README.md +1 -1
- cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/config.json +2 -2
- cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/main.py +1 -1
- cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/vector_db/chroma.sqlite3 +0 -0
- cnhkmcp/untracked/APP/Tranformer/Transformer.py +2 -2
- cnhkmcp/untracked/APP/Tranformer/transformer_config.json +1 -1
- cnhkmcp/untracked/APP/blueprints/feature_engineering.py +2 -2
- cnhkmcp/untracked/APP/blueprints/inspiration_house.py +4 -4
- cnhkmcp/untracked/APP/blueprints/paper_analysis.py +3 -3
- cnhkmcp/untracked/APP/give_me_idea/BRAIN_Alpha_Template_Expert_SystemPrompt.md +34 -73
- cnhkmcp/untracked/APP/give_me_idea/alpha_data_specific_template_master.py +2 -2
- cnhkmcp/untracked/APP/give_me_idea/what_is_Alpha_template.md +366 -1
- cnhkmcp/untracked/APP/simulator/wqb20260130130030.log +210 -0
- cnhkmcp/untracked/APP/simulator/wqb20260130131757.log +104 -0
- cnhkmcp/untracked/APP/simulator/wqb20260130172245.log +70 -0
- cnhkmcp/untracked/APP/static/inspiration.js +350 -14
- cnhkmcp/untracked/APP/templates/index.html +18 -3
- cnhkmcp/untracked/APP/templates/transformer_web.html +1 -1
- cnhkmcp/untracked/APP/trailSomeAlphas/README.md +38 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/ace.log +66 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/enhance_template.py +588 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/requirements.txt +3 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/run_pipeline.py +1051 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/run_pipeline_step_by_step.ipynb +5258 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-data-feature-engineering/OUTPUT_TEMPLATE.md +325 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-data-feature-engineering/SKILL.md +503 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-data-feature-engineering/examples.md +244 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-data-feature-engineering/output_report/ASI_delay1_analyst11_ideas.md +285 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-data-feature-engineering/output_report/GLB_delay1_fundamental72_ideas.md +362 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-data-feature-engineering/reference.md +399 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/SKILL.md +40 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/config.json +6 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709385783386000.json +388 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709386274840400.json +131 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709386838244700.json +1926 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709387369198500.json +31 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709387908905800.json +1926 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709388486243600.json +240 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709389024058600.json +1926 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709389549608700.json +41 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709390068714000.json +110 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709390591996900.json +36 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709391129137100.json +31 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709391691643500.json +41 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709392192099200.json +31 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709392703423500.json +46 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709393213729400.json +246 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710186683932500.json +388 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710187165414300.json +131 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710187665211700.json +1926 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710188149193400.json +31 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710188667627400.json +1926 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710189220822000.json +240 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710189726189500.json +1926 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710190248066100.json +41 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710190768298700.json +110 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710191282588100.json +36 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710191838960900.json +31 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710192396688000.json +41 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710192941922400.json +31 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710193473524600.json +46 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710194001961200.json +246 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710420975888800.json +46 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710421647590100.json +196 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710422131378500.json +5 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710422644184400.json +196 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710423702350600.json +196 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710424244661800.json +5 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_delay1.csv +211 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/final_expressions.json +7062 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/fundamental72_GLB_delay1/final_expressions.json +138 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/fundamental72_GLB_delay1/fundamental72_GLB_1_idea_1769759441444909600.json +38 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/fundamental72_GLB_delay1/fundamental72_GLB_1_idea_1769759441920092000.json +14 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/fundamental72_GLB_delay1/fundamental72_GLB_1_idea_1769759442418767100.json +14 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/fundamental72_GLB_delay1/fundamental72_GLB_1_idea_1769759442902507600.json +14 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/fundamental72_GLB_delay1/fundamental72_GLB_1_idea_1769759443377036200.json +10 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/fundamental72_GLB_delay1/fundamental72_GLB_1_idea_1769759443845377000.json +14 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/fundamental72_GLB_delay1/fundamental72_GLB_1_idea_1769759444313546700.json +10 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/fundamental72_GLB_delay1/fundamental72_GLB_1_idea_1769759444784598600.json +14 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/fundamental72_GLB_delay1/fundamental72_GLB_1_idea_1769759445274311200.json +14 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/fundamental72_GLB_delay1/fundamental72_GLB_1_idea_1769759445747421700.json +10 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/fundamental72_GLB_delay1/fundamental72_GLB_1_idea_1769759446222137800.json +22 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/fundamental72_GLB_delay1/fundamental72_GLB_1_idea_1769759446686222600.json +14 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/fundamental72_GLB_delay1/fundamental72_GLB_1_idea_1769759447154698500.json +10 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/fundamental72_GLB_delay1/fundamental72_GLB_1_idea_1769759447629677000.json +10 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/fundamental72_GLB_delay1/fundamental72_GLB_1_idea_1769759448102331200.json +10 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/fundamental72_GLB_delay1/fundamental72_GLB_1_idea_1769759448573382000.json +14 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/fundamental72_GLB_delay1/fundamental72_GLB_delay1.csv +330 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/scripts/ace.log +3 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/scripts/ace_lib.py +1514 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/scripts/fetch_dataset.py +119 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/scripts/helpful_functions.py +180 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/scripts/implement_idea.py +236 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/scripts/merge_expression_list.py +90 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/scripts/parsetab.py +60 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/template_final_enhance/op/321/206/320/220/342/225/227/321/207/342/225/227/320/243.md +434 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/template_final_enhance/sample_prompt.md +62 -0
- cnhkmcp/untracked/APP/trailSomeAlphas/skills/template_final_enhance//321/205/320/235/320/245/321/205/320/253/320/260/321/205/320/275/320/240/321/206/320/220/320/255/321/210/320/220/320/223/321/211/320/220/342/225/227/321/210/342/225/233/320/241/321/211/320/243/342/225/233.md +354 -0
- cnhkmcp/untracked/APP/usage.md +2 -2
- cnhkmcp/untracked/APP//321/210/342/224/220/320/240/321/210/320/261/320/234/321/206/320/231/320/243/321/205/342/225/235/320/220/321/206/320/230/320/241.py +400 -9
- cnhkmcp/untracked/back_up/platform_functions.py +2 -2
- cnhkmcp/untracked/mcp/321/206/320/246/320/227/321/204/342/225/227/342/225/242/321/210/320/276/342/225/221/321/205/320/255/320/253/321/207/320/231/320/2302_/321/205/320/266/320/222/321/206/320/256/320/254/321/205/320/236/320/257/321/207/320/231/320/230/321/205/320/240/320/277/321/205/320/232/320/270/321/204/342/225/225/320/235/321/204/342/225/221/320/226/321/206/342/225/241/320/237/321/210/320/267/320/230/321/205/320/251/320/270/321/205/342/226/221/342/226/222/321/210/320/277/320/245/321/210/342/224/220/320/251/321/204/342/225/225/320/272/platform_functions.py +2 -2
- cnhkmcp/untracked/platform_functions.py +2 -2
- cnhkmcp/untracked/skills/alpha-expression-verifier/scripts/validator.py +889 -0
- cnhkmcp/untracked/skills/brain-feature-implementation/scripts/implement_idea.py +4 -3
- cnhkmcp/untracked/skills/brain-improve-alpha-performance/arXiv_API_Tool_Manual.md +490 -0
- cnhkmcp/untracked/skills/brain-improve-alpha-performance/reference.md +1 -1
- cnhkmcp/untracked/skills/brain-improve-alpha-performance/scripts/arxiv_api.py +229 -0
- cnhkmcp/untracked//321/211/320/225/320/235/321/207/342/225/234/320/276/321/205/320/231/320/235/321/210/342/224/220/320/240/321/210/320/261/320/234/321/206/320/230/320/241_/321/205/320/276/320/231/321/210/320/263/320/225/321/205/342/224/220/320/225/321/210/320/266/320/221/321/204/342/225/233/320/255/321/210/342/225/241/320/246/321/205/320/234/320/225.py +35 -11
- cnhkmcp/vector_db/_manifest.json +1 -0
- cnhkmcp/vector_db/_meta.json +1 -0
- {cnhkmcp-2.2.0.dist-info → cnhkmcp-2.3.1.dist-info}/METADATA +1 -1
- {cnhkmcp-2.2.0.dist-info → cnhkmcp-2.3.1.dist-info}/RECORD +121 -33
- /cnhkmcp/untracked/{skills/expression_verifier → APP/trailSomeAlphas/skills/brain-feature-implementation}/scripts/validator.py +0 -0
- /cnhkmcp/untracked/skills/{expression_verifier → alpha-expression-verifier}/SKILL.md +0 -0
- /cnhkmcp/untracked/skills/{expression_verifier → alpha-expression-verifier}/scripts/verify_expr.py +0 -0
- {cnhkmcp-2.2.0.dist-info → cnhkmcp-2.3.1.dist-info}/WHEEL +0 -0
- {cnhkmcp-2.2.0.dist-info → cnhkmcp-2.3.1.dist-info}/entry_points.txt +0 -0
- {cnhkmcp-2.2.0.dist-info → cnhkmcp-2.3.1.dist-info}/licenses/LICENSE +0 -0
- {cnhkmcp-2.2.0.dist-info → cnhkmcp-2.3.1.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# INFO 2026-01-30 17:22:49,713
|
|
2
|
+
<WQBSession ['13120480688@163.com']>.locate_field(...) [
|
|
3
|
+
https://api.worldquantbrain.com/data-fields/open
|
|
4
|
+
]:
|
|
5
|
+
|
|
6
|
+
# INFO 2026-01-30 17:22:49,714
|
|
7
|
+
================================================================================
|
|
8
|
+
|
|
9
|
+
# INFO 2026-01-30 17:22:49,714
|
|
10
|
+
[MULTI-SIMULATION MODE] ������multi simulation�ļ�¼����������1��multi simulation����4��alpha������轫ʵ�ʻز������Ըó������ŵõ�ʵ������ɵ�Alpha������
|
|
11
|
+
|
|
12
|
+
# INFO 2026-01-30 17:22:49,715
|
|
13
|
+
================================================================================
|
|
14
|
+
|
|
15
|
+
# INFO 2026-01-30 17:22:49,718
|
|
16
|
+
<WQBSession ['13120480688@163.com']>.concurrent_simulate(...) [start 76, 4]:
|
|
17
|
+
|
|
18
|
+
# INFO 2026-01-30 17:44:24,855
|
|
19
|
+
<WQBSession ['13120480688@163.com']>.simulate(...) [
|
|
20
|
+
https://api.worldquantbrain.com/simulations/15YZBcbcE4B1aMxjD3jpcu3
|
|
21
|
+
]: 20/76 = 26%
|
|
22
|
+
|
|
23
|
+
# INFO 2026-01-30 17:46:52,895
|
|
24
|
+
<WQBSession ['13120480688@163.com']>.simulate(...) [
|
|
25
|
+
https://api.worldquantbrain.com/simulations/PzoO99Bf4wfbzEhUeekwvL
|
|
26
|
+
]: 30/76 = 39%
|
|
27
|
+
|
|
28
|
+
# INFO 2026-01-30 17:48:49,853
|
|
29
|
+
<WQBSession ['13120480688@163.com']>.simulate(...) [
|
|
30
|
+
https://api.worldquantbrain.com/simulations/6vdWicr54SU9OJ1dYHYSfg3
|
|
31
|
+
]: 10/76 = 13%
|
|
32
|
+
|
|
33
|
+
# INFO 2026-01-30 17:54:37,062
|
|
34
|
+
<WQBSession ['13120480688@163.com']>.simulate(...) [
|
|
35
|
+
https://api.worldquantbrain.com/simulations/1F3drgbNN5hL8M5bZELyk1C
|
|
36
|
+
]: 40/76 = 52%
|
|
37
|
+
|
|
38
|
+
# INFO 2026-01-30 17:56:56,396
|
|
39
|
+
<WQBSession ['13120480688@163.com']>.simulate(...) [
|
|
40
|
+
https://api.worldquantbrain.com/simulations/15rtOTbkp4OrcgPcWQ1rJcK
|
|
41
|
+
]: 50/76 = 65%
|
|
42
|
+
|
|
43
|
+
# INFO 2026-01-30 17:59:36,465
|
|
44
|
+
<WQBSession ['13120480688@163.com']>.simulate(...) [
|
|
45
|
+
https://api.worldquantbrain.com/simulations/3SVbLF3Zx4OacvckFgIfheV
|
|
46
|
+
]: 60/76 = 78%
|
|
47
|
+
|
|
48
|
+
# INFO 2026-01-30 18:02:46,857
|
|
49
|
+
<WQBSession ['13120480688@163.com']>.simulate(...) [
|
|
50
|
+
https://api.worldquantbrain.com/simulations/ukTG32x752c8MW17tijgsFQ
|
|
51
|
+
]: 70/76 = 92%
|
|
52
|
+
|
|
53
|
+
# WARNING 2026-01-30 18:51:11,588
|
|
54
|
+
<WQBSession ['13120480688@163.com']>.retry(...) [max 600 tries ran out]
|
|
55
|
+
self.request(method, url, *args, **kwargs):
|
|
56
|
+
method: GET
|
|
57
|
+
url: https://api.worldquantbrain.com/simulations/3kUMOidgT4vF9EakLKTDgzK
|
|
58
|
+
args: ()
|
|
59
|
+
kwargs: {}
|
|
60
|
+
<Response [200]>:
|
|
61
|
+
status_code: 200
|
|
62
|
+
reason: OK
|
|
63
|
+
url: https://api.worldquantbrain.com/simulations/3kUMOidgT4vF9EakLKTDgzK
|
|
64
|
+
elapsed: 0:00:00.344926
|
|
65
|
+
headers: {'Date': 'Fri, 30 Jan 2026 10:51:13 GMT', 'Content-Type': 'application/json', 'Content-Length': '16', 'Connection': 'keep-alive', 'Retry-After': '5.0', 'Allow': 'GET, DELETE, HEAD, OPTIONS', 'X-Request-Id': 'f0b2b42879734ca383d94bd3bf29f02d', 'X-Frame-Options': 'SAMEORIGIN', 'Vary': 'Accept-Language, Cookie, Origin', 'Content-Language': 'en', 'Access-Control-Allow-Origin': 'https://platform.worldquantbrain.com', 'Access-Control-Allow-Credentials': 'true', 'Access-Control-Expose-Headers': 'Location,Retry-After', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'}
|
|
66
|
+
text: {"progress":0.1}
|
|
67
|
+
|
|
68
|
+
# INFO 2026-01-30 18:51:11,589
|
|
69
|
+
<WQBSession ['13120480688@163.com']>.concurrent_simulate(...) [finish 76, 4]:
|
|
70
|
+
|
|
@@ -7,11 +7,15 @@ let inspirationState = {
|
|
|
7
7
|
isLoggedIn: false,
|
|
8
8
|
llmConfig: {
|
|
9
9
|
baseUrl: "https://api.moonshot.cn/v1",
|
|
10
|
-
model: "kimi-k2
|
|
10
|
+
model: "kimi-k2.5",
|
|
11
11
|
apiKey: ""
|
|
12
12
|
},
|
|
13
13
|
options: null,
|
|
14
|
-
selectedDataset: null
|
|
14
|
+
selectedDataset: null,
|
|
15
|
+
selectedDatasetCategory: null,
|
|
16
|
+
pipelineTaskId: null,
|
|
17
|
+
pipelineEventSource: null,
|
|
18
|
+
enhanceTaskId: null
|
|
15
19
|
};
|
|
16
20
|
|
|
17
21
|
document.addEventListener('DOMContentLoaded', function() {
|
|
@@ -27,11 +31,34 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
|
27
31
|
document.getElementById('inspire-download').addEventListener('click', downloadInspirationResult);
|
|
28
32
|
document.getElementById('inspire-new-task').addEventListener('click', resetInspirationTask);
|
|
29
33
|
document.getElementById('inspire-close').addEventListener('click', closeInspirationModal);
|
|
34
|
+
const directBtn = document.getElementById('inspire-direct');
|
|
35
|
+
if (directBtn) {
|
|
36
|
+
directBtn.addEventListener('click', runDirectAlphaPipeline);
|
|
37
|
+
}
|
|
38
|
+
const directDlBtn = document.getElementById('inspire-direct-download');
|
|
39
|
+
if (directDlBtn) {
|
|
40
|
+
directDlBtn.addEventListener('click', downloadPipelineZip);
|
|
41
|
+
}
|
|
30
42
|
|
|
31
43
|
const testBtn = document.getElementById('inspire-test-llm');
|
|
32
44
|
if (testBtn) {
|
|
33
45
|
testBtn.addEventListener('click', testLLMConnection);
|
|
34
46
|
}
|
|
47
|
+
const enhanceBtn = document.getElementById('inspire-enhance');
|
|
48
|
+
if (enhanceBtn) {
|
|
49
|
+
enhanceBtn.addEventListener('click', () => {
|
|
50
|
+
const input = document.getElementById('inspire-idea-file');
|
|
51
|
+
if (input) input.click();
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
const enhanceInput = document.getElementById('inspire-idea-file');
|
|
55
|
+
if (enhanceInput) {
|
|
56
|
+
enhanceInput.addEventListener('change', handleEnhanceFile);
|
|
57
|
+
}
|
|
58
|
+
const enhanceDlBtn = document.getElementById('inspire-enhance-download');
|
|
59
|
+
if (enhanceDlBtn) {
|
|
60
|
+
enhanceDlBtn.addEventListener('click', downloadEnhanceZip);
|
|
61
|
+
}
|
|
35
62
|
|
|
36
63
|
// Initially disable generate button until tested
|
|
37
64
|
const genBtn = document.getElementById('inspire-generate');
|
|
@@ -47,7 +74,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
|
47
74
|
newTaskBtn.style.opacity = '0.5';
|
|
48
75
|
newTaskBtn.style.cursor = 'not-allowed';
|
|
49
76
|
}
|
|
50
|
-
|
|
77
|
+
|
|
51
78
|
// Check login status periodically or on load to update button state
|
|
52
79
|
checkLoginAndUpdateButton();
|
|
53
80
|
});
|
|
@@ -71,20 +98,26 @@ function checkLoginAndUpdateButton() {
|
|
|
71
98
|
if (btn) {
|
|
72
99
|
btn.style.opacity = '1';
|
|
73
100
|
btn.style.cursor = 'pointer';
|
|
74
|
-
|
|
101
|
+
btn.disabled = false;
|
|
75
102
|
}
|
|
76
103
|
} else {
|
|
77
104
|
inspirationState.isLoggedIn = false;
|
|
78
105
|
if (btn) {
|
|
79
|
-
|
|
80
|
-
btn.style.
|
|
81
|
-
btn.
|
|
106
|
+
btn.style.opacity = '0.5';
|
|
107
|
+
btn.style.cursor = 'not-allowed';
|
|
108
|
+
btn.disabled = true;
|
|
82
109
|
}
|
|
83
110
|
}
|
|
84
|
-
// Always ensure it's enabled
|
|
85
|
-
if (btn) btn.disabled = false;
|
|
86
111
|
})
|
|
87
|
-
.catch(err =>
|
|
112
|
+
.catch(err => {
|
|
113
|
+
console.error("Error checking login status:", err);
|
|
114
|
+
const btn = document.getElementById('inspirationBtn');
|
|
115
|
+
if (btn) {
|
|
116
|
+
btn.disabled = true;
|
|
117
|
+
btn.style.opacity = '0.5';
|
|
118
|
+
btn.style.cursor = 'not-allowed';
|
|
119
|
+
}
|
|
120
|
+
});
|
|
88
121
|
}
|
|
89
122
|
|
|
90
123
|
// Expose this function globally so other scripts (like brain.js) can call it after login
|
|
@@ -114,7 +147,6 @@ function openInspirationModal() {
|
|
|
114
147
|
document.getElementById('inspirationModal').style.display = 'block';
|
|
115
148
|
loadInspirationOptions();
|
|
116
149
|
}
|
|
117
|
-
|
|
118
150
|
function closeInspirationModal() {
|
|
119
151
|
document.getElementById('inspirationModal').style.display = 'none';
|
|
120
152
|
}
|
|
@@ -254,7 +286,7 @@ function displayDatasetResults(datasets) {
|
|
|
254
286
|
`;
|
|
255
287
|
|
|
256
288
|
tr.addEventListener('click', function() {
|
|
257
|
-
selectDataset(ds.id);
|
|
289
|
+
selectDataset(ds.id, category);
|
|
258
290
|
});
|
|
259
291
|
|
|
260
292
|
tr.addEventListener('mouseenter', function() {
|
|
@@ -275,8 +307,9 @@ function displayDatasetResults(datasets) {
|
|
|
275
307
|
resultsDiv.appendChild(table);
|
|
276
308
|
}
|
|
277
309
|
|
|
278
|
-
function selectDataset(id) {
|
|
310
|
+
function selectDataset(id, category) {
|
|
279
311
|
inspirationState.selectedDataset = id;
|
|
312
|
+
inspirationState.selectedDatasetCategory = category || null;
|
|
280
313
|
const display = document.getElementById('inspire-selected-dataset');
|
|
281
314
|
if (display) {
|
|
282
315
|
display.textContent = "已选数据集: " + id;
|
|
@@ -311,6 +344,7 @@ function generateAlphaTemplates() {
|
|
|
311
344
|
const region = document.getElementById('inspire-region').value;
|
|
312
345
|
const delay = document.getElementById('inspire-delay').value;
|
|
313
346
|
const universe = document.getElementById('inspire-universe').value;
|
|
347
|
+
const dataType = (document.getElementById('inspire-data-type') || {}).value || 'MATRIX';
|
|
314
348
|
|
|
315
349
|
const outputDiv = document.getElementById('inspire-output');
|
|
316
350
|
outputDiv.innerHTML = '正在生成模板... 这可能需要几分钟...';
|
|
@@ -321,7 +355,8 @@ function generateAlphaTemplates() {
|
|
|
321
355
|
body: JSON.stringify({
|
|
322
356
|
apiKey, baseUrl, model,
|
|
323
357
|
region, delay, universe,
|
|
324
|
-
datasetId: inspirationState.selectedDataset
|
|
358
|
+
datasetId: inspirationState.selectedDataset,
|
|
359
|
+
dataType
|
|
325
360
|
})
|
|
326
361
|
})
|
|
327
362
|
.then(res => res.json())
|
|
@@ -351,6 +386,158 @@ function generateAlphaTemplates() {
|
|
|
351
386
|
});
|
|
352
387
|
}
|
|
353
388
|
|
|
389
|
+
function runDirectAlphaPipeline() {
|
|
390
|
+
if (!inspirationState.selectedDataset) {
|
|
391
|
+
alert("请先选择一个数据集。");
|
|
392
|
+
return;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
const region = document.getElementById('inspire-region').value;
|
|
396
|
+
const delay = document.getElementById('inspire-delay').value;
|
|
397
|
+
const universe = document.getElementById('inspire-universe').value;
|
|
398
|
+
const dataType = (document.getElementById('inspire-data-type') || {}).value || 'MATRIX';
|
|
399
|
+
const dataCategory = inspirationState.selectedDatasetCategory;
|
|
400
|
+
|
|
401
|
+
if (!region || !delay || !universe) {
|
|
402
|
+
alert("请先选择区域、延迟和股票池。");
|
|
403
|
+
return;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
if (!dataCategory) {
|
|
407
|
+
alert("当前数据集没有可用的分类信息,无法运行。请重新搜索并选择数据集。");
|
|
408
|
+
return;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
const apiKey = document.getElementById('inspire-llm-key').value;
|
|
412
|
+
const baseUrl = document.getElementById('inspire-llm-url').value;
|
|
413
|
+
const model = document.getElementById('inspire-llm-model').value;
|
|
414
|
+
|
|
415
|
+
if (!apiKey) {
|
|
416
|
+
alert('请先填写 LLM API Key。');
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
const outputDiv = document.getElementById('inspire-output');
|
|
421
|
+
outputDiv.innerHTML = '<pre id="inspire-stream" style="white-space: pre-wrap; margin: 0;"></pre>';
|
|
422
|
+
|
|
423
|
+
const directBtn = document.getElementById('inspire-direct');
|
|
424
|
+
if (directBtn) {
|
|
425
|
+
directBtn.disabled = true;
|
|
426
|
+
directBtn.textContent = '正在运行...';
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
const dlBtn = document.getElementById('inspire-direct-download');
|
|
430
|
+
if (dlBtn) dlBtn.style.display = 'none';
|
|
431
|
+
|
|
432
|
+
if (inspirationState.pipelineEventSource) {
|
|
433
|
+
inspirationState.pipelineEventSource.close();
|
|
434
|
+
inspirationState.pipelineEventSource = null;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
fetch('/api/inspiration/run-pipeline', {
|
|
438
|
+
method: 'POST',
|
|
439
|
+
headers: getHeaders(),
|
|
440
|
+
body: JSON.stringify({
|
|
441
|
+
datasetId: inspirationState.selectedDataset,
|
|
442
|
+
dataCategory,
|
|
443
|
+
region,
|
|
444
|
+
delay,
|
|
445
|
+
universe,
|
|
446
|
+
dataType,
|
|
447
|
+
apiKey,
|
|
448
|
+
baseUrl,
|
|
449
|
+
model
|
|
450
|
+
})
|
|
451
|
+
})
|
|
452
|
+
.then(res => res.json())
|
|
453
|
+
.then(data => {
|
|
454
|
+
if (!data.success) {
|
|
455
|
+
outputDiv.innerHTML = '启动失败: ' + (data.error || '未知错误');
|
|
456
|
+
if (directBtn) {
|
|
457
|
+
directBtn.disabled = false;
|
|
458
|
+
directBtn.textContent = '直接来点 Alpha';
|
|
459
|
+
}
|
|
460
|
+
return;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
inspirationState.pipelineTaskId = data.taskId;
|
|
464
|
+
startPipelineStream(data.taskId);
|
|
465
|
+
})
|
|
466
|
+
.catch(err => {
|
|
467
|
+
outputDiv.innerHTML = '启动出错: ' + err;
|
|
468
|
+
if (directBtn) {
|
|
469
|
+
directBtn.disabled = false;
|
|
470
|
+
directBtn.textContent = '直接来点 Alpha';
|
|
471
|
+
}
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
function startPipelineStream(taskId) {
|
|
476
|
+
const streamEl = document.getElementById('inspire-stream');
|
|
477
|
+
const outputDiv = document.getElementById('inspire-output');
|
|
478
|
+
if (!streamEl) {
|
|
479
|
+
outputDiv.innerHTML = '<pre id="inspire-stream" style="white-space: pre-wrap; margin: 0;"></pre>';
|
|
480
|
+
}
|
|
481
|
+
const target = document.getElementById('inspire-stream');
|
|
482
|
+
|
|
483
|
+
const source = new EventSource(`/api/inspiration/stream-pipeline/${taskId}`);
|
|
484
|
+
inspirationState.pipelineEventSource = source;
|
|
485
|
+
|
|
486
|
+
source.onmessage = (event) => {
|
|
487
|
+
try {
|
|
488
|
+
const payload = JSON.parse(event.data);
|
|
489
|
+
if (payload && payload.line !== undefined) {
|
|
490
|
+
target.textContent += payload.line + '\n';
|
|
491
|
+
outputDiv.scrollTop = outputDiv.scrollHeight;
|
|
492
|
+
}
|
|
493
|
+
} catch {
|
|
494
|
+
target.textContent += event.data + '\n';
|
|
495
|
+
outputDiv.scrollTop = outputDiv.scrollHeight;
|
|
496
|
+
}
|
|
497
|
+
};
|
|
498
|
+
|
|
499
|
+
source.addEventListener('done', (event) => {
|
|
500
|
+
let info = null;
|
|
501
|
+
try {
|
|
502
|
+
info = JSON.parse(event.data);
|
|
503
|
+
} catch {
|
|
504
|
+
info = { success: false };
|
|
505
|
+
}
|
|
506
|
+
const directBtn = document.getElementById('inspire-direct');
|
|
507
|
+
if (directBtn) {
|
|
508
|
+
directBtn.disabled = false;
|
|
509
|
+
directBtn.textContent = '直接来点 Alpha';
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
if (info && info.success) {
|
|
513
|
+
target.textContent += '\n✅ 运行完成,可下载结果 ZIP。\n';
|
|
514
|
+
const dlBtn = document.getElementById('inspire-direct-download');
|
|
515
|
+
if (dlBtn) dlBtn.style.display = 'inline-block';
|
|
516
|
+
} else {
|
|
517
|
+
target.textContent += '\n❌ 运行失败,请检查日志。\n';
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
source.close();
|
|
521
|
+
inspirationState.pipelineEventSource = null;
|
|
522
|
+
});
|
|
523
|
+
|
|
524
|
+
source.addEventListener('error', () => {
|
|
525
|
+
const directBtn = document.getElementById('inspire-direct');
|
|
526
|
+
if (directBtn) {
|
|
527
|
+
directBtn.disabled = false;
|
|
528
|
+
directBtn.textContent = '直接来点 Alpha';
|
|
529
|
+
}
|
|
530
|
+
target.textContent += '\n⚠️ 日志流中断。\n';
|
|
531
|
+
source.close();
|
|
532
|
+
inspirationState.pipelineEventSource = null;
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
function downloadPipelineZip() {
|
|
537
|
+
if (!inspirationState.pipelineTaskId) return;
|
|
538
|
+
window.location.href = `/api/inspiration/download-pipeline/${inspirationState.pipelineTaskId}`;
|
|
539
|
+
}
|
|
540
|
+
|
|
354
541
|
function formatMarkdown(text) {
|
|
355
542
|
if (typeof marked !== 'undefined') {
|
|
356
543
|
// Split text by code blocks (triple backticks or single backticks)
|
|
@@ -384,6 +571,8 @@ function testLLMConnection() {
|
|
|
384
571
|
const model = document.getElementById('inspire-llm-model').value;
|
|
385
572
|
const testBtn = document.getElementById('inspire-test-llm');
|
|
386
573
|
const generateBtn = document.getElementById('inspire-generate');
|
|
574
|
+
const enhanceBtn = document.getElementById('inspire-enhance');
|
|
575
|
+
const enhanceDlBtn = document.getElementById('inspire-enhance-download');
|
|
387
576
|
|
|
388
577
|
if (!apiKey) {
|
|
389
578
|
alert("请先输入 API Key。");
|
|
@@ -405,12 +594,16 @@ function testLLMConnection() {
|
|
|
405
594
|
testBtn.textContent = "成功";
|
|
406
595
|
testBtn.className = "btn btn-success";
|
|
407
596
|
generateBtn.disabled = false;
|
|
597
|
+
if (enhanceBtn) enhanceBtn.disabled = false;
|
|
598
|
+
if (enhanceDlBtn) enhanceDlBtn.style.display = 'none';
|
|
408
599
|
setTimeout(() => { testBtn.textContent = "测试连接"; testBtn.className = "btn btn-secondary"; }, 3000);
|
|
409
600
|
} else {
|
|
410
601
|
testBtn.textContent = "失败";
|
|
411
602
|
testBtn.className = "btn btn-danger";
|
|
412
603
|
alert("连接失败: " + data.error);
|
|
413
604
|
generateBtn.disabled = true;
|
|
605
|
+
if (enhanceBtn) enhanceBtn.disabled = true;
|
|
606
|
+
if (enhanceDlBtn) enhanceDlBtn.style.display = 'none';
|
|
414
607
|
setTimeout(() => { testBtn.textContent = "测试连接"; testBtn.className = "btn btn-secondary"; }, 3000);
|
|
415
608
|
}
|
|
416
609
|
})
|
|
@@ -418,9 +611,138 @@ function testLLMConnection() {
|
|
|
418
611
|
testBtn.disabled = false;
|
|
419
612
|
testBtn.textContent = "错误";
|
|
420
613
|
alert("错误: " + err);
|
|
614
|
+
if (enhanceBtn) enhanceBtn.disabled = true;
|
|
615
|
+
if (enhanceDlBtn) enhanceDlBtn.style.display = 'none';
|
|
421
616
|
});
|
|
422
617
|
}
|
|
423
618
|
|
|
619
|
+
function handleEnhanceFile(event) {
|
|
620
|
+
const files = event.target.files ? Array.from(event.target.files) : [];
|
|
621
|
+
if (files.length === 0) return;
|
|
622
|
+
|
|
623
|
+
const apiKey = document.getElementById('inspire-llm-key').value;
|
|
624
|
+
const baseUrl = document.getElementById('inspire-llm-url').value;
|
|
625
|
+
const model = document.getElementById('inspire-llm-model').value;
|
|
626
|
+
if (!apiKey) {
|
|
627
|
+
alert("请输入 LLM API Key。");
|
|
628
|
+
return;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
const outputDiv = document.getElementById('inspire-output');
|
|
632
|
+
outputDiv.innerHTML = '<pre id="inspire-enhance-stream" style="white-space: pre-wrap; margin: 0;"></pre>';
|
|
633
|
+
|
|
634
|
+
const enhanceBtn = document.getElementById('inspire-enhance');
|
|
635
|
+
if (enhanceBtn) {
|
|
636
|
+
enhanceBtn.disabled = true;
|
|
637
|
+
enhanceBtn.textContent = '处理中...';
|
|
638
|
+
}
|
|
639
|
+
const enhanceDlBtn = document.getElementById('inspire-enhance-download');
|
|
640
|
+
if (enhanceDlBtn) enhanceDlBtn.style.display = 'none';
|
|
641
|
+
|
|
642
|
+
const formData = new FormData();
|
|
643
|
+
files.forEach(file => formData.append('ideaFiles', file));
|
|
644
|
+
formData.append('apiKey', apiKey);
|
|
645
|
+
formData.append('baseUrl', baseUrl);
|
|
646
|
+
formData.append('model', model);
|
|
647
|
+
|
|
648
|
+
fetch('/api/inspiration/enhance-template', {
|
|
649
|
+
method: 'POST',
|
|
650
|
+
headers: { 'Session-ID': localStorage.getItem('brain_session_id') || '' },
|
|
651
|
+
body: formData
|
|
652
|
+
})
|
|
653
|
+
.then(res => res.json())
|
|
654
|
+
.then(data => {
|
|
655
|
+
if (!data.success) {
|
|
656
|
+
outputDiv.innerHTML = '启动失败: ' + (data.error || '未知错误');
|
|
657
|
+
if (enhanceBtn) {
|
|
658
|
+
enhanceBtn.disabled = false;
|
|
659
|
+
enhanceBtn.textContent = '增强历史生成模板';
|
|
660
|
+
}
|
|
661
|
+
return;
|
|
662
|
+
}
|
|
663
|
+
inspirationState.enhanceTaskId = data.taskId;
|
|
664
|
+
startEnhanceStream(data.taskId, files.length);
|
|
665
|
+
})
|
|
666
|
+
.catch(err => {
|
|
667
|
+
outputDiv.innerHTML = '启动出错: ' + err;
|
|
668
|
+
if (enhanceBtn) {
|
|
669
|
+
enhanceBtn.disabled = false;
|
|
670
|
+
enhanceBtn.textContent = '增强历史生成模板';
|
|
671
|
+
}
|
|
672
|
+
})
|
|
673
|
+
.finally(() => {
|
|
674
|
+
event.target.value = '';
|
|
675
|
+
});
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
function startEnhanceStream(taskId, totalFiles) {
|
|
679
|
+
const outputDiv = document.getElementById('inspire-output');
|
|
680
|
+
const streamEl = document.getElementById('inspire-enhance-stream');
|
|
681
|
+
if (!streamEl) {
|
|
682
|
+
outputDiv.innerHTML = '<pre id="inspire-enhance-stream" style="white-space: pre-wrap; margin: 0;"></pre>';
|
|
683
|
+
}
|
|
684
|
+
const target = document.getElementById('inspire-enhance-stream');
|
|
685
|
+
|
|
686
|
+
const source = new EventSource(`/api/inspiration/stream-enhance/${taskId}`);
|
|
687
|
+
let completed = 0;
|
|
688
|
+
|
|
689
|
+
source.onmessage = (event) => {
|
|
690
|
+
try {
|
|
691
|
+
const payload = JSON.parse(event.data);
|
|
692
|
+
if (payload && payload.type === 'file_done') {
|
|
693
|
+
completed += 1;
|
|
694
|
+
target.textContent += `\n✅ 已完成 ${completed}/${totalFiles}: ${payload.file || ''} (${payload.success ? '成功' : '失败'})\n`;
|
|
695
|
+
outputDiv.scrollTop = outputDiv.scrollHeight;
|
|
696
|
+
return;
|
|
697
|
+
}
|
|
698
|
+
if (payload && payload.line !== undefined) {
|
|
699
|
+
const prefix = payload.file ? `[${payload.file}] ` : '';
|
|
700
|
+
target.textContent += prefix + payload.line + '\n';
|
|
701
|
+
outputDiv.scrollTop = outputDiv.scrollHeight;
|
|
702
|
+
}
|
|
703
|
+
} catch {
|
|
704
|
+
target.textContent += event.data + '\n';
|
|
705
|
+
outputDiv.scrollTop = outputDiv.scrollHeight;
|
|
706
|
+
}
|
|
707
|
+
};
|
|
708
|
+
|
|
709
|
+
source.addEventListener('done', (event) => {
|
|
710
|
+
let info = null;
|
|
711
|
+
try {
|
|
712
|
+
info = JSON.parse(event.data);
|
|
713
|
+
} catch {
|
|
714
|
+
info = { success: false };
|
|
715
|
+
}
|
|
716
|
+
const enhanceBtn = document.getElementById('inspire-enhance');
|
|
717
|
+
const enhanceDlBtn = document.getElementById('inspire-enhance-download');
|
|
718
|
+
if (enhanceBtn) {
|
|
719
|
+
enhanceBtn.disabled = false;
|
|
720
|
+
enhanceBtn.textContent = '增强历史生成模板';
|
|
721
|
+
}
|
|
722
|
+
if (enhanceDlBtn) {
|
|
723
|
+
enhanceDlBtn.style.display = info && info.success ? 'inline-block' : 'none';
|
|
724
|
+
}
|
|
725
|
+
source.close();
|
|
726
|
+
});
|
|
727
|
+
|
|
728
|
+
source.addEventListener('error', () => {
|
|
729
|
+
const enhanceBtn = document.getElementById('inspire-enhance');
|
|
730
|
+
const enhanceDlBtn = document.getElementById('inspire-enhance-download');
|
|
731
|
+
if (enhanceBtn) {
|
|
732
|
+
enhanceBtn.disabled = false;
|
|
733
|
+
enhanceBtn.textContent = '增强历史生成模板';
|
|
734
|
+
}
|
|
735
|
+
if (enhanceDlBtn) enhanceDlBtn.style.display = 'none';
|
|
736
|
+
target.textContent += '\n⚠️ 日志流中断。\n';
|
|
737
|
+
source.close();
|
|
738
|
+
});
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
function downloadEnhanceZip() {
|
|
742
|
+
if (!inspirationState.enhanceTaskId) return;
|
|
743
|
+
window.location.href = `/api/inspiration/download-enhance/${inspirationState.enhanceTaskId}`;
|
|
744
|
+
}
|
|
745
|
+
|
|
424
746
|
function downloadInspirationResult() {
|
|
425
747
|
if (!inspirationState.lastResult) return;
|
|
426
748
|
|
|
@@ -437,6 +759,7 @@ function downloadInspirationResult() {
|
|
|
437
759
|
|
|
438
760
|
function resetInspirationTask() {
|
|
439
761
|
inspirationState.selectedDataset = null;
|
|
762
|
+
inspirationState.selectedDatasetCategory = null;
|
|
440
763
|
const display = document.getElementById('inspire-selected-dataset');
|
|
441
764
|
if (display) {
|
|
442
765
|
display.textContent = "";
|
|
@@ -447,6 +770,19 @@ function resetInspirationTask() {
|
|
|
447
770
|
|
|
448
771
|
const dlBtn = document.getElementById('inspire-download');
|
|
449
772
|
if (dlBtn) dlBtn.style.display = 'none';
|
|
773
|
+
|
|
774
|
+
const directDlBtn = document.getElementById('inspire-direct-download');
|
|
775
|
+
if (directDlBtn) directDlBtn.style.display = 'none';
|
|
776
|
+
|
|
777
|
+
const enhanceDlBtn = document.getElementById('inspire-enhance-download');
|
|
778
|
+
if (enhanceDlBtn) enhanceDlBtn.style.display = 'none';
|
|
779
|
+
inspirationState.enhanceTaskId = null;
|
|
780
|
+
|
|
781
|
+
if (inspirationState.pipelineEventSource) {
|
|
782
|
+
inspirationState.pipelineEventSource.close();
|
|
783
|
+
inspirationState.pipelineEventSource = null;
|
|
784
|
+
}
|
|
785
|
+
inspirationState.pipelineTaskId = null;
|
|
450
786
|
|
|
451
787
|
const newTaskBtn = document.getElementById('inspire-new-task');
|
|
452
788
|
if (newTaskBtn) {
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
<span style="margin-right: 5px;">🤖</span>加载72变生成的模板
|
|
55
55
|
</button>
|
|
56
56
|
<button class="btn btn-small btn-outline" onclick="document.getElementById('generatedExpressionsFile').click()" title="Load Generated Expressions from JSON file">
|
|
57
|
-
<span style="margin-right: 5px;">📄</span
|
|
57
|
+
<span style="margin-right: 5px;">📄</span>载入表达式列表Json
|
|
58
58
|
</button>
|
|
59
59
|
<input type="file" id="importTemplatesFile" accept=".json" style="display: none;" onchange="importCustomTemplates(event)">
|
|
60
60
|
<input type="file" id="transformerFile" accept=".json" style="display: none;" onchange="handleTransformerFileSelect(event)">
|
|
@@ -840,7 +840,7 @@
|
|
|
840
840
|
</div>
|
|
841
841
|
<div style="margin-bottom: 10px;">
|
|
842
842
|
<label style="display: block; margin-bottom: 5px; font-size: 0.9em; color: #666;">Model Name</label>
|
|
843
|
-
<input type="text" id="inspire-llm-model" value="kimi-k2
|
|
843
|
+
<input type="text" id="inspire-llm-model" value="kimi-k2.5" class="form-input" style="width: 100%;">
|
|
844
844
|
</div>
|
|
845
845
|
<div style="margin-bottom: 10px;">
|
|
846
846
|
<label style="display: block; margin-bottom: 5px; font-size: 0.9em; color: #666;">API Key</label>
|
|
@@ -849,6 +849,11 @@
|
|
|
849
849
|
<button id="inspire-test-llm" class="btn btn-secondary" style="white-space: nowrap;">测试连接</button>
|
|
850
850
|
</div>
|
|
851
851
|
</div>
|
|
852
|
+
<div>
|
|
853
|
+
<button id="inspire-enhance" class="btn btn-outline" style="width: 100%;" disabled>增强历史生成模板</button>
|
|
854
|
+
<input type="file" id="inspire-idea-file" accept="application/json" multiple style="display: none;">
|
|
855
|
+
<button id="inspire-enhance-download" class="btn btn-success" style="width: 100%; margin-top: 8px; display: none;">下载增强结果 ZIP 📦</button>
|
|
856
|
+
</div>
|
|
852
857
|
</div>
|
|
853
858
|
|
|
854
859
|
<div style="background: #f8f9fa; padding: 15px; border-radius: 5px;">
|
|
@@ -865,6 +870,13 @@
|
|
|
865
870
|
<label style="display: block; margin-bottom: 5px; font-size: 0.9em; color: #666;">Delay</label>
|
|
866
871
|
<select id="inspire-delay" class="form-input" style="width: 100%;"><option>Select Region First</option></select>
|
|
867
872
|
</div>
|
|
873
|
+
<div style="margin-bottom: 10px;">
|
|
874
|
+
<label style="display: block; margin-bottom: 5px; font-size: 0.9em; color: #666;">data type</label>
|
|
875
|
+
<select id="inspire-data-type" class="form-input" style="width: 100%;">
|
|
876
|
+
<option value="MATRIX" selected>MATRIX</option>
|
|
877
|
+
<option value="VECTOR">VECTOR</option>
|
|
878
|
+
</select>
|
|
879
|
+
</div>
|
|
868
880
|
</div>
|
|
869
881
|
</div>
|
|
870
882
|
</div>
|
|
@@ -898,9 +910,12 @@
|
|
|
898
910
|
<div id="inspire-col-3" class="inspire-col" style="flex: 1; display: flex; flex-direction: column; overflow-y: auto;">
|
|
899
911
|
<div class="col-header" style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; border-bottom: 2px solid #ffc107; padding-bottom: 5px;">
|
|
900
912
|
<h4 style="margin: 0; color: #d39e00;">3. Results</h4>
|
|
901
|
-
<div style="display: flex; gap: 10px; align-items: center;">
|
|
913
|
+
<div style="display: flex; gap: 10px; align-items: center; flex-wrap: wrap;">
|
|
902
914
|
<button id="inspire-generate" class="btn btn-primary">生成 Alpha 模板</button>
|
|
915
|
+
<span style="font-family: 'Segoe Script', 'KaiTi', 'STKaiti', cursive; font-weight: 700; font-size: 16px; color: #6f42c1; text-shadow: 0 1px 2px rgba(0,0,0,0.15);">或</span>
|
|
916
|
+
<button id="inspire-direct" class="btn btn-primary">直接来点 Alpha</button>
|
|
903
917
|
<button id="inspire-download" class="btn btn-success" style="display: none;">下载模板到本地 📥</button>
|
|
918
|
+
<button id="inspire-direct-download" class="btn btn-success" style="display: none;">下载 Alpha 结果 ZIP 📦</button>
|
|
904
919
|
</div>
|
|
905
920
|
<span class="vertical-label" style="color: #d39e00;">Results</span>
|
|
906
921
|
</div>
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
<form id="transformerForm">
|
|
95
95
|
<div class="form-group">
|
|
96
96
|
<label for="llm_model">LLM Model Name</label>
|
|
97
|
-
<input type="text" id="llm_model" name="LLM_model_name" value="kimi-k2
|
|
97
|
+
<input type="text" id="llm_model" name="LLM_model_name" value="kimi-k2.5">
|
|
98
98
|
</div>
|
|
99
99
|
<div class="form-group">
|
|
100
100
|
<label for="llm_api_key">LLM API Key</label>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# trailSomeAlphas Pipeline
|
|
2
|
+
|
|
3
|
+
This folder bundles **brain-data-feature-engineering** and **brain-feature-implementation** so it can run independently.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
1) Fill BRAIN credentials:
|
|
8
|
+
- Edit skills/brain-feature-implementation/config.json
|
|
9
|
+
|
|
10
|
+
2) Set Moonshot API key (do not store in files):
|
|
11
|
+
- Windows PowerShell:
|
|
12
|
+
- $Env:MOONSHOT_API_KEY = "<your_api_key>"
|
|
13
|
+
|
|
14
|
+
Optional:
|
|
15
|
+
- Set base URL if needed: MOONSHOT_BASE_URL (default https://api.moonshot.cn/v1)
|
|
16
|
+
|
|
17
|
+
## Run
|
|
18
|
+
|
|
19
|
+
From this folder:
|
|
20
|
+
|
|
21
|
+
- Generate ideas + implement expressions:
|
|
22
|
+
- python run_pipeline.py --data-category analyst --region USA --delay 1 --universe TOP3000
|
|
23
|
+
|
|
24
|
+
- Use an existing ideas markdown:
|
|
25
|
+
- python run_pipeline.py --data-category analyst --region USA --delay 1 --ideas-file <path_to_ideas.md>
|
|
26
|
+
|
|
27
|
+
## Output
|
|
28
|
+
|
|
29
|
+
- Ideas report:
|
|
30
|
+
- skills/brain-data-feature-engineering/output_report/{region}_delay{delay}_{datasetId}_ideas.md
|
|
31
|
+
|
|
32
|
+
- Final expressions:
|
|
33
|
+
- skills/brain-feature-implementation/data/{datasetId}_{region}_delay{delay}/final_expressions.json
|
|
34
|
+
|
|
35
|
+
## Notes
|
|
36
|
+
|
|
37
|
+
- The ideas report must include `Implementation Example` entries that use {variable} placeholders.
|
|
38
|
+
- The implementation step reads templates from backticks with `{variable}` placeholders.
|