update pay ui
This commit is contained in:
Binary file not shown.
@@ -314,33 +314,17 @@ TOOLS: List[ToolDefinition] = [
|
||||
),
|
||||
ToolDefinition(
|
||||
name="search_concepts",
|
||||
description="搜索股票概念板块,支持按涨跌幅、股票数量排序。返回概念详情及相关股票列表。",
|
||||
description="搜索股票概念板块,返回概念详情及相关股票列表。",
|
||||
parameters={
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"query": {
|
||||
"type": "string",
|
||||
"description": "搜索关键词,例如:'新能源'、'人工智能'"
|
||||
},
|
||||
"size": {
|
||||
"type": "integer",
|
||||
"description": "每页结果数量",
|
||||
"default": 10
|
||||
},
|
||||
"page": {
|
||||
"type": "integer",
|
||||
"description": "页码",
|
||||
"default": 1
|
||||
},
|
||||
"sort_by": {
|
||||
"type": "string",
|
||||
"description": "排序方式:change_pct(涨跌幅), _score(相关度), stock_count(股票数), concept_name(名称)",
|
||||
"enum": ["change_pct", "_score", "stock_count", "concept_name"],
|
||||
"default": "change_pct"
|
||||
"description": "搜索关键词,例如:'新能源'、'人工智能'、'商业航天'"
|
||||
},
|
||||
"trade_date": {
|
||||
"type": "string",
|
||||
"description": "交易日期,格式:YYYY-MM-DD,默认最新"
|
||||
"description": "交易日期,格式:YYYY-MM-DD,不传则使用今天"
|
||||
}
|
||||
},
|
||||
"required": ["query"]
|
||||
@@ -1469,18 +1453,27 @@ async def handle_search_roadshows(args: Dict[str, Any]) -> Any:
|
||||
return response.json()
|
||||
|
||||
async def handle_search_concepts(args: Dict[str, Any]) -> Any:
|
||||
"""处理概念搜索"""
|
||||
"""处理概念搜索
|
||||
|
||||
参数写死:size=12, page=1, sort_by="_score"
|
||||
trade_date 如果没传则使用今天的日期
|
||||
"""
|
||||
from datetime import date
|
||||
|
||||
# trade_date 默认今天
|
||||
trade_date = args.get("trade_date") or date.today().strftime("%Y-%m-%d")
|
||||
|
||||
payload = {
|
||||
"query": args["query"],
|
||||
"size": args.get("size", 10),
|
||||
"page": args.get("page", 1),
|
||||
"size": 12, # 写死
|
||||
"page": 1, # 写死
|
||||
"sort_by": "_score", # 写死,按相关度排序
|
||||
"trade_date": trade_date,
|
||||
"search_size": 100,
|
||||
"sort_by": args.get("sort_by", "change_pct"),
|
||||
"use_knn": True
|
||||
}
|
||||
if args.get("trade_date"):
|
||||
payload["trade_date"] = args["trade_date"]
|
||||
|
||||
logger.info(f"[search_concepts] 请求参数: {payload}")
|
||||
response = await HTTP_CLIENT.post(f"{ServiceEndpoints.CONCEPT_API}/search", json=payload)
|
||||
response.raise_for_status()
|
||||
return response.json()
|
||||
|
||||
Reference in New Issue
Block a user