market_assistant/sales_won_pipeline_comparis...

106 lines
2.5 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from AgentProxy import AgentProxy
class SalesWonPipelineComparison:
def __init__(self, api_key, api_secret, assistant_id):
self.agent = AgentProxy(assistant_id, api_key, api_secret)
def check_input(self, crm_field_definition, user_input):
prompt = f"""
任务:
比较输入的按照行业分类的ACV分布数据赢单数据及在跟进的商机数据分析销售策略是否合理行业趋势是否有明显变化以及这种变化可能体现了什么问题以及潜在的影响
输入:
赢单数据:
{won_data}
商机数据:
{pipeline_data}
输出:
分析结果
"""
return self.agent.send_message(prompt)
# 使用示例
if __name__ == "__main__":
api_key = '25bda2c39c0f8ca0'
api_secret = 'e0008b9b9727cb8ceea5a132dbe62495'
assistant_id = "66bb09a84673b57506fe7bbd"
comparison = SalesWonPipelineComparison(api_key, api_secret, assistant_id)
won_data = """
客户行业 <100万 100万-500万 >500万
ISV 2 0 0
互联网+ 64 2 0
互金 13 3 0
保险 14 12 2
公共事业 29 0 0
其他 8 0 0
制造/汽车 24 3 0
媒体/文娱 2 0 0
教育/科研 1 0 0
物流/交通 21 2 0
能源电力 9 0 0
证券基金 40 7 0
运营商 22 3 1
银行 59 34 7
零售 34 2 0
Total 342 68 10
"""
pipeline_data = """
客户行业 <100万 100万-500万 >500万
ISV 8 1 1
互联网+ 104 6 0
互金 39 7 0
保险 52 18 6
公共事业 133 21 0
其他 62 2 0
其他: 云服务 5 0 0
其他: 公共卫生 1 0 0
其他: 央企招商局 1 0 0
其他: 教育 1 0 0
其他: 游戏 0 0 0
其他: 农业 2 0 0
其他: 农林牧渔 1 0 0
其他: 医疗 2 0 0
其他: 国企 4 0 0
其他: 国央企 6 1 0
其他: 政府 2 0 0
其他: 服务 2 0 0
其他: 消费金融公司 1 0 0
其他: 融资担保 1 0 0
其他: 资产管理 0 1 0
其他: 金融租赁 1 0 0
其他: 高科技 1 0 0
制造/汽车 96 8 0
媒体/文娱 11 0 0
媒体/视频/文娱 0 0 0
教育/科研 0 0 0
物流/交通 83 11 1
物流/交通/出行 0 0 0
电信/网络/云服务商 0 0 0
石油 4 0 0
社交/门户/在线服务 0 0 0
能源电力 77 13 1
证券基金 188 21 0
运营商 63 18 0
银行 271 117 13
零售 89 4 0
零售/电商/消费品 0 0 0
Total 1,311 249 22
"""
result = comparison.check_input(won_data, pipeline_data)
print("输入数据:")
print("----赢单数据:-----")
print(won_data)
print("----商机数据:-----")
print(pipeline_data)
print("输出数据:")
print(result)