[feat]update demo startup app cases and documents

This commit is contained in:
shengxiao
2025-01-07 23:11:50 +08:00
parent 3a88e49d6f
commit dcd11c8914
21 changed files with 232 additions and 291 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 204 KiB

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 263 KiB

After

Width:  |  Height:  |  Size: 836 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 363 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 147 KiB

After

Width:  |  Height:  |  Size: 940 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 KiB

After

Width:  |  Height:  |  Size: 1011 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 877 KiB

After

Width:  |  Height:  |  Size: 829 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 213 KiB

After

Width:  |  Height:  |  Size: 770 KiB

View File

@@ -1,11 +1,11 @@
# Quick Guide to Building Single Agent
we provide a sample project with detailed documentation to quickly get acquainted with the AU framework. During the actual development process, you can build your application by making minor code/configuration modifications within the sample project.
The sample project is designed around a smart advisor for pet insurance products, aimed at answering user inquiries about the product.
The sample project is designed around a smart advisor for insurance products, aimed at answering user inquiries about the product.
![flowchart](../../_picture/demo_startup_instruction_flowchart.jpg)
We built a pet insurance advisor intelligent agent under the [single_agent_case](../../../../examples/startup_app/demo_startup_app_with_single_agent/intelligence/agentic/agent/agent_instance) using the qwen72b model. The agent will provide a retrieval tool for pet insurance information and supplement it as needed. The agent will use this tool to help answer users' questions.
We built a insurance advisor intelligent agent under the [single_agent_case](../../../../examples/startup_app/demo_startup_app_with_single_agent/intelligence/agentic/agent/agent_instance) using the qwen72b model. The agent will provide a retrieval tool for insurance information and supplement it as needed. The agent will use this tool to help answer users' questions.
The overall process is as follows.
@@ -14,8 +14,8 @@ Demo Path[demo_startup_app_with_single_agent](../../../../examples/startup_ap
## 1.1 Connecting Models
### 1.1.1 Configuration
[pet_qwen_72b_stream.yaml](../../../../examples/startup_app/demo_startup_app_with_single_agent/intelligence/agentic/llm/maya/insurance_maya_llm.yaml)
The custom parameters can be added to the extended field ext_info and parsed in the initialization method of the code, becoming attributes of PetInsuranceMayaLLM.
[insurance_maya_llm.yaml](../../../../examples/startup_app/demo_startup_app_with_single_agent/intelligence/agentic/llm/maya/insurance_maya_llm.yaml)
The custom parameters can be added to the extended field ext_info and parsed in the initialization method of the code, becoming attributes of InsuranceMayaLLM.
### 1.1.2 code
All LLMs inherit from the LLM base class in agentuniverse.llm.llm.
@@ -34,7 +34,7 @@ Note: The LLM in the example is merely a reference in terms of writing style; th
## 1.2 Building Agent
### 1.2.1 Configuration
[pet_insurance_react_agent.yaml](../../../../examples/startup_app/demo_startup_app_with_single_agent/intelligence/agentic/agent/agent_instance/insurance_agent.yaml)
[insurance_react_agent.yaml](../../../../examples/startup_app/demo_startup_app_with_single_agent/intelligence/agentic/agent/agent_instance/insurance_agent.yaml)
![](../../_picture/demo_startup_petinst_agent_yaml.png)
@@ -45,17 +45,17 @@ Note: The LLM in the example is merely a reference in terms of writing style; th
The agent inherits from the Agent class, and the framework will validate the input_keys. It is important to pay attention to the input and output fields.
## 1.3 Running Tests
Furthermore, we can test using the pet_insurance_react_agent_test.
Furthermore, we can test using the insurance_react_agent_test.
Path: agentUniverse/examples/startup_app/demo_startup_app_with_single_agent/intelligence/test/pet_insurance_agent_test.py
Path: agentUniverse/examples/startup_app/demo_startup_app_with_single_agent/intelligence/test/insurance_agent_test.py
![](../../_picture/demo_startup_petinst_agent_res.png)
## 1.4 Optimizing Prompts
Optimizing prompts is a common method for adjusting the performance of agents. Based on the results from section 1.3, we can further modify the prompt instruction section in the [pet_insurance_agent.yaml](../../../../examples/startup_app/demo_startup_app_with_single_agent/intelligence/agentic/agent/agent_instance/insurance_agent.yaml) configuration to refine the output of the agent's results.
Optimizing prompts is a common method for adjusting the performance of agents. Based on the results from section 1.3, we can further modify the prompt instruction section in the [insurance_agent.yaml](../../../../examples/startup_app/demo_startup_app_with_single_agent/intelligence/agentic/agent/agent_instance/insurance_agent.yaml) configuration to refine the output of the agent's results.
## 1.5 Serviceization
[pet_insurance_service.yaml](../../../../examples/startup_app/demo_startup_app_with_single_agent/intelligence/service/agent_service/insurance_service.yaml)
[insurance_service.yaml](../../../../examples/startup_app/demo_startup_app_with_single_agent/intelligence/service/agent_service/insurance_service.yaml)
![](../../_picture/demo_startup_petins_react_service.png)
@@ -65,7 +65,7 @@ We launched the [server_application.py](../../../../examples/startup_app/demo_st
We can further use tools like curl or Postman to send service requests, as follows:
```shell
curl -X POST -H "Content-Type: application/json" -d '{"service_id": "pet_insurance_agent_service", "params":{"input" : "宠物医保怎么升级"}}' http://127.0.0.1:8888/service_run
curl -X POST -H "Content-Type: application/json" -d '{"service_id": "insurance_agent_service", "params":{"input" : "保险产品A怎么续保"}}' http://127.0.0.1:8888/service_run
```
The service_id is the agent service ID we configured in the previous step, and params are the input parameters for the agent service.
@@ -77,23 +77,23 @@ Demo Path[demo_startup_app_with_single_agent_and_actions](../../../../example
## 2.1 Connecting Tools
**<Configuration>**
[pet_insurance_search_context_tool.yaml](../../../../examples/startup_app/demo_startup_app_with_single_agent_and_actions/intelligence/agentic/tool/insurance_search_context_tool.yaml)
[insurance_search_context_tool.yaml](../../../../examples/startup_app/demo_startup_app_with_single_agent_and_actions/intelligence/agentic/tool/insurance_search_context_tool.yaml)
![](../../_picture/demo_startup_petins_search_context_tool_yml.png)
**<Main Code>**
[pet_insurance_search_context_tool.py](../../../../examples/startup_app/demo_startup_app_with_single_agent_and_actions/intelligence/agentic/tool/insurance_search_context_tool.py)
[insurance_search_context_tool.py](../../../../examples/startup_app/demo_startup_app_with_single_agent_and_actions/intelligence/agentic/tool/insurance_search_context_tool.py)
All custom tools inherit from the agentuniverse.agent.action.tool.tool base class, you need to overwrite the part which named execute. The type of input parameter is ToolInput (a structure that encapsulates key-value pairs), and you can retrieve parameters using the get_data() method.
The API adaptation AU sample can be referenced in [Tool Plugin API Adaptation Sample Reference.md](../How-to/Define%20and%20Use%20Tool%20Plugins/Tool Plugin API Adaptation Sample Reference.md).
## 2.2 Using Connected Tools
Furthermore, we will configure the previously connected pet_insurance_search_context_tool into the agent's tool list as follows.
Furthermore, we will configure the previously connected insurance_search_context_tool into the agent's tool list as follows.
![](../../_picture/demo_startup_petins_react_agent_yaml.png)
## 2.3 Testing Agent
We can refer to the previous testing steps and use pet_insurance_agent_test.py for testing in this example.
We can refer to the previous testing steps and use insurance_agent_test.py for testing in this example.
Path: agentUniverse/examples/startup_app/demo_startup_app_with_single_agent_and_actions/intelligence/test/pet_insurance_agent_test.py
Path: agentUniverse/examples/startup_app/demo_startup_app_with_single_agent_and_actions/intelligence/test/insurance_agent_test.py

View File

@@ -6,56 +6,48 @@ Demo Path[demo_startup_app_with_multi_agents](../../../../examples/startup_ap
n more complex scenarios, a single agent may not be sufficient to complete the task. We need multi-agent collaboration.
Taking the sample project of pet insurance Q&A as an example, users' questions may be quite varied, and sometimes the responses from a single agent can deviate from the topic. Driven by the expertise of certain specialists, we have divided this scenario into three agents: planning, executing, and expressing. We will then use the pet insurance consulting agent to connect them together.
Taking the sample project of insurance Q&A as an example, users' questions may be quite varied, and sometimes the responses from a single agent can deviate from the topic. Driven by the expertise of certain specialists, we have divided this scenario into three agents: planning, executing, and expressing. We will then use the insurance consulting agent to connect them together.
## Sub-Agent
Using the experiences gained from building a single agent, we separately establish three agents for planning, executing, and expressing.
Planning Agent (Break down complex problems into manageable steps):
[pet_question_rewrite_agent.yaml](../../../../examples/startup_app/demo_startup_app_with_multi_agents/intelligence/agentic/agent/agent_instance/insurance_planning_agent.yaml)
[question_rewrite_agent.yaml](../../../../examples/startup_app/demo_startup_app_with_multi_agents/intelligence/agentic/agent/agent_instance/insurance_planning_agent.yaml)
Executing Agent:
[pet_question_planning_agent.yaml](../../../../examples/startup_app/demo_startup_app_with_multi_agents/intelligence/agentic/agent/agent_instance/insurance_executing_agent.yaml)
[question_planning_agent.yaml](../../../../examples/startup_app/demo_startup_app_with_multi_agents/intelligence/agentic/agent/agent_instance/insurance_executing_agent.yaml)
Expressing Agent:
[pet_insurance_expressing_agent.yaml](../../../../examples/startup_app/demo_startup_app_with_multi_agents/intelligence/agentic/agent/agent_instance/insurance_expressing_agent.yaml)
[insurance_expressing_agent.yaml](../../../../examples/startup_app/demo_startup_app_with_multi_agents/intelligence/agentic/agent/agent_instance/insurance_expressing_agent.yaml)
## Master-Agent
[pet_insurance_consult_agent.yaml](../../../../examples/startup_app/demo_startup_app_with_multi_agents/intelligence/agentic/agent/agent_instance/insurance_consult_agent.yaml)
[insurance_consult_agent.yaml](../../../../examples/startup_app/demo_startup_app_with_multi_agents/intelligence/agentic/agent/agent_instance/insurance_consult_agent.yaml)
The main agent connects several agents and tools in a logical sequence. It is important to pay attention to parameter passing; the agent_input serves as the thread context to store intermediate results for use by subsequent agents. The input and output fields of each agent can be customized according to requirements, and it is recommended to avoid duplication.
## Running Tests
Run [pet_insurance_consult_pro_agent_test.py](../../../../examples/startup_app/demo_startup_app_with_multi_agents/intelligence/test/insurance_multi_agent_test.py)
Run [insurance_consult_pro_agent_test.py](../../../../examples/startup_app/demo_startup_app_with_multi_agents/intelligence/test/insurance_multi_agent_test.py)
![](../../_picture/demo_startup_petins_multi_agent_test.png)
**The execution result of the agent "pet_question_planning_agent":**
```text
如何将宠物医保的基础版升级到升级版或尊享版?升级的具体流程和条件是什么?
```
**The execution result of the agent "pet_question_planning_agent":**
**The execution result of the agent "question_planning_agent":**
```json
{
{
"sub_query_list": [
"如何将宠物医保的基础版升级到升级版或尊享版",
"宠物医保升级版和尊享版的具体保障内容有什么区别",
"升级宠物医保版本是否需要额外费用,费用如何计算"
"如何从保险产品A的基础版升级到更高版本",
"保险产品A升级版和尊享版的升级流程是什么",
"保险产品A升级时是否有额外费用或条件需要满足"
]
}
}
```
**The final execution result of the pet insurance consultation agent:**
**The final execution result of the insurance consultation agent:**
```text
宠物医保在保障期间内不支持从基础版升级到升级版或尊享版。您如果希望获得更高版本的保障,可以在当前保单到期后,在续保时选择升级到所需的版本
请注意,续保时的保费可能会根据宠物的当前状况和保险公司的评估有所调整
险产品A在保障期间内不支持直接升级。如果您想要从当前的基础版升级到升级版或尊享版,需要在当前保险期结束后,重新选择更高版本的保险产品进行投保
请注意,升级时可能会有不同的保费标准,具体费用需依据您投保时的年龄和所选版本确定
```

View File

@@ -1,14 +1,14 @@
# Preface
In the chapter on "Building Typical Multi Agent App", we constructed a typical multi-agent application using one master agent and three sub-agents. In this chapter, we will further refine this agent collaboration method into a standard template for easier reuse and sharing in the future.
We can see that the pet intelligent question-answering scenario mainly consists of three core agents: the planning agent, the executing agent, and the expressing agent. The pet insurance planning agent is mainly responsible for breaking down complex user questions; the PET insurance executing agent is primarily responsible for executing information retrieval, collecting necessary information through knowledge tools for the questions planned; and the PET insurance expressing agent combines user inquiries to provide the final answers and expressions.
We can see that the intelligent question-answering scenario mainly consists of three core agents: the planning agent, the executing agent, and the expressing agent. The insurance planning agent is mainly responsible for breaking down complex user questions; the insurance executing agent is primarily responsible for executing information retrieval, collecting necessary information through knowledge tools for the questions planned; and the insurance expressing agent combines user inquiries to provide the final answers and expressions.
# Creating Agent Template
Demo Path: [demo_startup_app_with_agent_templates](../../../../examples/startup_app/demo_startup_app_with_agent_templates)
In the multi-agent applications mentioned above, we find that this model has strong reusability. We encapsulate the running process into an agent template called PetAgentTemplate. Thus, most question-and-answer scenarios involving agents only require minor adjustments based on this template to be quickly constructed.
In the multi-agent applications mentioned above, we find that this model has strong reusability. We encapsulate the running process into an agent template called InsuranceAgentTemplate. Thus, most question-and-answer scenarios involving agents only require minor adjustments based on this template to be quickly constructed.
Refer to [pet_agent_template.py](../../../../examples/startup_app/demo_startup_app_with_agent_templates/intelligence/agentic/agent/agent_template/insurance_agent_template.py). Here, a certain level of abstraction has been applied to common methods used by the agent, including registering the agent, handling memory/LLM/tools/prompts, and executing the main functionalities. Most of these methods can be reused in the pet insurance agent.
Refer to [insurance_agent_template.py](../../../../examples/startup_app/demo_startup_app_with_agent_templates/intelligence/agentic/agent/agent_template/insurance_agent_template.py). Here, a certain level of abstraction has been applied to common methods used by the agent, including registering the agent, handling memory/LLM/tools/prompts, and executing the main functionalities. Most of these methods can be reused in the insurance agent.
In fact, the AU framework provides a considerable number of [agent templates](../../../../agentuniverse/agent/template), including Rag, React, PEER modes, etc. It is recommended to use these existing templates to build your own agents.

View File

@@ -6,12 +6,12 @@ During the use of the agent, we need to utilize its memory capability. In our sa
Demo Path: [demo_startup_app_with_single_agent_and_memory](../../../../examples/startup_app/demo_startup_app_with_single_agent_and_memory)
In the AU agent, the use of memory can also be configured. We can refer to the memory section in the configuration of the agent [pet_insurance_agent](../../../../examples/startup_app/demo_startup_app_with_single_agent_and_memory/intelligence/agentic/agent/agent_instance/insurance_agent.yaml).
In the AU agent, the use of memory can also be configured. We can refer to the memory section in the configuration of the agent [insurance_agent](../../../../examples/startup_app/demo_startup_app_with_single_agent_and_memory/intelligence/agentic/agent/agent_instance/insurance_agent.yaml).
In this case, we have configured demo_memory as the memory instance type. (path: agentUniverse/examples/startup_app/demo_startup_app_with_single_agent_and_memory/intelligence/agentic/memory/demo_memory.yaml).
## Running Test
You can see the results of the agent with memory module by running the test in [pet_insurance_agent_test.py](../../../../examples/startup_app/demo_startup_app_with_single_agent_and_memory/intelligence/test/insurance_agent_test.py).
You can see the results of the agent with memory module by running the test in [insurance_agent_test.py](../../../../examples/startup_app/demo_startup_app_with_single_agent_and_memory/intelligence/test/insurance_agent_test.py).
![](../../_picture/demo_startup_agent_with_memory.png)
@@ -20,7 +20,7 @@ Demo Path[demo_startup_app_with_agent_templates](../../../../examples/startup
In the process of building multi-agent applications, we face a substantial number of prompt settings, which will be present in various YAML files. As the content of the application increases, managing an increasing number of prompts becomes challenging. We utilize a prompt management module to assign a unique prompt_version to each prompt for management and usage.
In the demo_startup_app_with_agent_templates project, taking the intelligent agent [pet_consult_pro_agent.yaml](../../../../examples/startup_app/demo_startup_app_with_agent_templates/intelligence/agentic/agent/agent_instance/insurance_consult_pro_agent.yaml) as an example, we can see that the configuration item prompt_version is set to pet_insurance_consult.cn. We can find its actual prompt file [pet_insurance_multi_agent_cn.yaml](../../../../examples/startup_app/demo_startup_app_with_agent_templates/intelligence/agentic/prompt/insurance_multi_agent_cn.yaml) in the prompt directory.
In the demo_startup_app_with_agent_templates project, taking the intelligent agent [consult_pro_agent.yaml](../../../../examples/startup_app/demo_startup_app_with_agent_templates/intelligence/agentic/agent/agent_instance/insurance_consult_pro_agent.yaml) as an example, we can see that the configuration item prompt_version is set to insurance_consult.cn. We can find its actual prompt file [insurance_multi_agent_cn.yaml](../../../../examples/startup_app/demo_startup_app_with_agent_templates/intelligence/agentic/prompt/insurance_multi_agent_cn.yaml) in the prompt directory.
In this way, we can manage and reuse a large number of prompts individually.

View File

@@ -1,9 +1,9 @@
# 0.文档说明
为了让大家快速上手AU框架我们提供了样板工程可以直接运行并配套详细的文字说明在实际研发过程中直接基于其中的某些智能体结合自己业务进行一小部分代码/配置改写即可完成应用的搭建。
样板工程拟定了业务是关于宠物险产品的智能顾问,对用户提出的产品问题进行解答。
样板工程拟定了业务是关于险产品的智能顾问,对用户提出的产品问题进行解答。
[single_agent_case](../../../../examples/startup_app/demo_startup_app_with_single_agent/intelligence/agentic/agent/agent_instance)下构建一个宠物险顾问智能体使用qwen72b模型提供宠物医保的检索以及信息补充工具,智能体将使用工具帮助回答用户的问题。
[single_agent_case](../../../../examples/startup_app/demo_startup_app_with_single_agent/intelligence/agentic/agent/agent_instance)下构建一个险顾问智能体使用qwen72b模型提供保险产品的检索以及信息补充工具,智能体将使用工具帮助回答用户的问题。
从0开始搭建的整体流程如下
@@ -14,8 +14,8 @@
## 1.1构建llm
### 1.1.1配置封装
[pet_qwen_72b_stream.yaml](../../../../examples/startup_app/demo_startup_app_with_single_agent/intelligence/agentic/llm/maya/insurance_maya_llm.yaml)
拓展字段ext_info中可以添加自定义参数并在代码初始化方法中解析成为PetInsuranceMayaLLM的属性。
[insurance_maya_llm.yaml](../../../../examples/startup_app/demo_startup_app_with_single_agent/intelligence/agentic/llm/maya/insurance_maya_llm.yaml)
拓展字段ext_info中可以添加自定义参数并在代码初始化方法中解析成为InsuranceMayaLLM的属性。
### 1.1.2代码实现
所有的llm都继承自agentuniverse.llm.llm的LLM基类。
@@ -34,7 +34,7 @@ llm需要封装成langchain实例实际调度过程中由该实例唤起执
## 1.2构建智能体
### 1.2.1配置封装
[pet_insurance_agent.yaml](../../../../examples/startup_app/demo_startup_app_with_single_agent/intelligence/agentic/agent/agent_instance/insurance_agent.yaml)
[insurance_agent.yaml](../../../../examples/startup_app/demo_startup_app_with_single_agent/intelligence/agentic/agent/agent_instance/insurance_agent.yaml)
![](../../_picture/demo_startup_petinst_agent_yaml.png)
@@ -45,16 +45,15 @@ llm需要封装成langchain实例实际调度过程中由该实例唤起执
智能体继承Agent类框架会对input_keys进行校验一定要注意输入和输出字段。
## 1.3运行测试
进一步我们可以使用pet_insurance_agent_test进行测试了。
路径agentUniverse/examples/startup_app/demo_startup_app_with_single_agent/intelligence/test/pet_insurance_agent_test.py
进一步我们可以使用insurance_agent_test进行测试了。
路径agentUniverse/examples/startup_app/demo_startup_app_with_single_agent/intelligence/test/insurance_agent_test.py
![](../../_picture/demo_startup_petinst_agent_res.png)
## 1.4效果微调-优化prompt
优化prompt是调整智能体效果的常用手段。根据1.3中运行结果,我们可以进一步修改[pet_insurance_agent.yaml](../../../../examples/startup_app/demo_startup_app_with_single_agent/intelligence/agentic/agent/agent_instance/insurance_agent.yaml)配置中的prompt指令部分化agent的结果输出。
优化prompt是调整智能体效果的常用手段。根据1.3中运行结果,我们可以进一步修改[insurance_agent.yaml](../../../../examples/startup_app/demo_startup_app_with_single_agent/intelligence/agentic/agent/agent_instance/insurance_agent.yaml)配置中的prompt指令部分化agent的结果输出。
## 1.5服务化
[pet_insurance_service.yaml](../../../../examples/startup_app/demo_startup_app_with_single_agent/intelligence/service/agent_service/insurance_service.yaml)
[insurance_service.yaml](../../../../examples/startup_app/demo_startup_app_with_single_agent/intelligence/service/agent_service/insurance_service.yaml)
![](../../_picture/demo_startup_petins_react_service.png)
@@ -64,7 +63,7 @@ llm需要封装成langchain实例实际调度过程中由该实例唤起执
进一步我们可以使用curl指令或者postman等工具发送服务请求了如下
```shell
curl -X POST -H "Content-Type: application/json" -d '{"service_id": "pet_insurance_agent_service", "params":{"input" : "宠物医保怎么升级"}}' http://127.0.0.1:8888/service_run
curl -X POST -H "Content-Type: application/json" -d '{"service_id": "insurance_agent_service", "params":{"input" : "保险产品A怎么续保"}}' http://127.0.0.1:8888/service_run
```
其中service_id为我们在上一步配置的agent服务idparams为agent的服务输入。
@@ -76,22 +75,22 @@ curl -X POST -H "Content-Type: application/json" -d '{"service_id": "pet_insuran
## 2.1构建tool
**<配置封装>**
[pet_insurance_search_context_tool.yaml](../../../../examples/startup_app/demo_startup_app_with_single_agent_and_actions/intelligence/agentic/tool/insurance_search_context_tool.yaml)
[insurance_search_context_tool.yaml](../../../../examples/startup_app/demo_startup_app_with_single_agent_and_actions/intelligence/agentic/tool/insurance_search_context_tool.yaml)
![](../../_picture/demo_startup_petins_search_context_tool_yml.png)
**<代码实现>**
[pet_insurance_search_context_tool.py](../../../../examples/startup_app/demo_startup_app_with_single_agent_and_actions/intelligence/agentic/tool/insurance_search_context_tool.py)
[insurance_search_context_tool.py](../../../../examples/startup_app/demo_startup_app_with_single_agent_and_actions/intelligence/agentic/tool/insurance_search_context_tool.py)
所有的自定义工具都都继承自agentuniverse.agent.action.tool.tool的Tool基类核心执行方法为execute你需要overwrite的地方入参类型为ToolInputkey-value经过封装后的结构通过get_data()方法获取参数。
API适配AU样例可参考 [工具插件适配API样例参考.md](../How-to/定义与使用工具插件/工具插件适配API样例参考.md)
## 2.2使用构建的tool
进一步,我们将之前构建的 pet_insurance_search_context_tool 配置至agent的工具列表中如下。
进一步,我们将之前构建的 insurance_search_context_tool 配置至agent的工具列表中如下。
![](../../_picture/demo_startup_petins_react_agent_yaml.png)
## 2.3测试智能体
我们可以参考之前的测试步骤,在该样例中使用pet_insurance_agent_test.py进行测试了。
路径agentUniverse/examples/startup_app/demo_startup_app_with_single_agent_and_actions/intelligence/test/pet_insurance_agent_test.py
我们可以参考之前的测试步骤在该样例中使用insurance_agent_test.py进行测试了。
路径agentUniverse/examples/startup_app/demo_startup_app_with_single_agent_and_actions/intelligence/test/insurance_agent_test.py

View File

@@ -6,56 +6,54 @@
对于比较复杂的场景,单智能可能不足以完成任务,需要多个智能体协作。
以样板工程的宠物险问答为例由于用户的问题可能比较发散单智能体的回答有时候会产生偏离。在部分专家经验的驱动下对于这种场景我们将其拆分为策划、执行与表达3个智能体并使用宠物险智能顾问智能体将其串联。
以样板工程的险问答为例由于用户的问题可能比较发散单智能体的回答有时候会产生偏离。在部分专家经验的驱动下对于这种场景我们将其拆分为策划、执行与表达3个智能体并使用险智能顾问智能体将其串联。
## 子智能体
使用单体智能体构建章节中所获得的经验我们分别建立策划、执行与表达3个智能体
策划智能体(拆解问题):
[pet_question_rewrite_agent.yaml](../../../../examples/startup_app/demo_startup_app_with_multi_agents/intelligence/agentic/agent/agent_instance/insurance_planning_agent.yaml)
[question_rewrite_agent.yaml](../../../../examples/startup_app/demo_startup_app_with_multi_agents/intelligence/agentic/agent/agent_instance/insurance_planning_agent.yaml)
执行智能体:
[pet_question_planning_agent.yaml](../../../../examples/startup_app/demo_startup_app_with_multi_agents/intelligence/agentic/agent/agent_instance/insurance_executing_agent.yaml)
[question_planning_agent.yaml](../../../../examples/startup_app/demo_startup_app_with_multi_agents/intelligence/agentic/agent/agent_instance/insurance_executing_agent.yaml)
表达智能体:
[pet_insurance_expressing_agent.yaml](../../../../examples/startup_app/demo_startup_app_with_multi_agents/intelligence/agentic/agent/agent_instance/insurance_expressing_agent.yaml)
[insurance_expressing_agent.yaml](../../../../examples/startup_app/demo_startup_app_with_multi_agents/intelligence/agentic/agent/agent_instance/insurance_expressing_agent.yaml)
## 主智能体
[pet_insurance_consult_agent.yaml](../../../../examples/startup_app/demo_startup_app_with_multi_agents/intelligence/agentic/agent/agent_instance/insurance_consult_agent.yaml)
[insurance_consult_agent.yaml](../../../../examples/startup_app/demo_startup_app_with_multi_agents/intelligence/agentic/agent/agent_instance/insurance_consult_agent.yaml)
主智能体将几个智能体和工具按照一定的逻辑串接起来这里要注意的是参数的传递agent_input作为线程上下文可以存储中间产物给后面的智能体使用每个智能体的出入参字段是可以按照需求自定义建议不要重复。
## 运行测试
运行 [pet_insurance_consult_pro_agent_test.py](../../../../examples/startup_app/demo_startup_app_with_multi_agents/intelligence/test/insurance_multi_agent_test.py)
运行 [insurance_consult_pro_agent_test.py](../../../../examples/startup_app/demo_startup_app_with_multi_agents/intelligence/test/insurance_multi_agent_test.py)
![](../../_picture/demo_startup_petins_multi_agent_test.png)
**智能体 pet_question_planning_agent 执行结果为: **
**原问题改写后的问题是:**
```text
如何将宠物医保的基础版升级到升级版或尊享版?升级的具体流程和条件是什么?
如何将保险产品A的基础版升级到升级版或尊享版?升级的具体流程和条件是什么?
```
**智能体 pet_question_planning_agent 执行结果为:**
**智能体 question_planning_agent 执行结果为:**
```json
{
"sub_query_list": [
"如何将宠物医保的基础版升级到升级版或尊享版",
"宠物医保升级版和尊享版的具体保障内容有什么区别",
"升级宠物医保版本是否需要额外费用,费用如何计算"
"如何从保险产品A的基础版升级到更高版本",
"保险产品A升级版和尊享版的升级流程是什么",
"保险产品A升级时是否有额外费用或条件需要满足"
]
}
```
**pet_insurance_consult_agent 最终执行结果:**
**insurance_consult_agent 最终执行结果:**
```text
宠物医保在保障期间内不支持从基础版升级到升级版或尊享版。您如果希望获得更高版本的保障,可以在当前保单到期后,在续保时选择升级到所需的版本
请注意,续保时的保费可能会根据宠物的当前状况和保险公司的评估有所调整
险产品A在保障期间内不支持直接升级。如果您想要从当前的基础版升级到升级版或尊享版,需要在当前保险期结束后,重新选择更高版本的保险产品进行投保
请注意,升级时可能会有不同的保费标准,具体费用需依据您投保时的年龄和所选版本确定
```

View File

@@ -1,14 +1,14 @@
# 文档说明
在《构建典型的多智能体应用》中我们使用了1主3子4个智能体构建了一个典型的多智能体应用在本章节我们将进一步将这种智能体协同方式沉淀成标准模版来方便后续的复用与共享。
我们可以发现pet智能体问答场景主要包含了策划、执行与表达3个核心智能体。其中pet_insurance_planning_agent主要对于对用户的复杂问题进行拆分pet_insurance_executing_agent智能体主要负责问题检索执行对于对策划后的问题通过检索知识工具进行必要信息的收集pet_insurance_expressing_agent智能体结合用户提问进行最终的回答与表达。
我们可以发现保险咨询智能体问答场景主要包含了策划、执行与表达3个核心智能体。其中insurance_planning_agent主要对于对用户的复杂问题进行拆分insurance_executing_agent智能体主要负责问题检索执行对于对策划后的问题通过检索知识工具进行必要信息的收集insurance_expressing_agent智能体结合用户提问进行最终的回答与表达。
# 封装智能体模版
样例地址:[demo_startup_app_with_agent_templates](../../../../examples/startup_app/demo_startup_app_with_agent_templates)
在上面的多智能体应用中我们会发现,这种模式具备很强的复用性,我们将其运行过程抽象封装成一个智能体模版PetAgentTemplate。这样大部分的智能体问答类场景仅需基于这个模版做一些微小的调整就可以快速构建。
在上面的多智能体应用中我们会发现,这种模式具备很强的复用性,我们将其运行过程抽象封装成一个智能体模版InsuranceAgentTemplate。这样大部分的智能体问答类场景仅需基于这个模版做一些微小的调整就可以快速构建。
参考 [pet_agent_template.py](../../../../examples/startup_app/demo_startup_app_with_agent_templates/intelligence/agentic/agent/agent_template/insurance_agent_template.py)这里将智能体会用到的包括注册agent处理记忆/llm/工具/prompt以及执行主体的一些通用方法进行了一定的抽象这些方法在宠物险的智能体中大部分都可以复用。
参考 [insurance_agent_template.py](../../../../examples/startup_app/demo_startup_app_with_agent_templates/intelligence/agentic/agent/agent_template/insurance_agent_template.py)这里将智能体会用到的包括注册agent处理记忆/llm/工具/prompt以及执行主体的一些通用方法进行了一定的抽象这些方法在保险咨询的智能体中大部分都可以复用。
实际上AU框架提供了相当多的[智能体模版](../../../../agentuniverse/agent/template)包括RagReactPEER模式等建议使用这些现有的模版构建自己的智能体。

View File

@@ -6,12 +6,12 @@
样例地址:[demo_startup_app_with_single_agent_and_memory](../../../../examples/startup_app/demo_startup_app_with_single_agent_and_memory)
在AU智能体中记忆的使用同样通过配置挂载即可我们可以参考智能体[pet_insurance_agent](../../../../examples/startup_app/demo_startup_app_with_single_agent_and_memory/intelligence/agentic/agent/agent_instance/insurance_agent.yaml)配置中`memory`部分。
在AU智能体中记忆的使用同样通过配置挂载即可我们可以参考智能体[insurance_agent](../../../../examples/startup_app/demo_startup_app_with_single_agent_and_memory/intelligence/agentic/agent/agent_instance/insurance_agent.yaml)配置中`memory`部分。
在该案例中我们配置demo_memory作为记忆实例类型我们进一步在demo_memory.yaml(路径agentUniverse/examples/startup_app/demo_startup_app_with_single_agent_and_memory/intelligence/agentic/memory/demo_memory.yaml)中查看该实例的具体配置。
## 测试记忆模块
通过[pet_insurance_agent_test.py](../../../../examples/startup_app/demo_startup_app_with_single_agent_and_memory/intelligence/test/insurance_agent_test.py)测试入口可以看到智能体加入记忆模块后的使用情况。
通过[insurance_agent_test.py](../../../../examples/startup_app/demo_startup_app_with_single_agent_and_memory/intelligence/test/insurance_agent_test.py)测试入口可以看到智能体加入记忆模块后的使用情况。
![](../../_picture/demo_startup_agent_with_memory.png)
@@ -19,7 +19,7 @@
样例地址:[demo_startup_app_with_agent_templates](../../../../examples/startup_app/demo_startup_app_with_agent_templates)
在实际搭建多智能体应用的过程中我们面临大量prompt设置这些prompt将存在于各个yaml中。随着应用的内容增多越来越的prompt将变得难以管理。我们使用prompt管理模块将每一个prompt赋予唯一的prompt_version进行管理与使用。
以demo_startup_app_with_agent_templates工程中的智能体[pet_consult_pro_agent.yaml](../../../../examples/startup_app/demo_startup_app_with_agent_templates/intelligence/agentic/agent/agent_instance/insurance_consult_pro_agent.yaml)为例,在配置项中我们可以看到 prompt_version 配置为pet_insurance_consult.cn我们可以在 [prompt目录](../../../../examples/startup_app/demo_startup_app_with_agent_templates/intelligence/agentic/prompt)中找到其实际的prompt文件[pet_insurance_multi_agent_cn.yaml](../../../../examples/startup_app/demo_startup_app_with_agent_templates/intelligence/agentic/prompt/insurance_multi_agent_cn.yaml)。
以demo_startup_app_with_agent_templates工程中的智能体[insurance_consult_pro_agent.yaml](../../../../examples/startup_app/demo_startup_app_with_agent_templates/intelligence/agentic/agent/agent_instance/insurance_consult_pro_agent.yaml)为例,在配置项中我们可以看到 prompt_version 配置为insurance_consult.cn我们可以在 [prompt目录](../../../../examples/startup_app/demo_startup_app_with_agent_templates/intelligence/agentic/prompt)中找到其实际的prompt文件[insurance_multi_agent_cn.yaml](../../../../examples/startup_app/demo_startup_app_with_agent_templates/intelligence/agentic/prompt/insurance_multi_agent_cn.yaml)。
通过这种方式我们可以将大量prompt单独管理并复用起来。

View File

@@ -7,84 +7,60 @@
# @FileName: prod_description.py
PROD_A_DESCRIPTION = """
宠物医保(体验版)
1保险产品
"宠物医保(体验版)"(以下简称"赠险"免费体验30天到期后会自动承接付费版"宠物医保"(以下简称"商险"商险保障期12个月。
2投/被保险人
在中华人民共和国境内(不包括港、澳、台地区),饲养或受他人委托临时代为饲养(以下统称"饲养"宠物的年满16周岁的具备完全民事行为的个人可作为本保险的投被保险人。
3、被保险宠物:
本保险合同承保的宠物(以下简称"被保险宠物"为被保险人以玩赏、陪伴为目的而合法饲养的、可明确鉴别身份的年龄为60天-10周岁的犬类或猫类宠物。
4、保险期限:
"赠险"自投保申请核保通过后次日零时生效保险期间30天具体以保单载明的起讫时间为准若被保险宠物年龄不满足60天也可进行领取并约定保险生效日期约定的保险起讫时间将在保单中载明等待期从生效之日起算
"商险"自投保申请核保通过后于30天后或者"赠险"保险期间结束后的次日零时生效保险期间12个月具体以保单载明的起讫时间为准
5、"赠险"保障责任:
用于报销猫、狗宠物因常见疾病、意外事故而导致的医疗费用。先天、遗传性疾病不在本产品保障范围内。具体保障方案如下:
1. 保障总额20000元
2. 免赔额门诊0元手术0元
3. 报销比例: 定点医院70%若上一年未发生理赔赔付比例上调10%最高可达90%非定点医院40%若上一年未发生理赔赔付比例上调10%最高可达60%
4. 单次事故赔付上限门诊1200元手术2000元
5. 等待期: 意外医疗保险责任10天肿瘤和口腔疾病60天其他疾病30天。
6. 保障详情在保险期间内被保险人饲养的、在本保险合同中载明的被保险宠物在等待期届满后遭受意外伤害事故或罹患疾病因此在本保险合同中载明的宠物医疗机构接受本保险合同载明的医疗项目治疗的对于被保险人支付的必要的、合理的医疗费用保险人按照本合同的约定负责赔偿。被保险宠物在保险期间内接受上述治疗本合同保险期间届满时被保险宠物未结束本次治疗的保险人根据本保险合同约定继续承担保险责任延长保险责任期间由投保人与保险人协商确定但最长不超过30天并在本保险合同中载明
6、增值服务
"赠险"可享受每月200元消费额度本折扣额度非现金为权益抵扣价值在蚂蚁宠物商城买药、买服务可享优惠。体验30天到期转付费版商险可额外再享受三项增值服务犬多联/猫三联疫苗一针、体外驱虫一支、宠物医师电话咨询。
7、缴费方式及金额
30天的"赠险"产品属于赠送福利,免费体验,无需缴纳保险费
本产品保障期满会自动承接"商险",有月缴和年缴两种缴费方式,可根据需求自行选择:
a. 月缴猫类月保费为34.08元犬类月保费为37.5元。总共12期首期扣款时间为前序"赠险"30天保障期结束的前10天含终止日。剩余11期的扣款日是每月的"商险"保单生效日,如果当月该天不存在,就提前到当月的最后一天。举例,"赠险"是2024年1月29号保障期终止那么后续"商险"的月缴首期扣款日是2024年1月20号"商险"是2024年1月30号生效第二期扣款日是2024年2月29号因为当月30号不存在第三期扣款日是2024年3月30号以此类推
b. 年缴猫类年保费为409元犬类年保费为450元一次性为12个月的"商险"全额缴费。扣款时间为前序"赠险"30天保障期结束的前10天含终止日。举例"赠险"是2024年1月29号保障期终止那么后续"商险"的年缴扣款日是2024年1月20号
8、产品犹豫期
本产品无犹豫期。
9、续保规则
赠险不存在续保的情况赠险保障期限30天保障到期自动承接商险。
商险续保规则如下:
1. 不保证续保。
2. 您在本年度投保时选择了开通下一年延续保障(以下简称"续保"服务并同意相关服务协议或在该保单到期前30天内或到期后15天内为同一被保险人重新申请投保的经保险人审核同意后缴纳保费重新获得新的保险合同续保时会根据上一年度风险重新厘定具体缴纳保费以保单展示为准、保障范围以重新出具的保单约定及对应投保须知内容为准。
3. 本年度未出险的续保保单赔付比例提高10%定点医院最高赔付比例为90%非定点医院最高赔付比例为60%若续保保单出险第三年经保险人审核同意续保的定点医院赔付比例恢复到70%非定点医院赔付比例恢复到40%
10、产品合同解除退保规则
赠险期间可以随时取消或退保,可以在【蚂蚁保】-【我的】-【全部保单】中找到对应保单进行操作退还保费为0元。
"赠险"生效后免费体验期为30天到期后会自动承接至付费版"商险""商险"退保规则如下:
1. 保单未生效:保单未生效申请退保,将全额退还已缴纳的保险费;
2. 保单已生效:
a. 年缴保单:在保单生效后申请退保的,将退还未满期保险费。计算公式为:未满期保险费=保险费×(1- 保险单已经过天数/保险期间天数)。
b. 月缴保单:在保单生效后申请退保的,将退还未满期保险费。计算公式为:退还未满期保险费=本合同当期月度保险费×(1-当月实际经过天数/当月实际天数)。
保险产品A
1. 保险产品名称
产品名称保险产品A
2. 投/被保险人
投保人资格年满18岁至60岁的自然人。
被保险人范围:投保人本人或其直系亲属(配偶、子女、父母)。
3. 保险期限
保险期间:一年期,自保单生效日起算。
4. "赠险"保障责任
赠送保障内容若被保险人在保险期间内首次确诊患有重大疾病则额外获得一次性的健康关怀金人民币5万元
适用条件:仅限于初次诊断为本合同所定义的重大疾病之一,并且该病症发生在保险有效期内。
5. 增值服务
紧急救援服务包括但不限于24小时医疗咨询热线、国内外紧急医疗转运等。
健康管理服务:年度体检优惠券、在线医生咨询服务等。
6. 缴费方式及金额
缴费方式:支持一次性支付或按月分期支付。
保费标准:
一次性支付成人每年1200元儿童每年600元
按月支付成人每月100元儿童每月50元。
7. 续保规则
自动续保选项客户可以选择是否开启自动续保功能。如果开启了此功能在每个保险年度结束前30天内未收到取消通知的情况下系统将自动从指定账户扣取下一年度的保费以完成续保。
续保审核:对于选择不使用自动续保功能的客户,需要在当前保险期结束前向保险公司提出续保申请,并通过公司的审核后才能继续享受保障
8. 产品合同解除(退保)规则
犹豫期内退保购买后15天内为犹豫期在此期间内如需退保只需扣除不超过10元的成本费用即可全额退款
正常退保:超过犹豫期后的任何时间点均可申请退保,但只能退还现金价值部分,具体数额根据已交纳保费总额以及剩余保险期限等因素计算得出
"""
PROD_B_DESCRIPTION = """
宠物医
1保险产品
"宠物医保"(以下简称"商险"保障期限12个月是付费版商业险有三个保障基础版、升级版、尊享版。
2投/被保险人
在中华人民共和国境内(不包括港、澳、台地区),饲养或受他人委托临时代为饲养(以下统称"饲养"宠物的年满16周岁的具备完全民事行为的个人可作为本保险的投被保险人。
3、被保险宠物:
本保险合同承保的宠物(以下简称"被保险宠物"为被保险人以玩赏、陪伴为目的而合法饲养的、可明确鉴别身份的年龄为60天-10周岁的犬类或猫类宠物。
4、保险期限
"商险"自投保申请核保通过后次日零时生效保险期间12个月具体以保单载明的起讫时间为准
5、""保障责任
用于报销猫、狗宠物因常见疾病、意外事故导致的医疗费用。先天、遗传性疾病不在本产品保障范围内。具体责任上,分为三个保障方案:基础版、升级版、尊享版,具体方案如下:
1. 保障总额基础版10000元升级版20000元尊享版30000元
2. 免赔额基础版、升级版、尊享版均一样门诊0元手术0元
3. 报销比例: 定点医院70%若上一年未发生理赔赔付比例上调10%最高可达90%非定点医院40%若上一年未发生理赔赔付比例上调10%最高可达90%
4. 单次事故赔付上限1基础版门诊500元手术1000元2升级版门诊1200元手术2000元3尊享版门诊2000元手术3000元
5. 等待期: 首次或非连续投保本保险时意外医疗保险责任10天肿瘤和口腔疾病60天其他疾病30天。
6. 保障详情在保险期间内被保险人饲养的、在本合同中载明的被保险宠物在等待期届满后遭受意外伤害事故或罹患疾病因此在本合同中载明的宠物医疗机构接受本合同载明的医疗项目治疗的对于被保险人支付的必要的、合理的医疗费用保险人按照本合同的约定负责赔偿。保险期满时被保险宠物仍然需要接受治疗的保险人根据本合同的约定继续承担保险责任最长截至保险期满之日起第30日止。
6、增值服务
增值服务是本产品赠送的高价值宠物健康服务。具体包括包括以下服务:
1基础版邮寄体外驱虫药1支电话问诊咨询每月200元消费额度。
2升级版邮寄体外驱虫药1支电话问诊咨询犬多联/猫三联疫苗一针每月200元消费额度。
3尊享版邮寄体外驱虫药1支电话问诊咨询犬多联/猫三联疫苗一针狂犬疫苗1针全面体检1次含粪检、血常规每月200元消费额度。
7、缴费方式及金额:
本保险方案有月缴和年缴两种缴费方式,可根据需求自行选择:
a. 月缴基础版猫类月保费为17.33元犬类月保费为21.58元升级版猫类月保费为34.08元犬类月保费为37.5元尊享版猫类月保费67.08元犬类月保费73元。总共12期首期付款时间为投保当日。剩余11期的扣款日是每月的"商险"保单生效日如果当月该天不存在就提前到当月的最后一天。举例被保人2024年1月29号投保"商险"并选择月缴方式则当天2024年1月29号进行首期付款"商险"于次日2024年1月30号生效第二期扣款日是2024年2月29号因为当月30号不存在第三期扣款日是2024年3月30号以此类推
b. 年缴基础版猫类年保费为208元犬类年保费为259元升级版猫类年保费为409元犬类年保费为450元尊享版猫类年保费805元犬类年保费876元。需要在投保当日一次性全额扣款。
8、产品犹豫期
本产品无犹豫期。
9、续保规则
商险是不保证续保的。
您在本年度投保时选择了开通下一年延续保障(以下简称"续保"服务并同意相关服务协议或在该保单到期前30天内或到期后15天内为同一被保险人重新申请投保的经保险人审核同意后缴纳保费重新获得新的保险合同续保时会根据上一年度风险重新厘定具体缴纳保费以保单展示为准、保障范围以重新出具的保单约定及对应投保须知内容为准。
本年度未出险的续保保单赔付比例提高10%定点医院最高赔付比例为90%非定点医院最高赔付比例为60%若续保保单出险第三年经保险人审核同意续保的定点医院赔付比例恢复到70%非定点医院赔付比例恢复到40%
10、产品合同解除退保规则
1. 保单未生效:保单未生效申请退保,将全额退还已缴纳的保险费;
2. 保单已生效:
a. 年缴保单:在保单生效后申请退保的,将退还未满期保险费。计算公式为:未满期保险费=保险费×(1- 保险单已经过天数/保险期间天数)。
b. 月缴保单:在保单生效后申请退保的,将退还未满期保险费。计算公式为:退还未满期保险费=本合同当期月度保险费×(1-当月实际经过天数/当月实际天数)。
"""
险产品B
1. 保险产品名称
产品全称保险产品B
2. 投/被保险人资格
投保人资格年满18周岁至60周岁的自然人。
被保险人资格出生满30天至65周岁的自然人且与投保人存在直系亲属关系或为本人。
3. 保险期限
基本期限:本合同的有效期为一年。
续保条件满足续保要求时可自动续保最长不超过70岁
4. ""保障责任
意外伤害医疗保险金:对于因意外事故导致的医疗费用在扣除免赔额后按比例赔付最高限额为人民币1万元。
紧急救援服务:提供全球范围内的紧急医疗转运服务一次。
5. 增值服务
健康管理咨询:每年享有两次免费的专业健康管理咨询服务。
在线医生问诊:不限次数地享受指定平台上的在线医生咨询服务。
6. 缴费方式及金额
缴费方式:支持一次性支付、分期付款两种模式。
保费标准
年龄<30岁¥800元/年
30≤年龄<45岁¥1,200元/年
45≤年龄<60岁¥1,500元/年
60≤年龄<65岁¥2,000元/年
7. 续保规则
自动续保:如无特殊说明,本保险将于到期前一个月内自动发送续保通知,客户需确认是否继续投保。
调整费率:保险公司保留根据市场情况调整下一年度保费的权利
8. 产品合同解除(退保)规则
犹豫期内退保自收到保险单之日起15日内申请退保者全额退还已缴纳保费。
犹豫期外退保:超过犹豫期后提出退保申请,则按照公司规定计算现金价值予以退还;若未满一个保单年度,则可能产生手续费损失
"""

View File

@@ -7,84 +7,60 @@
# @FileName: prod_description.py
PROD_A_DESCRIPTION = """
宠物医保(体验版)
1保险产品
"宠物医保(体验版)"(以下简称"赠险"免费体验30天到期后会自动承接付费版"宠物医保"(以下简称"商险"商险保障期12个月。
2投/被保险人
在中华人民共和国境内(不包括港、澳、台地区),饲养或受他人委托临时代为饲养(以下统称"饲养"宠物的年满16周岁的具备完全民事行为的个人可作为本保险的投被保险人。
3、被保险宠物:
本保险合同承保的宠物(以下简称"被保险宠物"为被保险人以玩赏、陪伴为目的而合法饲养的、可明确鉴别身份的年龄为60天-10周岁的犬类或猫类宠物。
4、保险期限:
"赠险"自投保申请核保通过后次日零时生效保险期间30天具体以保单载明的起讫时间为准若被保险宠物年龄不满足60天也可进行领取并约定保险生效日期约定的保险起讫时间将在保单中载明等待期从生效之日起算
"商险"自投保申请核保通过后于30天后或者"赠险"保险期间结束后的次日零时生效保险期间12个月具体以保单载明的起讫时间为准
5、"赠险"保障责任:
用于报销猫、狗宠物因常见疾病、意外事故而导致的医疗费用。先天、遗传性疾病不在本产品保障范围内。具体保障方案如下:
1. 保障总额20000元
2. 免赔额门诊0元手术0元
3. 报销比例: 定点医院70%若上一年未发生理赔赔付比例上调10%最高可达90%非定点医院40%若上一年未发生理赔赔付比例上调10%最高可达60%
4. 单次事故赔付上限门诊1200元手术2000元
5. 等待期: 意外医疗保险责任10天肿瘤和口腔疾病60天其他疾病30天。
6. 保障详情在保险期间内被保险人饲养的、在本保险合同中载明的被保险宠物在等待期届满后遭受意外伤害事故或罹患疾病因此在本保险合同中载明的宠物医疗机构接受本保险合同载明的医疗项目治疗的对于被保险人支付的必要的、合理的医疗费用保险人按照本合同的约定负责赔偿。被保险宠物在保险期间内接受上述治疗本合同保险期间届满时被保险宠物未结束本次治疗的保险人根据本保险合同约定继续承担保险责任延长保险责任期间由投保人与保险人协商确定但最长不超过30天并在本保险合同中载明
6、增值服务
"赠险"可享受每月200元消费额度本折扣额度非现金为权益抵扣价值在蚂蚁宠物商城买药、买服务可享优惠。体验30天到期转付费版商险可额外再享受三项增值服务犬多联/猫三联疫苗一针、体外驱虫一支、宠物医师电话咨询。
7、缴费方式及金额
30天的"赠险"产品属于赠送福利,免费体验,无需缴纳保险费
本产品保障期满会自动承接"商险",有月缴和年缴两种缴费方式,可根据需求自行选择:
a. 月缴猫类月保费为34.08元犬类月保费为37.5元。总共12期首期扣款时间为前序"赠险"30天保障期结束的前10天含终止日。剩余11期的扣款日是每月的"商险"保单生效日,如果当月该天不存在,就提前到当月的最后一天。举例,"赠险"是2024年1月29号保障期终止那么后续"商险"的月缴首期扣款日是2024年1月20号"商险"是2024年1月30号生效第二期扣款日是2024年2月29号因为当月30号不存在第三期扣款日是2024年3月30号以此类推
b. 年缴猫类年保费为409元犬类年保费为450元一次性为12个月的"商险"全额缴费。扣款时间为前序"赠险"30天保障期结束的前10天含终止日。举例"赠险"是2024年1月29号保障期终止那么后续"商险"的年缴扣款日是2024年1月20号
8、产品犹豫期
本产品无犹豫期。
9、续保规则
赠险不存在续保的情况赠险保障期限30天保障到期自动承接商险。
商险续保规则如下:
1. 不保证续保。
2. 您在本年度投保时选择了开通下一年延续保障(以下简称"续保"服务并同意相关服务协议或在该保单到期前30天内或到期后15天内为同一被保险人重新申请投保的经保险人审核同意后缴纳保费重新获得新的保险合同续保时会根据上一年度风险重新厘定具体缴纳保费以保单展示为准、保障范围以重新出具的保单约定及对应投保须知内容为准。
3. 本年度未出险的续保保单赔付比例提高10%定点医院最高赔付比例为90%非定点医院最高赔付比例为60%若续保保单出险第三年经保险人审核同意续保的定点医院赔付比例恢复到70%非定点医院赔付比例恢复到40%
10、产品合同解除退保规则
赠险期间可以随时取消或退保,可以在【蚂蚁保】-【我的】-【全部保单】中找到对应保单进行操作退还保费为0元。
"赠险"生效后免费体验期为30天到期后会自动承接至付费版"商险""商险"退保规则如下:
1. 保单未生效:保单未生效申请退保,将全额退还已缴纳的保险费;
2. 保单已生效:
a. 年缴保单:在保单生效后申请退保的,将退还未满期保险费。计算公式为:未满期保险费=保险费×(1- 保险单已经过天数/保险期间天数)。
b. 月缴保单:在保单生效后申请退保的,将退还未满期保险费。计算公式为:退还未满期保险费=本合同当期月度保险费×(1-当月实际经过天数/当月实际天数)。
保险产品A
1. 保险产品名称
产品名称保险产品A
2. 投/被保险人
投保人资格年满18岁至60岁的自然人。
被保险人范围:投保人本人或其直系亲属(配偶、子女、父母)。
3. 保险期限
保险期间:一年期,自保单生效日起算。
4. "赠险"保障责任
赠送保障内容若被保险人在保险期间内首次确诊患有重大疾病则额外获得一次性的健康关怀金人民币5万元
适用条件:仅限于初次诊断为本合同所定义的重大疾病之一,并且该病症发生在保险有效期内。
5. 增值服务
紧急救援服务包括但不限于24小时医疗咨询热线、国内外紧急医疗转运等。
健康管理服务:年度体检优惠券、在线医生咨询服务等。
6. 缴费方式及金额
缴费方式:支持一次性支付或按月分期支付。
保费标准:
一次性支付成人每年1200元儿童每年600元
按月支付成人每月100元儿童每月50元。
7. 续保规则
自动续保选项客户可以选择是否开启自动续保功能。如果开启了此功能在每个保险年度结束前30天内未收到取消通知的情况下系统将自动从指定账户扣取下一年度的保费以完成续保。
续保审核:对于选择不使用自动续保功能的客户,需要在当前保险期结束前向保险公司提出续保申请,并通过公司的审核后才能继续享受保障
8. 产品合同解除(退保)规则
犹豫期内退保购买后15天内为犹豫期在此期间内如需退保只需扣除不超过10元的成本费用即可全额退款
正常退保:超过犹豫期后的任何时间点均可申请退保,但只能退还现金价值部分,具体数额根据已交纳保费总额以及剩余保险期限等因素计算得出
"""
PROD_B_DESCRIPTION = """
宠物医
1保险产品
"宠物医保"(以下简称"商险"保障期限12个月是付费版商业险有三个保障基础版、升级版、尊享版。
2投/被保险人
在中华人民共和国境内(不包括港、澳、台地区),饲养或受他人委托临时代为饲养(以下统称"饲养"宠物的年满16周岁的具备完全民事行为的个人可作为本保险的投被保险人。
3、被保险宠物:
本保险合同承保的宠物(以下简称"被保险宠物"为被保险人以玩赏、陪伴为目的而合法饲养的、可明确鉴别身份的年龄为60天-10周岁的犬类或猫类宠物。
4、保险期限
"商险"自投保申请核保通过后次日零时生效保险期间12个月具体以保单载明的起讫时间为准
5、""保障责任
用于报销猫、狗宠物因常见疾病、意外事故导致的医疗费用。先天、遗传性疾病不在本产品保障范围内。具体责任上,分为三个保障方案:基础版、升级版、尊享版,具体方案如下:
1. 保障总额基础版10000元升级版20000元尊享版30000元
2. 免赔额基础版、升级版、尊享版均一样门诊0元手术0元
3. 报销比例: 定点医院70%若上一年未发生理赔赔付比例上调10%最高可达90%非定点医院40%若上一年未发生理赔赔付比例上调10%最高可达90%
4. 单次事故赔付上限1基础版门诊500元手术1000元2升级版门诊1200元手术2000元3尊享版门诊2000元手术3000元
5. 等待期: 首次或非连续投保本保险时意外医疗保险责任10天肿瘤和口腔疾病60天其他疾病30天。
6. 保障详情在保险期间内被保险人饲养的、在本合同中载明的被保险宠物在等待期届满后遭受意外伤害事故或罹患疾病因此在本合同中载明的宠物医疗机构接受本合同载明的医疗项目治疗的对于被保险人支付的必要的、合理的医疗费用保险人按照本合同的约定负责赔偿。保险期满时被保险宠物仍然需要接受治疗的保险人根据本合同的约定继续承担保险责任最长截至保险期满之日起第30日止。
6、增值服务
增值服务是本产品赠送的高价值宠物健康服务。具体包括包括以下服务:
1基础版邮寄体外驱虫药1支电话问诊咨询每月200元消费额度。
2升级版邮寄体外驱虫药1支电话问诊咨询犬多联/猫三联疫苗一针每月200元消费额度。
3尊享版邮寄体外驱虫药1支电话问诊咨询犬多联/猫三联疫苗一针狂犬疫苗1针全面体检1次含粪检、血常规每月200元消费额度。
7、缴费方式及金额:
本保险方案有月缴和年缴两种缴费方式,可根据需求自行选择:
a. 月缴基础版猫类月保费为17.33元犬类月保费为21.58元升级版猫类月保费为34.08元犬类月保费为37.5元尊享版猫类月保费67.08元犬类月保费73元。总共12期首期付款时间为投保当日。剩余11期的扣款日是每月的"商险"保单生效日如果当月该天不存在就提前到当月的最后一天。举例被保人2024年1月29号投保"商险"并选择月缴方式则当天2024年1月29号进行首期付款"商险"于次日2024年1月30号生效第二期扣款日是2024年2月29号因为当月30号不存在第三期扣款日是2024年3月30号以此类推
b. 年缴基础版猫类年保费为208元犬类年保费为259元升级版猫类年保费为409元犬类年保费为450元尊享版猫类年保费805元犬类年保费876元。需要在投保当日一次性全额扣款。
8、产品犹豫期
本产品无犹豫期。
9、续保规则
商险是不保证续保的。
您在本年度投保时选择了开通下一年延续保障(以下简称"续保"服务并同意相关服务协议或在该保单到期前30天内或到期后15天内为同一被保险人重新申请投保的经保险人审核同意后缴纳保费重新获得新的保险合同续保时会根据上一年度风险重新厘定具体缴纳保费以保单展示为准、保障范围以重新出具的保单约定及对应投保须知内容为准。
本年度未出险的续保保单赔付比例提高10%定点医院最高赔付比例为90%非定点医院最高赔付比例为60%若续保保单出险第三年经保险人审核同意续保的定点医院赔付比例恢复到70%非定点医院赔付比例恢复到40%
10、产品合同解除退保规则
1. 保单未生效:保单未生效申请退保,将全额退还已缴纳的保险费;
2. 保单已生效:
a. 年缴保单:在保单生效后申请退保的,将退还未满期保险费。计算公式为:未满期保险费=保险费×(1- 保险单已经过天数/保险期间天数)。
b. 月缴保单:在保单生效后申请退保的,将退还未满期保险费。计算公式为:退还未满期保险费=本合同当期月度保险费×(1-当月实际经过天数/当月实际天数)。
"""
险产品B
1. 保险产品名称
产品全称保险产品B
2. 投/被保险人资格
投保人资格年满18周岁至60周岁的自然人。
被保险人资格出生满30天至65周岁的自然人且与投保人存在直系亲属关系或为本人。
3. 保险期限
基本期限:本合同的有效期为一年。
续保条件满足续保要求时可自动续保最长不超过70岁
4. ""保障责任
意外伤害医疗保险金:对于因意外事故导致的医疗费用在扣除免赔额后按比例赔付最高限额为人民币1万元。
紧急救援服务:提供全球范围内的紧急医疗转运服务一次。
5. 增值服务
健康管理咨询:每年享有两次免费的专业健康管理咨询服务。
在线医生问诊:不限次数地享受指定平台上的在线医生咨询服务。
6. 缴费方式及金额
缴费方式:支持一次性支付、分期付款两种模式。
保费标准
年龄<30岁¥800元/年
30≤年龄<45岁¥1,200元/年
45≤年龄<60岁¥1,500元/年
60≤年龄<65岁¥2,000元/年
7. 续保规则
自动续保:如无特殊说明,本保险将于到期前一个月内自动发送续保通知,客户需确认是否继续投保。
调整费率:保险公司保留根据市场情况调整下一年度保费的权利
8. 产品合同解除(退保)规则
犹豫期内退保自收到保险单之日起15日内申请退保者全额退还已缴纳保费。
犹豫期外退保:超过犹豫期后提出退保申请,则按照公司规定计算现金价值予以退还;若未满一个保单年度,则可能产生手续费损失
"""

View File

@@ -8,29 +8,29 @@
# mock的特定背景知识用于回答宠物医保升级相关问题。
PROD_DESCRIPTION_A = """
宠物医保在保障期间暂不支持升级。宠物医保有基础版、升级版、尊享版三个版本,投保某一版本后不支持升级为别的版本。
如果您希望享受更高级别的保障,可以在当前保险期结束后,重新选择更高版本的宠物医保进行投保。例如,从基础版升级到升级版或尊享版。
宠物医保
1、保险产品
"宠物医保"(以下简称"商险"保障期限12个月是付费版商业险有三个保障基础版、升级版、尊享版
2、投/被保险人:
在中华人民共和国境内(不包括港、澳、台地区),饲养或受他人委托临时代为饲养(以下统称"饲养"宠物的年满16周岁的具备完全民事行为的个人可作为本保险的投被保险人
3、被保险宠物
本保险合同承保的宠物(以下简称"被保险宠物"为被保险人以玩赏、陪伴为目的而合法饲养的、可明确鉴别身份的年龄为60天-10周岁的犬类或猫类宠物
4、保险期限
"商险"自投保申请核保通过后次日零时生效保险期间12个月具体以保单载明的起讫时间为准
5、"商险"保障责任:
用于报销猫、狗宠物因常见疾病、意外事故而导致的医疗费用。先天、遗传性疾病不在本产品保障范围内。具体责任上,分为三个保障方案:基础版、升级版、尊享版,具体方案如下:
1. 保障总额基础版10000元升级版20000元尊享版30000元
2. 免赔额基础版、升级版、尊享版均一样门诊0元手术0元
3. 报销比例: 定点医院70%若上一年未发生理赔赔付比例上调10%最高可达90%非定点医院40%若上一年未发生理赔赔付比例上调10%最高可达90%
4. 单次事故赔付上限1基础版门诊500元手术1000元2升级版门诊1200元手术2000元3尊享版门诊2000元手术3000元
5. 等待期: 首次或非连续投保本保险时意外医疗保险责任10天肿瘤和口腔疾病60天其他疾病30天
6. 保障详情在保险期间内被保险人饲养的、在本合同中载明的被保险宠物在等待期届满后遭受意外伤害事故或罹患疾病因此在本合同中载明的宠物医疗机构接受本合同载明的医疗项目治疗的对于被保险人支付的必要的、合理的医疗费用保险人按照本合同的约定负责赔偿。保险期满时被保险宠物仍然需要接受治疗的保险人根据本合同的约定继续承担保险责任最长截至保险期满之日起第30日止。
6、增值服务
增值服务是本产品赠送的高价值宠物健康服务。具体包括包括以下服务:
1基础版邮寄体外驱虫药1支电话问诊咨询每月200元消费额度。
2升级版邮寄体外驱虫药1支电话问诊咨询犬多联/猫三联疫苗一针每月200元消费额度
3尊享版邮寄体外驱虫药1支电话问诊咨询犬多联/猫三联疫苗一针狂犬疫苗1针全面体检1次含粪检、血常规每月200元消费额度
保险产品A
1. 保险产品名称
产品名称保险产品A
2. 投/被保险人
投保人资格年满18岁至60岁的自然人。
被保险人范围:投保人本人或其直系亲属(配偶、子女、父母)
3. 保险期限
保险期间:一年期,自保单生效日起算
4. "赠险"保障责任
赠送保障内容若被保险人在保险期间内首次确诊患有重大疾病则额外获得一次性的健康关怀金人民币5万元
适用条件:仅限于初次诊断为本合同所定义的重大疾病之一,并且该病症发生在保险有效期内。
5. 增值服务
紧急救援服务包括但不限于24小时医疗咨询热线、国内外紧急医疗转运等。
健康管理服务:年度体检优惠券、在线医生咨询服务等。
6. 缴费方式及金额
缴费方式:支持一次性支付或按月分期支付。
保费标准:
一次性支付成人每年1200元儿童每年600元。
按月支付成人每月100元儿童每月50元
7. 续保规则
自动续保选项客户可以选择是否开启自动续保功能。如果开启了此功能在每个保险年度结束前30天内未收到取消通知的情况下系统将自动从指定账户扣取下一年度的保费以完成续保。
续保审核:对于选择不使用自动续保功能的客户,需要在当前保险期结束前向保险公司提出续保申请,并通过公司的审核后才能继续享受保障。
8. 产品合同解除(退保)规则
犹豫期内退保购买后15天内为犹豫期在此期间内如需退保只需扣除不超过10元的成本费用即可全额退款
正常退保:超过犹豫期后的任何时间点均可申请退保,但只能退还现金价值部分,具体数额根据已交纳保费总额以及剩余保险期限等因素计算得出
"""

View File

@@ -63,4 +63,4 @@ PROD_B_DESCRIPTION = """
8. 产品合同解除(退保)规则
犹豫期内退保自收到保险单之日起15日内申请退保者全额退还已缴纳保费。
犹豫期外退保:超过犹豫期后提出退保申请,则按照公司规定计算现金价值予以退还;若未满一个保单年度,则可能产生手续费损失。
"""
"""

View File

@@ -22,5 +22,5 @@ def chat(question: str, session_id: str):
if __name__ == '__main__':
s_id = str(uuid.uuid4())
chat("保险产品A怎么升级", s_id)
chat("保险产品A怎么续保", s_id)
chat("我刚才问了什么问题", s_id)

View File

@@ -8,29 +8,29 @@
# mock的特定背景知识用于回答宠物医保升级相关问题。
PROD_DESCRIPTION_A = """
宠物医保在保障期间暂不支持升级。宠物医保有基础版、升级版、尊享版三个版本,投保某一版本后不支持升级为别的版本。
如果您希望享受更高级别的保障,可以在当前保险期结束后,重新选择更高版本的宠物医保进行投保。例如,从基础版升级到升级版或尊享版。
宠物医保
1、保险产品
"宠物医保"(以下简称"商险"保障期限12个月是付费版商业险有三个保障基础版、升级版、尊享版
2、投/被保险人:
在中华人民共和国境内(不包括港、澳、台地区),饲养或受他人委托临时代为饲养(以下统称"饲养"宠物的年满16周岁的具备完全民事行为的个人可作为本保险的投被保险人
3、被保险宠物
本保险合同承保的宠物(以下简称"被保险宠物"为被保险人以玩赏、陪伴为目的而合法饲养的、可明确鉴别身份的年龄为60天-10周岁的犬类或猫类宠物
4、保险期限
"商险"自投保申请核保通过后次日零时生效保险期间12个月具体以保单载明的起讫时间为准
5、"商险"保障责任:
用于报销猫、狗宠物因常见疾病、意外事故而导致的医疗费用。先天、遗传性疾病不在本产品保障范围内。具体责任上,分为三个保障方案:基础版、升级版、尊享版,具体方案如下:
1. 保障总额基础版10000元升级版20000元尊享版30000元
2. 免赔额基础版、升级版、尊享版均一样门诊0元手术0元
3. 报销比例: 定点医院70%若上一年未发生理赔赔付比例上调10%最高可达90%非定点医院40%若上一年未发生理赔赔付比例上调10%最高可达90%
4. 单次事故赔付上限1基础版门诊500元手术1000元2升级版门诊1200元手术2000元3尊享版门诊2000元手术3000元
5. 等待期: 首次或非连续投保本保险时意外医疗保险责任10天肿瘤和口腔疾病60天其他疾病30天
6. 保障详情在保险期间内被保险人饲养的、在本合同中载明的被保险宠物在等待期届满后遭受意外伤害事故或罹患疾病因此在本合同中载明的宠物医疗机构接受本合同载明的医疗项目治疗的对于被保险人支付的必要的、合理的医疗费用保险人按照本合同的约定负责赔偿。保险期满时被保险宠物仍然需要接受治疗的保险人根据本合同的约定继续承担保险责任最长截至保险期满之日起第30日止。
6、增值服务
增值服务是本产品赠送的高价值宠物健康服务。具体包括包括以下服务:
1基础版邮寄体外驱虫药1支电话问诊咨询每月200元消费额度。
2升级版邮寄体外驱虫药1支电话问诊咨询犬多联/猫三联疫苗一针每月200元消费额度
3尊享版邮寄体外驱虫药1支电话问诊咨询犬多联/猫三联疫苗一针狂犬疫苗1针全面体检1次含粪检、血常规每月200元消费额度
保险产品A
1. 保险产品名称
产品名称保险产品A
2. 投/被保险人
投保人资格年满18岁至60岁的自然人。
被保险人范围:投保人本人或其直系亲属(配偶、子女、父母)
3. 保险期限
保险期间:一年期,自保单生效日起算
4. "赠险"保障责任
赠送保障内容若被保险人在保险期间内首次确诊患有重大疾病则额外获得一次性的健康关怀金人民币5万元
适用条件:仅限于初次诊断为本合同所定义的重大疾病之一,并且该病症发生在保险有效期内。
5. 增值服务
紧急救援服务包括但不限于24小时医疗咨询热线、国内外紧急医疗转运等。
健康管理服务:年度体检优惠券、在线医生咨询服务等。
6. 缴费方式及金额
缴费方式:支持一次性支付或按月分期支付。
保费标准:
一次性支付成人每年1200元儿童每年600元。
按月支付成人每月100元儿童每月50元
7. 续保规则
自动续保选项客户可以选择是否开启自动续保功能。如果开启了此功能在每个保险年度结束前30天内未收到取消通知的情况下系统将自动从指定账户扣取下一年度的保费以完成续保。
续保审核:对于选择不使用自动续保功能的客户,需要在当前保险期结束前向保险公司提出续保申请,并通过公司的审核后才能继续享受保障。
8. 产品合同解除(退保)规则
犹豫期内退保购买后15天内为犹豫期在此期间内如需退保只需扣除不超过10元的成本费用即可全额退款
正常退保:超过犹豫期后的任何时间点均可申请退保,但只能退还现金价值部分,具体数额根据已交纳保费总额以及剩余保险期限等因素计算得出
"""