Code Monkey home page Code Monkey logo

Api.ai - multiple webhook simulation implementation in Python

This python code takes the input json from the api.ai agent and processes the query based on the action specified in the json file, It uses wikipedia api for basic information retrieval and wolfram alpha api for general facts and questions

#pre-requisites

  1. API.AI account and a functional agent
  2. wolfram alpha account to get the app id [watch online tutorials on how to get wolfram alpha app id]
  3. Heroku account to host the app.py file

NOTE Substitute the app_id variable in the app.py file with your app_id from wolframalpha page and intents for api calls should contain the action "wiki" for wikipedia search and "wolf" for wolfram alpha search and YahooWeatherForecast for weather report.

More info about Api.ai webhooks could be found here: Api.ai Webhook

Deploy to:

Deploy to Heroku

What does the service do?

It's a weather information fulfillment service that uses Yahoo! Weather API and basic web search using mediawiki api or wolfram alpha api. The services takes the geo-city parameter from the action, performs geolocation for the city and requests weather information from Yahoo! Weather public API and takes par1 parameter for the wikipedia search. Change the parameter you pass from the intents in api.ai and keep the same parameters name while you retrieve the parameters ex: param = req.get("result").get("parameters").get("Your_parameter_name")

The service packs the result in the Api.ai webhook-compatible response JSON and returns it to Api.ai.

Mohammed Thaha jk's Projects

intelli-chat icon intelli-chat

Chat bot that can do RAG (retrieval augemented generation) and can also use tools for executing specific tasks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.