Pages

Tuesday, December 12, 2017

How To Connect A Bot To Wolfram Alpha

Through Bot Libre, you can now connect your bot with Wolfram Alpha. This "How To" guide will give you a step by step process to connect your bot with Wolfram Alpha.

Step 1 - Create a Bot

First you must create a bot that you want to connect to Wolfram Alpha, or you can use one of your existing bots. To create a bot, follow the instructions here: How to create your own chat bot in 10 clicks.

Step 2 - Sign up for Wolfram Alpha

Go to the Wolfram Alpha Developer site and click the 'Get API Access' button.

Next, click the 'Create account' button, or sign in if you already have a Wolfram Alpha account.

Step 3 - Get Wolfram Alpha AppId

Once you have signed in, you will be taken to the Wolfram Alpha Developer Portal. Click the 'My Apps' tab to start getting your AppId.

Click the 'Sign up to get your first AppID' button to continue.

A form will pop up with some information that needs to be filled out. Once you have finished filling out the required information, click the 'Sign up' button.

On the next screen, click the 'Get an AppID' button.

You will now need to fill out some more information on the following form. Click the 'Get AppID' button when finished.

You will now be shown a screen with your new Wolfram Alpha AppId. Copy this down, as it will need to be entered into your bot's admin page on the Bot Libre site.

Step 4 - Enter Wolfram Alpha AppID Into Bot's Admin Page

Return to the Bot Libre website and navigate to your bot. Click the gear icon to go to your bot's admin page.

Click on 'Wolfram Alpha' to go the Wolfram Alpha settings page.

Enter your AppID from the Wolfram Alpha Developer Portal into the 'Wolfram Alpha App Id' field. Press the 'Save' button to complete setup.

Your bot is now connected to Wolfram Alpha.

Step 5 - Self Scripting

You can query Wolfram Alpha through Self scripting by calling the WolframAlpha.query() function. It takes a single string parameter and returns the result of the query.

Here is an example of a simple Self script that will answer simple questions using Wolfram Alpha:

state WolframAlpha {
    pattern "what is *" answer forward();
    pattern "where is *" answer forward();
    pattern "who is *" answer forward();

    function forward() {
        return WolframAlpha.query(sentence.toString());
    }
}

 

No comments:

Post a Comment