|
|
@@ -10,7 +10,8 @@ def get_sale_amt_default_config():
|
|
|
"入参说明": {
|
|
|
"backend_url": "后端API地址",
|
|
|
"token": "认证令牌",
|
|
|
- "funtion_name": "函数名称; get_sale_amt_by_month:按月汇总销售额; get_sale_amt_by_day:按天汇总销售额; get_sale_amt_by_produce:产品销售额; get_sale_amt_by_cus:客户销售额;get_sale_amt_by_saler:业务员销售额;get_sale_amt_by_cus_produce:客户产品销售额",
|
|
|
+ "funtion_name": "函数名称; get_sale_amt_by_month:按月汇总销售额; get_sale_amt_by_day:按天汇总销售额; get_sale_amt_by_produce:产品销售额; get_sale_amt_by_cus:客户销售额;get_sale_amt_by_saler:业务员销售额;get_sale_amt_by_cus_produce:客户产品销售额;get_hot_produce_not_buy:客户未购买过的热销产品",
|
|
|
+ "cusname": "客户名称,只有get_hot_produce_not_buy需要",
|
|
|
"firstdate": "开始日期,格式YYYY-MM-DD",
|
|
|
"lastdate": "结束日期,格式YYYY-MM-DD 23:59:59",
|
|
|
},
|
|
|
@@ -20,7 +21,7 @@ def get_sale_amt_default_config():
|
|
|
"输出格式要求": [
|
|
|
"重复信息要总结归纳,精简显示",
|
|
|
],
|
|
|
- "使用示例": "用户输入:'查看2023年1月1日至2023年12月31日的销售金额' -> 系统调用此工具获取2023年1月至12月的销售金额;'2024年前5热销产品是哪些?' -> 系统调用此工具获取2024年产品销售额;'2025年前10销售额最高的客户是?' -> 系统调用此工具获取2025年客户销售额",
|
|
|
+ "使用示例": "用户输入:'查看2023年1月1日至2023年12月31日的销售金额' -> 获取2023年1月至12月的销售金额;'2024年前5热销产品是哪些?' -> 获取2024年产品销售额;'2025年前10销售额最高的客户是?' -> 获取2025年客户销售额';'客户A还没买过的热销型号有哪些?'->获取客户未买过近半年的热销款(没有指定时间范围默认近半年)",
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -29,7 +30,12 @@ tool_description = get_tool_prompt("get_sale_amt", get_sale_amt_default_config()
|
|
|
|
|
|
|
|
|
def get_sale_amt_func(
|
|
|
- backend_url: str, token: str, funtion_name: str, firstdate: str, lastdate: str
|
|
|
+ backend_url: str,
|
|
|
+ token: str,
|
|
|
+ funtion_name: str,
|
|
|
+ firstdate: str,
|
|
|
+ lastdate: str,
|
|
|
+ cusname: str = "",
|
|
|
) -> str:
|
|
|
"""实际的函数实现"""
|
|
|
print(f"正在获取销售金额{funtion_name},时间范围:{firstdate} 至 {lastdate}")
|
|
|
@@ -39,7 +45,7 @@ def get_sale_amt_func(
|
|
|
token,
|
|
|
"sale_data_ai",
|
|
|
funtion_name,
|
|
|
- {"arg_firstdate": firstdate, "arg_lastdate": lastdate},
|
|
|
+ {"arg_firstdate": firstdate, "arg_lastdate": lastdate, "arg_cusname": cusname},
|
|
|
)
|
|
|
|
|
|
|