INNER CODE UNIT · Python
answer
shibing624/dialogbot · dialogbot/bot.py:57
def answer(self, query, use_search=True, use_gen=True, use_task=False):
"""
Dialog strategy: use sub-task to handle dialog firstly,
if failed, use retrieval or generational func to handle it.
:param query: str, input query
:param use_search: bool, weather or not use search bot, include local search and internet search
:param use_gen: bool, weather or not use seq2seq bot
:param use_task: bool, weather or not use task bot
:return: (response, details) str, []
"""
self.context.append({'user:': query})
response = {}
if use_task:
task_response = ''
response['task_response'] = task_response
# Search response