35 lines
1.2 KiB
Python
35 lines
1.2 KiB
Python
from goojia_utils import MysqlClient, ArkAIClient, dingutils
|
|
|
|
db_util = MysqlClient(
|
|
host="192.168.0.93",
|
|
port=3306,
|
|
database="stock",
|
|
user="root",
|
|
password="Goojia123456"
|
|
)
|
|
|
|
stocks = db_util.scan_by_sql_to_data_frame("select * from mu_stocks where `year_month`= (select max(`year_month`) from mu_stocks)")
|
|
|
|
url = "http://didata-cloud-server.fangjia.com/chat/deepseek"
|
|
|
|
data = {
|
|
'content': f"帮我分析一下以下哪只股票上涨概率比较大:\n{stocks.to_markdown()}",
|
|
'roleTips': '你是一个股票投资者,用表格的形式展示结果,你用1-10分来综合评价股票,按照评分高低顺序输出'
|
|
}
|
|
|
|
headers = {
|
|
'Content-Type': 'application/json'
|
|
}
|
|
ark_client = ArkAIClient()
|
|
|
|
messages = [
|
|
ark_client.build_system_message("你是一个股票投资者,用表格的形式展示结果,你用1-10分来综合评价股票,按照评分高低顺序输出"),
|
|
ark_client.build_user_message(f"帮我分析一下以下哪只股票上涨概率比较大:\n{stocks.to_markdown()}")
|
|
]
|
|
|
|
# 发送请求
|
|
response = ark_client.chat_completion(messages)
|
|
|
|
if response:
|
|
dingutils.send_text("【选股】:" + response["content"], "1e5f9aaeb90b091bc79652b52800cad2f1dee1ac0990149252511965f6d1c12a")
|