fix: 更新ai等文件数据

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

6
.gitignore vendored

@ -12,12 +12,6 @@ build/
venv/ venv/
.venv/ .venv/
# Database files
data/*.db
data/*.db-journal
# Config files with secrets
config/ai_config.json
# Logs # Logs
*.log *.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 sqlite3
import os import os
from pathlib import Path
db_path = Path(__file__).parent / "data" / "futures_analysis.db" db_path = 'data/futures_analysis.db'
print("=" * 60) print(f'数据库文件路径: {os.path.abspath(db_path)}')
print("数据库信息检查") print(f'数据库存在: {os.path.exists(db_path)}')
print("=" * 60)
print(f"数据库路径: {db_path}") if os.path.exists(db_path):
print(f"文件存在: {db_path.exists()}") print(f'数据库大小: {os.path.getsize(db_path)} 字节')
if db_path.exists(): conn = sqlite3.connect(db_path)
print(f"文件大小: {db_path.stat().st_size} bytes") cursor = conn.execute("SELECT name FROM sqlite_master WHERE type='table'")
print(f"最后修改: {db_path.stat().st_mtime}") tables = [row[0] for row in cursor.fetchall()]
print(f'数据库表列表: {tables}')
conn = sqlite3.connect(str(db_path))
cursor = conn.cursor() if 'ai_analysis_cache' in tables:
cursor = conn.execute("SELECT COUNT(*) FROM ai_analysis_cache")
# 获取所有表
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}")
count = cursor.fetchone()[0] count = cursor.fetchone()[0]
print(f" - {table_name}: {count} 条记录") print(f'AI分析记录数: {count}')
# 检查AI模型配置 cursor = conn.execute("SELECT id, symbol, created_at FROM ai_analysis_cache ORDER BY created_at DESC LIMIT 5")
print("\n" + "=" * 60) records = cursor.fetchall()
print("AI模型配置检查") print(f'最近5条记录:')
print("=" * 60) for r in records:
try: print(f' ID: {r[0]}, 合约: {r[1]}, 时间: {r[2]}')
cursor.execute("SELECT id, provider, model_name, is_active, enabled FROM ai_model_configs") else:
models = cursor.fetchall() print('❌ ai_analysis_cache 表不存在!')
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}")
conn.close() conn.close()
else: else:
print("数据库文件不存在!") print('❌ 数据库文件不存在!')
print("=" * 60)

@ -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