version: "3.0" rules: - rule: activate weather form steps: - intent: weather - action:…
- User
version: "3.0" rules:
- rule: activate weather form
steps:
- intent: weather
- action: weather_form
- active_loop: weather_form
- rule: Submit form
condition:
Condition that form is active.
- active_loop: weather_form steps:
- action: weather_form
- active_loop: null
- slot_was_set:
- requested_slot: null
The action we want to run when the form is submitted.
- action: action_weather_form_submit 上面的我没看懂,为什么要写成两个rule?为什么 condition:
Condition that form is active.
- active_loop: weather_form steps:
- action: weather_form 上面的condition已经表明在active_loop中了,为什么steps后面上来还是weather_form?
- rule: activate weather form
steps:
- Assistant
这个配置是用于定义对话管理规则的,它看起来像是用于Rasa框架的一个例子。Rasa是一个开源的机器学习框架,用于构建对话系统。在Rasa中,
rules被用来定义对话的行为。请允许我逐步解释这个配置。第一个
rule: "activate weather form" 是用来定义当用户表达出询问天气的意图(通过intent: weather)时,应该激活一个表单(通过action: weather_form)并进入一个活动循环(通过active_loop: weather_form),以便收集用户提供的相关信息(例如位置、日期等),这是表单的激活和数据收集阶段。第二个
rule: "Submit form" 是用来定义当表单被填写完毕并提交时的行为。这里的condition用来检查是否当前的活动循环是weather_form。如果是,就执行以下步骤:-
action: weather_form—— 这里再次调用weather_form可能看起来有些混淆。在Rasa中,当表单激活时,每一轮对话都会自动调用对应的表单动作,直到表单被填完。所以这里的action: weather_form实际上是指在这轮对话中继续执行表单动作,这通常意味着处理最后一个或当前正在处理的槽位(slot)。 -
active_loop: null—— 设置活动循环为空,表明表单处理结束。 -
slot_was_set:—— 表明表单中的槽位被设置为null,这通常是在表单完成后进行清理。 -
action: action_weather_form_submit—— 最后,执行一个自定义动作action_weather_form_submit,这个动作可能会根据收集到的信息查询天气,并将结果返回给用户。
总之,第一个规则是为了激活表单并开始收集信息,而第二个规则是为了在表单提交后执行一些操作。在这个过程中,表单动作(
weather_form)会在每一轮对话中被调用,直到收集完所有必要信息,而不是仅在表单激活时调用一次。 -
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.