File tree Expand file tree Collapse file tree 4 files changed +11
-8
lines changed Expand file tree Collapse file tree 4 files changed +11
-8
lines changed Original file line number Diff line number Diff line change 22from pydantic import Field
33
44# 共享的参数类型定义
5- QuestionParam = Annotated [str , Field (description = "用户的自然语言查询描述。示例:生成查询昨天订单总金额的SQL、写一个SQL查询销售额前10的产品、帮我写一个统计各部门员工数量的SQL" )]
5+ QuestionParamGenSQL = Annotated [str , Field (description = "用户的自然语言查询描述。示例:生成查询昨天订单总金额的SQL、写一个SQL查询销售额前10的产品、帮我写一个统计各部门员工数量的SQL" )]
6+ QuestionParamQuery = Annotated [str , Field (description = "用户的自然语言查询描述。示例:查询昨天订单总金额、查询销售额前10的产品、统计各部门员工数量" )]
67
78RoleIdParam = Annotated [Optional [str ], Field (description = "角色ID,精确控制用户对数据的访问权限,支持库/表/字段/行四级控制。示例:'role_123456',可以为空(使用默认权限)。详见:https://docs.asktable.com/docs/role-and-permission-management/introduction" )]
89
Original file line number Diff line number Diff line change 88)
99from asktable_mcp_server .sse_server import main as sse_main
1010from asktable_mcp_server .schemas import (
11- QuestionParam ,
11+ QuestionParamQuery ,
12+ QuestionParamGenSQL ,
1213 RoleIdParam ,
1314 RoleVariablesParam ,
1415 GEN_SQL_DESCRIPTION ,
2021
2122@mcp .tool (name = '使用 AskTable 查询数据' )
2223async def query (
23- question : QuestionParam ,
24+ question : QuestionParamQuery ,
2425 role_id : RoleIdParam = None ,
2526 role_variables : RoleVariablesParam = None
2627) -> dict :
@@ -44,7 +45,7 @@ async def query(
4445
4546@mcp .tool (name = '使用 AskTable 生成 SQL' )
4647async def gen_sql (
47- question : QuestionParam ,
48+ question : QuestionParamGenSQL ,
4849 role_id : RoleIdParam = None ,
4950 role_variables : RoleVariablesParam = None
5051) -> dict :
Original file line number Diff line number Diff line change 1515)
1616from asktable_mcp_server .version import __version__
1717from asktable_mcp_server .schemas import (
18- QuestionParam ,
18+ QuestionParamQuery ,
19+ QuestionParamGenSQL ,
1920 RoleIdParam ,
2021 RoleVariablesParam ,
2122 GEN_SQL_DESCRIPTION ,
@@ -85,7 +86,7 @@ async def home(request: Request):
8586
8687 @mcp .tool (name = "使用 AskTable 查询数据" )
8788 async def query (
88- question : QuestionParam ,
89+ question : QuestionParamQuery ,
8990 role_id : RoleIdParam = None ,
9091 role_variables : RoleVariablesParam = None
9192 ) -> dict :
@@ -115,7 +116,7 @@ async def query(
115116
116117 @mcp .tool (name = "使用 AskTable 生成 SQL" )
117118 async def gen_sql (
118- question : QuestionParam ,
119+ question : QuestionParamGenSQL ,
119120 role_id : RoleIdParam = None ,
120121 role_variables : RoleVariablesParam = None
121122 ) -> dict :
Original file line number Diff line number Diff line change 1- __version__ = "0.2.20 "
1+ __version__ = "0.2.21 "
You can’t perform that action at this time.
0 commit comments