Hi, I am trying create to bot which takes in a search query from user and then this search query is send to backend service to retrieve the search results, lastly these search results are presented to the user. Essentially the user can type in anything as a search query, this needs to be detected as an intent and then this utterance is used to query backend. No fix set of utterances can be added to train the model as user can type in anything as a search query.
pls post your file
@gerrycheung here are the contents of relevant files stories.yml
stories:
- story: FAQ Search + Don't need more help with FAQ
steps:
- intent: greet
- action: action_greet_message
- intent: enter_intent
- action: action_get_faq
actions.py
class ActionGreetMessage(Action):
def name(self) -> Text:
return "action_greet_message"
def run(self, dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
dispatcher.utter_message(text="Hi! I'm your Assistant. Just ask me a question and I'll try to find an answer.")
class ActionGetFaq(Action):
def name(self) -> Text:
return "action_get_faq"
def run(self, dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
user_input=tracker.latest_message['text']
# call to search service passing in 'user_input', display results provided by search service back to user
return[]
nlu.yml
nlu:
- intent: greet
examples: |
- hey
- hello
- hi
- hello there
- good morning
- intent: enter_intent
examples: |
- can you name some restaurants?
- name some hotels
- what is the best time to visit Argentina?
- what is the weather in Seattle?
- list some cheap restaurants
- is food good in Mexico?
- what is sunset time?
@dshelke thank you