Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Dialogflow

fallback intent stuff

capability check

thank you apprreciation

Visuals

-

Prolog and Patterns

in patterns.pl

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Sequence Management Patterns (Moore Ch6) %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%% B1 Patterns: Repair (Agent)
% Pattern B1.2: Paraphrase Request (Agent)
% Example:
% U: chicken soup
% A: what do you mean?
% Instruction:
% 1. Introduce a 'paraphraseRequest' intent for the agent.
% 2. Add a b12 pattern using the defaultFallback and paraphraseRequest intent.
pattern([b12, [user, defaultFallback], [agent, paraphraseRequest]]).

% Pattern B1.3: Out of context dialog move
% For handling intents that are recognized but not expected nor first intent of a pattern.
% Example:
% A: what recipe would you like to cook?
% U: next step
% A: not sure what that means in this context.
% Instruction:
% 1. Add a b13 pattern using the Prolog don't care symbol (_) for the user intent and the given
% contextMismatch agent intent to respond to the user intent. Make sure to give this pattern
% the pattern id b13!!
% 2. Note that by using the don't care symbol any intent recognised will match with the first intent
% in this pattern. This requires careful handling of this pattern by the dialog engine! The
% dialog engine has already been prepared to handle this special case for you.
pattern([b13, [user, _], [agent, contextMismatch]]).

% Looks like user has repeated themselves.
pattern([b14, [user, _], [agent, repeatedUserIntent]]).

%%% B4: Sequence Closers
% Pattern B4.2: Sequence Closer Appreciation (helped)
% Example:
% U: thanks
% A: you're welcome.
pattern([b42, [user, appreciation], [agent, appreciationReceipt]]).

Code Block
%%% C3 Patterns: Capabilities
% Pattern C3.0: General Capability Check
% Example:
%	U: what can you do?
%	A: At the moment I can converse with you about nothing in particular. I do know how to make
%		a tasty pasta, risotto, <recipe2shorthand>, <recipe3shorthand>, however, if you are
%		interested.
% Instruction:
% 1. Introduce the intents 'checkCapability' (for the user) and 'describeCapability' (for the
%	agent). Introduce some Prolog code to concatenate the shorthand names for all the recipes
%	that you introduced (retrieve these using the recipes/1 predicate, see cooking.pl) and add
%	this code to the text.pl file to specify the correct capability description for your agent.
% 2. Add a pattern here where the user initiates the pattern by checking for the agent's capability
%	with the agent then responding to the request by describing its capabilities.
pattern([c30, [user, checkCapability], [agent, describeCapability]]).

responses.pl

text(contextMismatch, "I wasn't able to understand that.").

% Intent: paraphrase request
text(c11, paraphraseRequest, "Ok."). % we don't care exactly what user said. we got some response.
text(a50recipeSelect, paraphraseRequest, "I did not understand anything I could make sense of.") :-
recipesFiltered(Recipes), length(Recipes, L), L>0.
text(a50recipeSelect, paraphraseRequest, "I didn't get that.") :-
recipesFiltered(Recipes), length(Recipes, L), L=0.
text(a50recipeConfirm, paraphraseRequest, "I didn't understand that.").
text(c43, paraphraseRequest, "Ok.").
text(c10, paraphraseRequest, "Ok.").
text(instruction1, paraphraseRequest, "Ok").
text(instruction2, paraphraseRequest, "Ok").
text(instruction3, paraphraseRequest, "Ok").
text(ownInstruction, paraphraseRequest, "Ok").
text(start, paraphraseRequest, "Ok").
text(a50performanceRating, paraphraseRequest, "I didn't understand anything I could make sense of.").

% repeatedUserIntent
text(repeatedUserIntent, "Yes I got that.").

% Intent: appreciation receipt
text(appreciationReceipt, "You're welcome.").

% Intent: describeCapability
text(describeCapability, "I can help you find a recipe to your liking, as I can filter my recipe database based on your specific preferences.").

Extend

Test it Out

Say random stuff “the sky is blue” in all steps and see how your agent responds and if it freezes

before it froze if it did not understand and could not proceed now you should be able to say something random it says it does not understand and you could then continue the pattern

Return to https://socialrobotics.atlassian.net/wiki/spaces/PM2/pages/2216001572/Building+Your+Agent#Agent-Capability-10%3A-Allow-for-Filter-Removal