-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathtest_fix.py
More file actions
48 lines (38 loc) · 1.6 KB
/
Copy pathtest_fix.py
File metadata and controls
48 lines (38 loc) · 1.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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from web.utils.analysis_runner import run_stock_analysis
def test_analysis_fix():
"""测试基本面分析师修复是否有效"""
try:
# 运行股票分析
result = run_stock_analysis(
stock_symbol='000001',
analysis_date=1,
analysts=['market', 'fundamentals'],
research_depth=1,
llm_provider='dashscope',
llm_model='qwen-plus',
market_type='A股'
)
print(f"Analysis completed: {'success' if result['success'] else 'failed'}")
if result['success']:
state = result['state']
market_report = state.get('market_report', '')
fundamentals_report = state.get('fundamentals_report', '')
print(f"Market report length: {len(market_report)}")
print(f"Fundamentals report length: {len(fundamentals_report)}")
# 检查报告是否有实际内容
if len(market_report) > 0:
print("✅ Market report has content")
else:
print("❌ Market report is empty")
if len(fundamentals_report) > 0:
print("✅ Fundamentals report has content")
else:
print("❌ Fundamentals report is empty")
else:
print(f"Error: {result.get('error', 'Unknown error')}")
except Exception as e:
print(f"Test failed with exception: {e}")
if __name__ == '__main__':
test_analysis_fix()