contexts
Customer service related dialog design often requires the user to confirm that the current action is complete before performing the next action, and there are two ways to accomplish this:
1. Routing 2. Cue words
1. Routing
Generally by the big model to determine the state of the user, and then perform the corresponding node service, which is somewhat similar to the arrangement of "intelligent customer service" node. Example: After asking the name, the next step is to get the phone number.
Typical routing transit node hint words:
您将获得<客户服务查询>。 将每个<客户服务查询>分类为主要类别和次要类别。 以Json格式提供输出,key为:<primary>和<secondary>。只需要输出Json格式的输出结果,其他的不需要输出。 主要类别:<结算>、<技术支持>、<账户管理>或<一般查询>。 <结算>次要类别:\ 取消订阅或升级 \ 添加付款方式 \ 有关费用的说明 \ 争议费用 <技术支持>次要类别:\ 一般故障排除\ 设备兼容性 \ 软件更新 \ <账户管理>次要类别:\ 重置密码 \ 更新个人信息 \ 关闭账户 \ 账户安全 \ <一般查询>次要类别: 产品信息 \ 支付 \ 反馈 \ 与人交谈 \ --- 客户服务查询:我想让你删除我的个人资料和我所有的用户数据
exports
{ "primary": "账户管理", "secondary": "关闭账户" }
The developer uses this state to continue designing subsequent service nodes.
2. Cue word
Retrofit on top of routing instructions to add subsequent service nodes.
您将获得<客户服务查询>。 ## 服务流程 1.首选确认用户的问题分类,问题分类如下: 主要类别:<结算>、<技术支持>、<账户管理>或<一般查询>。 <结算>次要类别:\ 取消订阅或升级 \ 添加付款方式 \ 有关费用的说明 \ 争议费用 <技术支持>次要类别:\ 一般故障排除\ 设备兼容性 \ 软件更新 \ <账户管理>次要类别:\ 重置密码 \ 更新个人信息 \ 关闭账户 \ 账户安全 \ <一般查询>次要类别: 产品信息 \ 支付 \ 反馈 \ 与人交谈 \ 2.当用户确认问题分类准确,根据上下文解答操作步骤 3.用户认可操作步骤后,并向用户友好的问候,并结束该话题。 --- {上下文} --- 客户服务查询:我想让你删除我的个人资料和我所有的用户数据
When designing prompts, we often describe the "process", one is to let the big model follow the process step by step; the other is to ask the big model to follow the process step by step interaction.
The above cue word example is the latter, which requires a large model as a context to participate in the "judgment", similar to a "state machine".
The cue word describes the shortcomings of the judgment process:Unstable, as historical context is truncated and difficult to describe logically (resulting instability).
A new approach given by OpenAI
The principle is simple, define a set of dialog states in the context of a user's dialog:
# 对话状态 ```json { "id": "1_intro", "description": "引导客户提供个人信息和穿着场合信息,了解他们的需求。", "instructions": [ "友好地问候客户,并询问他们的年龄、性别、职业及个人喜好。", "确认客户的穿着场合(如正式、休闲、约会等),以便为他们推荐合适的服装搭配。" ], "examples": [ "您好!为了更好地帮助您选择搭配,能否先告诉我您的年龄、性别以及职业?", "请问您打算穿着这些服装出席什么场合呢?是工作、约会还是休闲活动?" ], "transitions": [{ "next_step": "2_recommend_outfit", "condition": "客户提供了个人信息和穿着场合信息后。" }] } ``` ```json { "id": "2_recommend_outfit", "description": "根据客户提供的信息推荐合适的服装搭配。", "instructions": [ "基于客户的个人信息和穿着场合,提供两到三个服装搭配建议。", "为每个搭配提供详细的描述,包括服装类型、搭配方式以及如何搭配饰品等。" ], "examples": [ "根据您的职业和即将参加的商务会议,我推荐您穿一套深色西装,配上一条简约的领带。", "如果您准备参加一个轻松的聚会,可以试试牛仔裤搭配一件休闲衬衫,再加上一双舒适的鞋子。" ], "transitions": [{ "next_step": "3_get_feedback", "condition": "客户已经收到了服装推荐并准备给出反馈。" }] } ``` ```json { "id": "3_get_feedback", "description": "根据客户的反馈进行调整或确认推荐。", "instructions": [ "询问客户是否对推荐的搭配感到满意,若有更具体需求,可根据反馈调整建议。", "如果客户对推荐感到满意,确认最终搭配并结束对话。" ], "examples": [ "您对这些搭配有何想法?是否需要根据您的需求进行调整?", "如果您觉得这套搭配合适,那就可以开始准备了!" ], "transitions": [{ "next_step": "4_finalize_outfit", "condition": "客户确认满意并最终决定服装搭配。" }] } ``` ```json { "id": "4_finalize_outfit", "description": "确认客户最终搭配并结束对话。", "instructions": [ "确认客户最终选择的搭配。", "祝福客户穿着得体,愉快出席场合。" ], "examples": [ "太好了,您的搭配已经选定!希望您能在场合中大放异彩。", "祝您今天的活动顺利,搭配的服装一定会让您更加自信!" ], "transitions": [] } ```
Full example: https://chatgpt.com/share/678dcc28-9570-800b-986a-51e6f80fd241
decode
The above prompt words are the saved dialog state between the AI clothing guide and the user, recording the pre-programmed service flow.
Define 4 service process nodes: guide the question, provide matching suggestions, adjust suggestions based on feedback, and end the dialog after user confirmation.
description defines "flow" and condition defines "circulation".
reflections
Built using only natural language workflow This approach provides new ideas. Especially when building Agent collaboration services, this approach may allow for a more rigorous collaboration process.
If the vast majority of services can be realized by retrieving and inserting the context related to the user's question for each conversation state, this may be a lightweight and efficient way to frame conversation service-based AI applications.