154 lines
5.1 KiB
Python
154 lines
5.1 KiB
Python
"""LLM Function Calling 工具定义
|
||
|
||
定义 Chat Agent 可使用的工具 schema(OpenAI 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"],
|
||
},
|
||
},
|
||
},
|
||
{
|
||
"type": "function",
|
||
"function": {
|
||
"name": "get_stock_technical_signal",
|
||
"description": "获取个股技术面信号详情,包括均线排列、MACD状态、RSI、布林带位置、量价关系、支撑压力位、位置安全评估",
|
||
"parameters": {
|
||
"type": "object",
|
||
"properties": {
|
||
"ts_code": {
|
||
"type": "string",
|
||
"description": "股票代码,如 '000001.SZ'",
|
||
},
|
||
},
|
||
"required": ["ts_code"],
|
||
},
|
||
},
|
||
},
|
||
{
|
||
"type": "function",
|
||
"function": {
|
||
"name": "get_sector_performance",
|
||
"description": "获取板块近期涨跌表现、资金流入、涨停数等综合数据,用于判断板块强弱和轮动方向",
|
||
"parameters": {
|
||
"type": "object",
|
||
"properties": {
|
||
"sector_name": {
|
||
"type": "string",
|
||
"description": "板块名称关键词,如 '半导体'、'新能源'",
|
||
},
|
||
},
|
||
"required": ["sector_name"],
|
||
},
|
||
},
|
||
},
|
||
{
|
||
"type": "function",
|
||
"function": {
|
||
"name": "get_realtime_indices",
|
||
"description": "获取指数实时行情数据,包括上证指数、深证成指、创业板指的实时涨跌幅和成交数据。盘中时段返回实时数据,盘后返回当日收盘数据",
|
||
"parameters": {
|
||
"type": "object",
|
||
"properties": {},
|
||
"required": [],
|
||
},
|
||
},
|
||
},
|
||
]
|