from AgentProxy import AgentProxy

# 根据实际的销售行动结果和销售关键动作，结合AI的先验知识，提出阶段转化标准

api_key = 'c6bbe7f48063a2c1' 
api_secret = '5f8e7d3a97465cc099bf19bd1b70c266' 
assistant_id = "66bb09a84673b57506fe7bbd" 
agent = AgentProxy(assistant_id, api_key, api_secret)

sales = [
    {
        "stage": "02-evaluation",
        "high_frequency_tasks": [
            "完成需求确认与收集",
            "完成技术评估与测试",
            "完成项目立项与采购流程",
            "完成市场调研与竞争分析"
        ], 
        "high_frequency_actions": [
            "客户接触与需求识别",   
            "产品演示与方案提供",
            "商务谈判与合同准备",
            "项目支持与优化",
            "内部协调与支持"
        ],
        "next_stage": "03-qualification"
    },
    {
        "stage": "03-qualification",
        "high_frequency_tasks": [
            "完成需求确认与收集",
            "完成技术评估与测试",
            "完成商务谈判与合同准备",
            "完成内部审批与预算确认"
        ],
        "high_frequency_actions": [
            "客户关系维护",
            "项目支持与优化",   
            "客户接触与需求识别",
            "内部协调与支持",
            "商务谈判与合同准备"
        ],
        "next_stage": "04-bidding/negotiating"
    },
    {
        "stage": "04-bidding/negotiating",
        "high_frequency_tasks": [
            "完成需求确认与收集",
            "完成技术评估与测试",
            "完成项目立项与采购流程",
            "完成市场调研与竞争分析"
        ],
        "high_frequency_actions": [
            "客户关系维护",
            "合同审查与订单处理",
            "客户接触与需求识别",
            "商务谈判与合同准备"
        ],
        "next_stage": "closed won"
    }
]

for sale in sales:
    stage = sale["stage"]
    high_frequency_tasks = sale["high_frequency_tasks"]
    high_frequency_actions = sale["high_frequency_actions"]
    next_stage = sale["next_stage"]
    prompt = f"""
你是一个销售领域的专家，
你根据当前销售阶段 {stage} , 
某公司统计出的高频销售阶段任务如下：
{high_frequency_tasks}
对应阶段的销售关键动作如下：
{high_frequency_actions}
请根据以上信息，以及你作为相关专家的经验，给出针对该销售阶段{stage}转化到下一阶段{next_stage}的阶段转化标准,请注意转化标准不要直接使用上面给出的高频任务和高频动作，而要做一定的抽象、总结、归纳，形成一个通用的、抽象的转化标准
"""
    
    print(f"---------------stage:{stage}---------------")
    # print(prompt)
    print(agent.send_message(prompt))   