import wikipedia
from templates.button import *

def process(input, entities):
    output = {}
    try:
        query = entities['wikipedia_search_query'][0]['value']
        data = wikipedia.page(query)
        output['input'] = input
        template = TextTemplate('Wikipedia summary of ' + data.title + ':\n' + data.summary)
        text = template.get_text()
        template = ButtonTemplate(text)
        template.add_web_url('Wikipedia Link', data.url)
        output['output'] = template.get_message()
        output['success'] = True
    except:
        output['success'] = False
    return output

@@ -131,26 +131,8 @@
 wiki
-pedia_search_query
 '%5D%5B0

Use user-defined entity