This commit is contained in:
ycg 2025-11-17 09:57:09 +08:00
parent e5c6aab89e
commit 0c5140cadb
7 changed files with 539 additions and 630 deletions

View File

@ -1,5 +1,5 @@
# Tushare API配置
TUSHARE_TOKEN=your_tushare_token_here
TUSHARE_TOKEN=0ac4f86980bfed8a3ea9c4869e3d02263b12c4a46a7223432a62b56e
# Volces API配置
VOLCES_MODEL_ID=your_model_id_here

View File

@ -14,6 +14,7 @@ app = FastAPI()
ts.set_token(Config.TUSHARE_TOKEN)
pro = ts.pro_api()
# Mount static files
app.mount("/static", StaticFiles(directory=Config.STATIC_DIR), name="static")

View File

@ -6,8 +6,9 @@ class Config:
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Tushare API配置
TUSHARE_TOKEN = '90f8a141125e1decb952cd49032b7b8409a2d7fa370745f6c9f45c96'
TUSHARE_TOKEN = '2876ea85cb005fb5fa17c809a98174f2d5aae8b1f830110a5ead6211'
# TUSHARE_TOKEN = '90f8a141125e1decb952cd49032b7b8409a2d7fa370745f6c9f45c96'
# 配置文件路径
CONFIG_FILE = os.path.join(BASE_DIR, "config.json")

View File

@ -6,9 +6,9 @@ from app.config import Config
class AIAnalysisService:
def __init__(self):
# 配置OpenAI客户端连接到Volces API
self.model = "" # Volces 模型接入点ID
self.model = "ep-20251113170010-6qdcp" # Volces 模型接入点ID
self.client = OpenAI(
api_key = "", # 豆包大模型APIkey
api_key = "ec3ebae6-e131-4b1e-a5ae-30f70468e165", # 豆包大模型APIkey
base_url = "https://ark.cn-beijing.volces.com/api/v3"
)
# 创建AI分析结果缓存目录
@ -399,7 +399,7 @@ class AIAnalysisService:
xxx
]
请确保返回的是一个有效的JSON格式数值使用数字而不是字符串价格市值等文本分析使用字符串分析要客观专业详细"""
请确保返回的是一个有效的JSON格式,不要使用代码块格式数值使用数字而不是字符串价格市值等文本分析使用字符串分析要客观专业详细"""
# 组合完整的提示词
prompt = data_section + analysis_requirements

View File

@ -1,178 +1,22 @@
{
"watchlist": {
"300059": {
"target_market_value": {
"min": 2500.0,
"max": 2800.0
}
},
"601318": {
"target_market_value": {
"min": 8000.0,
"max": 9500.0
}
},
"000963": {
"target_market_value": {
"min": 500.0,
"max": 650.0
}
},
"002415": {
"target_market_value": {
"min": 2000.0,
"max": 2200.0
}
},
"000423": {
"target_market_value": {
"min": 270.0,
"max": 330.0
}
},
"000538": {
"target_market_value": {
"min": 807.0,
"max": 1210.0
}
},
"600085": {
"target_market_value": {
"min": 336.0,
"max": 429.0
}
},
"002714": {
"target_market_value": {
"min": 1650.0,
"max": 2200.0
}
},
"002007": {
"target_market_value": {
"min": 240.0,
"max": 288.0
}
},
"600132": {
"target_market_value": {
"min": 220.0,
"max": 290.0
}
},
"002049": {
"target_market_value": {
"min": 360.0,
"max": 480.0
}
},
"600436": {
"target_market_value": {
"min": 960.0,
"max": 1080.0
}
},
"002216": {
"target_market_value": {
"min": 72.0,
"max": 97.0
}
},
"601966": {
"target_market_value": {
"min": 220.0,
"max": 280.0
}
},
"603195": {
"target_market_value": {
"min": 730.0,
"max": 950.0
}
},
"000001": {
"target_market_value": {
"min": 1800.0,
"max": 2500.0
}
},
"600867": {
"target_market_value": {
"min": 120.0,
"max": 160.0
}
},
"603087": {
"target_market_value": {
"min": 170.0,
"max": 283.0
}
},
"603290": {
"target_market_value": {
"min": 150.0,
"max": 200.0
}
},
"600332": {
"target_market_value": {
"min": 380.0,
"max": 460.0
}
},
"300124": {
"target_market_value": {
"min": 1200.0,
"max": 1400.0
}
},
"300146": {
"target_market_value": {
"min": 150.0,
"max": 200.0
}
},
"000999": {
"target_market_value": {
"min": 450.0,
"max": 580.0
}
},
"002466": {
"target_market_value": {
"min": 330.0,
"max": 415.0
}
},
"300009": {
"target_market_value": {
"min": 120.0,
"max": 160.0
}
},
"300743": {
"600179": {
"target_market_value": {
"min": null,
"max": null
}
},
"603511": {
"600589": {
"target_market_value": {
"min": null,
"max": null
}
},
"688553": {
"002065": {
"target_market_value": {
"min": null,
"max": null
}
},
"600030": {
"target_market_value": {
"min": 3200.0,
"max": 3600.0
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,38 +1,8 @@
{
"sh600601": {
"target_market_value": null,
"target_pe": null,
"target_pb": null,
"target_dividend_yield": null
},
"sz0024515": {
"target_market_value": null,
"target_pe": null,
"target_pb": null,
"target_dividend_yield": null
},
"sz870199": {
"target_market_value": null,
"target_pe": null,
"target_pb": null,
"target_dividend_yield": null
},
"601318": {
"target_market_value": null,
"target_pe": null,
"target_pb": null,
"target_dividend_yield": null
},
"600601": {
"target_market_value": null,
"target_pe": null,
"target_pb": null,
"target_dividend_yield": null
},
"300059": {
"target_market_value": null,
"target_pe": null,
"target_pb": null,
"target_dividend_yield": null
}
"600179": {
"target_market_value": {
"min": null,
"max": null
}
}
}