向您的提示模板添加流
在 Coral Cloud 度假村中,客人入住期间通常不止举办一个活动。接下来,您创建一个流,包括客人入住期间可以参与的所有体验。为此,您需要创建一个模板触发的提示流。
创建一个模板触发的提示流
- 单击 App Launcher(应用程序启动器)(
)。
- 在搜索应用程序和项目框中,输入
auto
(自动),然后选择 Automation(自动化)。
- 在 Flows(流)面板中,单击 New(新建)。
- 在搜索自动化框中,输入
prompt
(提示),然后选择 Template-Triggered Prompt Flow(模板触发的提示流)。
- 输入类型保留 Manual Inputs(手动输入)。
- 单击
切换工具箱。
- 单击 New Resource(新资源)后输入下列详细信息:
- Resource Type(资源类型):Variable(变量)
- API Name(API 名称):
Reservation
(预约) - Data Type(数据类型):Record(记录)
- Object(对象):External Reservation(外部预约)
- Available for input(可供输入):选中
- Resource Type(资源类型):Variable(变量)
- 单击 Done(完成)。
- 再次单击 New Resource(新资源),然后输入下列详细信息:
- Resource Type(资源类型):Variable(变量)
- API Name(API 名称):
Experience
(体验) - Data Type(数据类型):Record(记录)
- Object(对象):Experience(体验)
- Available for input(可供输入):选中
- Resource Type(资源类型):Variable(变量)
- 单击 Done(完成)。
- 单击 Save(保存)保存流。
- 显示 Save the flow(保存流)窗口。您可以在这里分配流详细信息:
- Flow Label(流标签):
Get Experience Newsletter Data
(获取体验简报数据) - Flow API Name(流 API 名称):
Get_Experience_Newsletter_Data
- Description(描述):
Filter all guest experience data to return to guests.
(筛选所有来宾体验数据以返回给来宾)。
- Flow Label(流标签):
- 单击 Save(保存)。
向提示流添加元素
- 单击 Start(开始)和 End(结束)之间的 Add element(添加元素)
。
- 在 Add Element(添加元素)框中,键入
Get
(获取)并选择 Get Records(获取记录),以检索体验并储存在一个集合中。
- 在 Label(标签)处,输入
Guest Experience
(来宾体验),并将 API 名称设为Guest_Experience
。
- 在 Description(描述)处,输入
Get all experience data
(获取所有体验数据)。
- 为 Object(对象)选择 Experience(体验)。简报只需要包括客人在住宿期间可以参加的活动。
- 在 Condition Requirements(条件要求)中,选择 None - Get All Experience Records(无 - 获取所有体验记录)。
- 在 Sort Order(排列顺序)处,请保持 Not Sorted(未排序)。
- 为 How Many Records to Store(存储的记录数量)选择 All records(所有记录)。
- 单击 Save(保存)。
当前所有体验都储存在一个集合中。要单独查看每个项目,我们来加一个循环。
- 返回到流中,单击 Get Records(获取记录)元素后面的 Add element(添加元素)
。
- 通过键入
Loop
(循环)并选择循环添加一个循环元素。
- 在 Label(标签)处,输入
Loop Experiences
(循环体验),并将 API 名称设为Guest_Experience
。
- 在 Description(描述)处,输入
Loop through the collection of guest experiences.
(循环遍历来宾体验集合)。
- 在 Collection Variable(集合变量)处,选择 Experiences from Guest Experience(来宾体验中的体验)。
- 单击 Save(保存)。
模板触发的流提供了一项独特的功能:创建提示说明。这些说明可以收集数据和文本并将它们从 Flow Builder 传递到提示生成器。在下一步中,您将使用提示说明来格式化要发送给提示生成器的所有体验细节,并激活要在提示生成器中使用的流。
- 在 Loop(循环)元素的 For Each(针对每个)路径中,单击 Add element(添加元素)
。
- 键入
add
(添加)并选择 Add Prompt Instructions(添加提示说明)元素以添加到流。
- 在 Label(标签)处,输入
Send Experience Details to the Prompt Template
(将体验详细信息发送到提示模板),在 API Name(API 名称)字段输入Send_Experience_Details_to_the_Prompt_Template
。
- 在 Description(描述)处,输入
Add all qualifying experience details to the prompt instructions.
(将所有符合条件的体验详细信息添加到提示说明)。
- 在 Prompt Instructions(提示说明)处,粘贴以下文本(标有“插入资源……”的搜索框的下方)。
(Experience Name: {!Loop_Experiences.Name}, Experience Location:{!Loop_Experiences.Location__c} , Experience Details: {!Loop_Experiences.Description__c})
- 单击 Save(保存),然后单击 Activate(激活)。
向您的提示模板添加流
现在,您的流已在 Flow Builder 中激活,现在可以用于提示生成器中。
- 退出 Flow Builder 并返回 Setup(设置)。
- 在 Quick Find(快速查找)框中,输入
prompt
(提示),然后单击 Prompt Builder(提示生成器)。
- 选择 New Guest Newsletter(新来宾简报)提示模板。
- 我们用流替换现有体验合并字段。首先,选择并删除下列文本:
体验名称:Input:Experience.Name
体验位置:Input:Experience.Location__c
体验详细信息:Input:Experience.Description__c
- 然后通过单击 Resource(资源)字段选择 Flows(流) > Get Experience Newsletter Data(获取体验简报数据)来替换文本。
- 单击 Save As(另存为),然后单击 Save as a New Version(另存为新版本)。
您的提示模板应为:
You're the Director of Fun at Coral Cloud Resorts writing a newsletter to welcome Input:Reservation.External_Guest__r.First_Name__c and inform them of upcoming activities during their stay.(您是 Coral Cloud 度假村的娱乐活动总监,正在撰写一封欢迎简报:Input:Reservation.External_Guest__r.First_Name__c,并告知他们在入住期间即将开展的活动。)The purpose of the newsletter is to get guests excited about staying at the resort.(这份简报的目的是为了让来宾对入住度假村充满期待。)When I ask you to create the newsletter, you must strictly follow my instructions below.(当我要求你制作这份简报时,你必须严格遵循我的以下指令。)
Instructions:(指令:)
Introduce the resort in a newsletter no longer than three paragraphs.(在不超过三段文字的简报中介绍度假村。)
Inform the guests about their reservation using the following details:(使用以下详细信息告知来宾他们的预订情况:)
Check In: Input:Reservation.Check_in_Date__c(入住:Input:Reservation.Check_in_Date__c)
Check Out: Input:Reservation.Check_out_Date__c(退房:Input:Reservation.Check_out_Date__c)
Room Selection: Input:Reservation.Room_Type__c(房型选择:Input:Reservation.Room_Type__c)
Include a bulleted list of the experiences available during guests 可以让stay, including the description and the locations.(列出来宾入住期间所能享有的各项体验,包括描述和具体地点。)The experiences are as follows:(这些体验如下:)
Flow:Get_Experience_Newsletter_Data
Use clear and straightforward language using the active voice and strictly avoiding the use of filler words and phrases and redundant language.(使用清晰、简洁的语言,采用主动语态,并严格避免使用填充词和短语以及冗语。)Be conversational.(应口语化。)
Do not attribute any negative traits in the summary.(在总结中不要提及任何负面特质。)
End with a call to action for readers to look at our website for these offers.(最后鼓励读信人采取行动,访问我们的网站以获取这些优惠信息。)
Now create the newsletter.(现在创建该简报。)
在 Prompt Builder 中,应如下所示:
测试提示
- 在 Reservation(预约)字段中,键入
er
。选择任意预约。
- 在 Experience(体验)字段中,键入
Family
(家庭)。选择 Family Karaoke Night(家庭卡拉 OK 之夜)。
- 单击 Preview(预览)。
- 查看您的提示模板的输出。现在,活动内容包括瑜伽体验以及卡拉 OK 之夜。
- 单击 Activate(激活)。
做得好!您很快就学会了如何根据自己的需要制作提示模板。通过合并流,您已经使您的模板对每个人都更加友好。继续探索提示生成器,发现更有创意的方法来自动生成文本吧。