Joke

Request:

"request":{
        "name": "JOKE",
        "args": [1]
}

Returns:

$result0text: "joke1"
$result0: {joke:"joke1", ...}
$result: [{joke:"joke1", ...}, {joke:"joke2", ...}, ...]

Stocks

Example 1

Request:

"request":{
    "name":"stocks",
    "args":[“IBM”, “Apple”]
}

Returns:

$stocks.IBM = {
    "Name": "International Business Machines",
    "Symbol": "IBM",
    "LastTradePrice": "160.37",
    "Currency": "USD"
};
$stocks.Apple =  {
    "Name": "Apple Inc.",
    "Symbol": "AAPL",
    "LastTradePrice": "100.29",
    "Currency": "USD"
};

Example 2

Suppose the utterance “What is the stock price of IBM and Apple?” where IBM and Apple are entity @company then the following request is equivalent to example 1:

"request":{
    "name":"stocks",
    "args":”<? entitites.company ?>”
}

note that entities.company is not equivalent to [“IBM”, “Apple”, …] as it is. It returns the full entity records list that looks like this: [{“value”:”IBM”, …}, {…}, …]. It takes some processing on the service’s side to allow this simplified way of passing enities.

Presto menu

Request:

"request": {
        "name":"presto_menu"
}

Returns value:

$presto_menu = {
        'Main dishes': ['Turkey steak with honey', 'Chicken roulade stuffed with vegetables', 'Argentinian spicy sliced pork with peppers', 'Vegetable pancakes'],
        'Vegetables': ['Lentil ragout', 'Grilled peppers with mushrooms', 'Roasted carrots with honey', 'Brittany vegetables with butter'],
        'Sauces': ['Gravy', 'Yoghurt', 'Pepper'],
        'Side dishes': ['French fries', 'Crashed potatoes with bacon and fennel ', 'Jasmine rice with corn'],
        'Cold kitchen': [],
        'Soups': ['Vegetable soup', 'Garlic soup with croutons'],
        'Desserts of your choice': [],
        'Salads of your choice': ['Cheese with walnuts and cranberries', 'Parma ham with melon, pomegranate žluzým', 'Dried tomatoes and cheese on salad leaves', 'Grilled vegetables with feta cheese and sesame'],
        'Breakfast': [],
        'Drinks': [],
        'Daily offer': ['Fried cauliflower, mashed potatoes and tartar sauce', 'Roasted pork with garlic and onion, potato dumplings and sauteed cabbage', 'Chicken steak with pepper sauce, steamed  rice'],
        'Special offer of the day': []
}

Name days

Data structures

NamedayInfo {
        "names":[
                {
                        "name": "string",
                        "gender": "string" // "man" or "woman"
                },
                // ...
        ],
        "narrative": "string" // prefabricated answer like: "today celebrates his nameday Mark"
}

Example 1

(further for Friday 15.7.2016)

"request":{
        "name":"namedays",
        "args":{"day":"today"}
}

Returns:

$namedays.today = NamedayInfo
$namedays[7][15]= NamedayInfo // alternative indexing

Example 2

"request":{
        "name":"namedays",
        "args":{"month":7, "day":18}
}

Returns: $namedays[7][18] = NamedayInfo $namedays.monday = NamedayInfo

Example 3

"request":{
        "name":"namedays",
        "args":{"day":"wednesday"}
}

Returns:

$namedays.wednesday= ["name1", "name2", ...]
$namedays.[7][27]= ["name1", "name2", ...]

Example 4

"request":{
        "name":"namedays",
        "args":{"day":"wednesday", "anticipation":"past"}
}

anticipation determines whether to prefer a day from future or past, when it is ambiguous. Default value: "future"

Weather

Data structures

weatherData = {
        narrative: "string",    // prefabricated answer
        temperature: 27,        // degrees
        humidity: 40,           // %
        windSpeed: 15,          // m/s
        windDir: 147,           // heading
        rain: 1.2,              // mm of precipitattion
        snow: 3.1,               // mm of snow
        latitude: 51.234,        // latitude - localization of these data
        latitude: 18.243        // longitude - localization of these data
}

dayStamp - decimal, number of days from 1.1.1900. (new java.util.Date().getTime() / 86400000)

hourStamp - decimal, number of hours from 1.1.1900. (new java.util.Date().getTime() / 3600000)

Example 1 – current weather at a location

"request":{
        "name":"weather",
        "args":{"lat":50, "lon":18.49}
}

Returns:

$weather[50][18.49].current = weatherData

Example 2–10 days weather at a location

"request":{
        "name":"weather",
        "args":{"type": "daily", "lat":50, "lon":18.49}
}

Returns:

$weather.[50][18.49][dayStamp] = weatherData        // dayStamps for 10 days
$weather.[50][18.49].today = weatherData
$weather.[50][18.49].tomorrow = weatherData
$weather.[50][18.49].monday = weatherData
$weather.[50][18.49].tuesday = weatherData
...

Example 3 - fine forecast for 48 hours

"request":{
        "name":"weather",
        "args":{"type": "hourly", "lat":50, "lon":18.49}        // hour stamps for 48 hours
}

Returns:

$weather.[50][18.49][hourStamp] = weatherData

Example 4 – fine forecast for 48 hours

"request":{
        "name":"weather",
        "args":{"type": "daily", "location":location_name}        // location is general but weather is only for city
}

Returns:

$weather[location_name][dayStamp] = weatherData        // works similarly for hourly forecast
$weather[location_name].today = weatherData
$weather[location_name].tomorrow = weatherData
$weather[location_name].monday = weatherData
...

Call workspace

More at Workspace arbitration

Request:

"request":{
        "name": "call_workspace",
        "args": {
			"workspace": string,	// name of the called workspace
			"url": string,		// [optional] url credential of service to call workspace from or "primary" to call workspace from defaults
			"username": string,	// [optional] username credential of service to call workspace from
			"password": string	// [optional] password credential of service to call workspace from
		}
}

No return value.

Reminder

"request": {
        "name": "reminder",
        "args": {
                "name"?: string, // identifier of the reminder
                "type": "relative" | "regular" | "absolute" | "weekRelative" | "cancel",
                "output": {"text": string, ...},
                "input": {"text": string, ...},
                "intents": Array<string>,
                "entities": Array<any>,
                "start": number, // [milliseconds]
                "period": number
        }
}

Args

name

optional custom identifier of reminder. It should be useful for canceling single one reminder, which is not implemented yet.

type

output

Contents of args.output is processed the same way output field inbound from conversation service would. You can place any field described in output channels into args.output.

input, intents, entities

These are standard conversation service message fields. If any of them are present a call to the covnersation service will be performed.

start

Time in miliseconds until first occurance of the reminder. type field specifies, whether this number means time since issuing the reminder, or it it a timestamp.

period

Period of repetitions. If period is undefined, the reminder is triggered only once.

Cancel all remainders

"request": {
        "name": "reminder",
        "args": {
                "type": "cancel"
        }
}

Pragana

Loads docker container statistics from pragana json feed.

"request": {
	"name": "pragana"
}

Returns $pragana_status.

Go back

Rewinds the conversation by one turn.

"request": {
	"name": "go_back"
}