-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extra rule while file upload (#1597)
* added code related to handling the extra creation of nlu fallback data while uploading the files. * added code related to handling the extra creation of nlu fallback data while uploading the files. * Added test cases.
- Loading branch information
1 parent
8632333
commit 38d1819
Showing
11 changed files
with
346 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
http_action: | ||
- action_name: action_say_hello | ||
content_type: json | ||
headers: [] | ||
http_url: https://jsonplaceholder.typicode.com/posts/1 | ||
params_list: [] | ||
request_method: GET | ||
response: | ||
dispatch: true | ||
dispatch_type: text | ||
evaluation_type: expression | ||
value: ${data} | ||
set_slots: [] | ||
- action_name: action_say_goodbye | ||
content_type: json | ||
headers: [] | ||
http_url: https://jsonplaceholder.typicode.com/posts/1 | ||
params_list: [] | ||
request_method: GET | ||
response: | ||
dispatch: true | ||
dispatch_type: text | ||
evaluation_type: expression | ||
value: ${data} | ||
set_slots: [] |
44 changes: 44 additions & 0 deletions
44
tests/testing_data/validator/valid_data/chat_client_config.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
config: | ||
api_server_host_url: http://testserver | ||
botClassName: '' | ||
buttonType: button | ||
chatContainerClassName: '' | ||
chat_server_base_url: null | ||
container: '#root' | ||
containerClassName: '' | ||
formClassName: '' | ||
headerClassName: '' | ||
name: kairon_testing | ||
openButtonClassName: '' | ||
styles: | ||
botStyle: | ||
backgroundColor: '#e0e0e0' | ||
color: '#000000' | ||
fontFamily: '''Roboto'', sans-serif' | ||
fontSize: 14px | ||
iconSrc: '' | ||
showIcon: 'false' | ||
buttonStyle: | ||
backgroundColor: '#2b3595' | ||
color: '#ffffff' | ||
containerStyles: | ||
background: '#ffffff' | ||
height: 500px | ||
width: 350px | ||
headerStyle: | ||
backgroundColor: '#2b3595' | ||
color: '#ffffff' | ||
height: 60px | ||
userStyle: | ||
backgroundColor: '#2b3595' | ||
color: '#ffffff' | ||
fontFamily: '''Roboto'', sans-serif' | ||
fontSize: 14px | ||
iconSrc: '' | ||
showIcon: 'false' | ||
userClassName: '' | ||
userStorage: ls | ||
userType: custom | ||
welcomeMessage: Hello! How are you? This is Testing Welcome Message. | ||
whitelist: | ||
- '*' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
recipe: default.v1 | ||
language: en | ||
pipeline: | ||
- name: WhitespaceTokenizer | ||
- name: RegexFeaturizer | ||
- name: LexicalSyntacticFeaturizer | ||
- name: CountVectorsFeaturizer | ||
- analyzer: char_wb | ||
max_ngram: 4 | ||
min_ngram: 1 | ||
name: CountVectorsFeaturizer | ||
- name: FallbackClassifier | ||
threshold: 0.75 | ||
- epochs: 5 | ||
name: DIETClassifier | ||
- name: EntitySynonymMapper | ||
- epochs: 5 | ||
name: ResponseSelector | ||
policies: | ||
- name: MemoizationPolicy | ||
- epochs: 5 | ||
max_history: 5 | ||
name: TEDPolicy | ||
- name: RulePolicy | ||
core_fallback_threshold: 0.3 | ||
core_fallback_action_name: action_small_talk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
version: "3.1" | ||
nlu: | ||
- intent: greet | ||
examples: | | ||
- hey | ||
- hello | ||
- hi | ||
- intent: deny | ||
examples: | | ||
- no | ||
- never | ||
- I don't think so | ||
- don't like that |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
rules: | ||
- rule: ask the user to rephrase whenever they send a message with low nlu confidence | ||
steps: | ||
- intent: nlu_fallback | ||
- action: utter_please_rephrase | ||
|
||
- rule: Only say `hello` if the user provided a location | ||
condition: | ||
- slot_was_set: | ||
- location: true | ||
steps: | ||
- intent: greet | ||
- action: utter_greet | ||
|
||
- rule: Say `hello` when the user starts a conversation with intent `greet` | ||
conversation_start: true | ||
steps: | ||
- intent: greet | ||
- action: utter_greet | ||
|
||
- rule: Rule which will not wait for user message once it was applied | ||
steps: | ||
- intent: greet | ||
- action: utter_greet | ||
wait_for_user_input: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
version: "3.1" | ||
stories: | ||
- story: greet | ||
steps: | ||
- intent: greet | ||
- action: utter_greet | ||
- action: action_say_hello | ||
- action: action_restart | ||
- story: say goodbye | ||
steps: | ||
- intent: deny | ||
- action: utter_goodbye | ||
- action: action_say_goodbye | ||
- action: action_restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
version: "3.1" | ||
config: | ||
store_entities_as_slots: true | ||
session_config: | ||
session_expiration_time: 60 | ||
carry_over_slots_to_new_session: true | ||
intents: | ||
- greet: | ||
use_entities: true | ||
- deny: | ||
use_entities: true | ||
responses: | ||
utter_goodbye: | ||
- text: Bye | ||
utter_greet: | ||
- text: Hey! How are you? | ||
utter_default: | ||
- text: Can you rephrase! | ||
utter_please_rephrase: | ||
- text: I'm sorry, I didn't quite understand that. Could you rephrase? | ||
|
||
actions: | ||
- action_say_hello | ||
- action_say_goodbye | ||
- utter_greet | ||
- utter_goodbye |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.