I am confused with the pattern_correction.
Here is what the document says:
is_reset_only
: indicates if the correction is only a reset of the flow
corrected_slots
: slot key-value pairs that should be corrected
reset_flow_id
: the ID of the flow to reset to, defaults to None
reset_step_id
: the ID of the step to reset to, defaults to None
How could the system know that the correction is only a reset of the flow and set the value of ‘is_reset_only’? And I want to confirm that reset_flow_id
means the parent flow the correction pattern is in ?
And Could you please give a concrete implementation of this situation?
User:I want to send some money to Joe
Bot:How much money do you want to send?
User:50$
Bot:Do you want to send 50$ to Joe? (Yes/No)
User:Oh wait!! I meant to say to John, not Joe!
Bot:Updated recipient to John
Bot:Do you want to send 50$ to John? (Yes/No)
User:…
How does my user-defined flow (like transfer_money) interact with the predefined flow pattern_correction. If the user only answer ‘No’ instead of giving the revise detail, how could my business logic lead him to correction logic?
Thanks for patience!
My flow is here. And I don’t know how to implement the ‘…’ part
flows:
investment_plan_recommendation:
description: This flow recommend a investment plan to user according to user's portrait and needs.
steps:
- collect: risk_tolerance_level
description: "the level represents investors' acceptance and tolerance of investment risks, usually divided into five levels: conservative,cautious,prudent,proactive,aggressive"
- collect: annual_income
description: "the user's annual_income.If it's not on an annual basis, you should convert it."
- collect: annual_outcome
description: "the user's annual_outcome.If it's not on an annual basis, you should convert it."
- id: confirm_info
collect: confirm_slot_investment_plan_recommendation
description: "the user confirm that the required information of investment plan recommendation is correct."
next:
- if: not slots.confirm_slot_investment_plan_recommendation
#If the user needs to make modifications, there are two situations: 1. If the user also provides the modified content, the built-in patternic_correction will modify the slot value accordingly 2. The user did not provide any modified content
then:
....
- else:
- action: action_customize_plan
- action: utter_recommend_investment_plan