astock-agent/backend/app/llm/tools.py
2026-04-07 20:51:00 +08:00

108 lines
3.4 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""LLM Function Calling 工具定义
定义 Chat Agent 可使用的工具 schemaOpenAI function calling 格式)。
"""
CHAT_TOOLS = [
{
"type": "function",
"function": {
"name": "get_market_temperature",
"description": "获取当前市场温度数据,包括涨跌家数、涨停数、连板高度、炸板率等市场情绪指标",
"parameters": {
"type": "object",
"properties": {},
"required": [],
},
},
},
{
"type": "function",
"function": {
"name": "get_hot_sectors",
"description": "获取当前热门板块排名,包括板块涨跌幅、资金流入、涨停数、热度评分",
"parameters": {
"type": "object",
"properties": {
"limit": {
"type": "integer",
"description": "返回板块数量,默认 10",
},
},
"required": [],
},
},
},
{
"type": "function",
"function": {
"name": "get_latest_recommendations",
"description": "获取最新的股票推荐列表,包括综合评分、各维度得分、买卖信号、参考价格",
"parameters": {
"type": "object",
"properties": {},
"required": [],
},
},
},
{
"type": "function",
"function": {
"name": "get_stock_kline",
"description": "获取个股K线数据含技术指标 MA/MACD/RSI/BOLL用于分析个股走势",
"parameters": {
"type": "object",
"properties": {
"ts_code": {
"type": "string",
"description": "股票代码,如 '000001.SZ'",
},
"days": {
"type": "integer",
"description": "获取天数,默认 60",
},
},
"required": ["ts_code"],
},
},
},
{
"type": "function",
"function": {
"name": "get_stock_capital_flow",
"description": "获取个股资金流向数据,包括主力净流入金额",
"parameters": {
"type": "object",
"properties": {
"ts_code": {
"type": "string",
"description": "股票代码,如 '000001.SZ'",
},
"days": {
"type": "integer",
"description": "获取天数,默认 10",
},
},
"required": ["ts_code"],
},
},
},
{
"type": "function",
"function": {
"name": "search_stock",
"description": "通过名称或代码模糊搜索股票",
"parameters": {
"type": "object",
"properties": {
"keyword": {
"type": "string",
"description": "搜索关键词(股票名称或代码)",
},
},
"required": ["keyword"],
},
},
},
]