fix: 更新ai等文件数据

master^2
Lxy 1 week ago
parent 16a3e7f20d
commit 3ed0ce1613

6
.gitignore vendored

@ -12,12 +12,6 @@ build/
venv/
.venv/
# Database files
data/*.db
data/*.db-journal
# Config files with secrets
config/ai_config.json
# Logs
*.log

@ -0,0 +1,22 @@
import sqlite3
db_path = 'data/futures_analysis.db'
conn = sqlite3.connect(db_path)
print('=== AI模型配置 ===')
cursor = conn.execute("SELECT * FROM ai_model_configs")
cols = [desc[0] for desc in cursor.description]
print(f'字段: {cols}')
rows = cursor.fetchall()
print(f'记录数: {len(rows)}')
for row in rows:
print(dict(zip(cols, row)))
print('\n=== 分析设置 ===')
cursor = conn.execute("SELECT * FROM analysis_settings")
rows = cursor.fetchall()
for row in rows:
print(row)
conn.close()

@ -1,55 +1,32 @@
import sqlite3
import os
from pathlib import Path
db_path = Path(__file__).parent / "data" / "futures_analysis.db"
print("=" * 60)
print("数据库信息检查")
print("=" * 60)
print(f"数据库路径: {db_path}")
print(f"文件存在: {db_path.exists()}")
if db_path.exists():
print(f"文件大小: {db_path.stat().st_size} bytes")
print(f"最后修改: {db_path.stat().st_mtime}")
conn = sqlite3.connect(str(db_path))
cursor = conn.cursor()
# 获取所有表
cursor.execute("SELECT name FROM sqlite_master WHERE type='table'")
tables = cursor.fetchall()
print(f"\n数据库表 ({len(tables)}):")
for table in tables:
table_name = table[0]
cursor.execute(f"SELECT COUNT(*) FROM {table_name}")
db_path = 'data/futures_analysis.db'
print(f'数据库文件路径: {os.path.abspath(db_path)}')
print(f'数据库存在: {os.path.exists(db_path)}')
if os.path.exists(db_path):
print(f'数据库大小: {os.path.getsize(db_path)} 字节')
conn = sqlite3.connect(db_path)
cursor = conn.execute("SELECT name FROM sqlite_master WHERE type='table'")
tables = [row[0] for row in cursor.fetchall()]
print(f'数据库表列表: {tables}')
if 'ai_analysis_cache' in tables:
cursor = conn.execute("SELECT COUNT(*) FROM ai_analysis_cache")
count = cursor.fetchone()[0]
print(f" - {table_name}: {count} 条记录")
# 检查AI模型配置
print("\n" + "=" * 60)
print("AI模型配置检查")
print("=" * 60)
try:
cursor.execute("SELECT id, provider, model_name, is_active, enabled FROM ai_model_configs")
models = cursor.fetchall()
print(f"AI模型数量: {len(models)}")
if models:
for m in models:
print(f" ID: {m[0]}")
print(f" Provider: {m[1]}")
print(f" Model Name: {m[2]}")
print(f" Active: {m[3]}")
print(f" Enabled: {m[4]}")
print()
else:
print(" 没有配置AI模型!")
except sqlite3.OperationalError as e:
print(f" 查询失败: {e}")
print(f'AI分析记录数: {count}')
cursor = conn.execute("SELECT id, symbol, created_at FROM ai_analysis_cache ORDER BY created_at DESC LIMIT 5")
records = cursor.fetchall()
print(f'最近5条记录:')
for r in records:
print(f' ID: {r[0]}, 合约: {r[1]}, 时间: {r[2]}')
else:
print('❌ ai_analysis_cache 表不存在!')
conn.close()
else:
print("数据库文件不存在!")
print("=" * 60)
print('❌ 数据库文件不存在!')

@ -0,0 +1,22 @@
{
"models": [
{
"model_name": "qwen3.6-plus",
"provider": "bailian",
"api_key": "sk-sp-51d0695ab1114470b913146d21baf68f",
"api_base": "https://coding.dashscope.aliyuncs.com/v1",
"model_id": "qwen3.6-plus",
"temperature": 0.7,
"max_tokens": 2000,
"enabled": true
}
],
"active_model": "bailian",
"analysis_settings": {
"enable_technical_analysis": true,
"enable_fundamental_analysis": false,
"enable_sentiment_analysis": false,
"risk_tolerance": "medium",
"max_position_pct": 10
}
}

Binary file not shown.
Loading…
Cancel
Save