Trying out the sample app

1. Clone the GitHub repo

The first step is to clone the below GitHub repo (if not already done as part of the previous demo app)

https://github.com/slanglabs-projects/conva-ai-demo-apps

This will contain the following demo apps.

  • MyChatGPT App - A simple demo app to build your custom ChatGPT-style application with the ability to answer specific questions about a particular subject that a Copilot has been trained for. This shows how to use the Dynamic mode of CONVA.ai to build a powerful Assistant inside your app to answer any of your user's questions.

  • Capability Utilizer - A simple demo app to demonstrate how to use the Static mode of CONVA.ai to trigger specific useful Capabilities inside apps.

$ git clone https://github.com/slanglabs-projects/conva-ai-demo-apps.git

For this section, we will be referring to the Capability Utilizer app for all languages.

2. Pick your language choice

The demo is currently available in two languages

  • Flutter (Android)

  • Python

You can pick either one of them that you are comfortable with.

3. Update the API keys in the code

Get the Copilot ID & the API key for your Copilot from Magic Studio.

You can find this in the "Properties" section of the "Demo App for Magic Studio"

Copy the ID and API key in the code which initializes the Copilot

/// File - Flutter/MyChatGpt/lib/utils/utils.dart

/// The Copilot ID of your Copilot.
static String assistantId = "<CopilotID>";

/// The API key for accessing the CONVA.ai system.
static String apiKey = "<API Key>";

/// The version of the your Copilot.
static String assistantVersion = "<Version Number>";

4. Setup dependencies

Before you can run the application, make sure that you have your environment setup correctly.

Note that for Python, you need to do an extra step of installing the conva-ai package $ pip install conva-ai

5. Run the application

Now you should be able to run your application.

// Was a bit too late in the night to add a screenshot 

Thats it!

Lets now explore the key parts of the code which made this happen

How did it work?

There are only two APIs to use to make this above system work

  • Initialize CONVA.ai with your Copilot credentials

// TBD
  • Invoke the Capability and get the response in JSON

Thats all. Use the response object to access the various parameters that is returned by CONVA.ai and use it in your app as you see fit.

The most important parameters are -

  • message - The response message for the Capability. Every Capability will have this parameter.

  • related_queries - The list of AI generated queries that are most appropriate follow up questions to ask the AI.

  • parameters - This is a HashMap which contains the custom parameters that the developer configured when the Capability was configured.

Thats all.

Last updated