Bot Creation Guide

Step-by-Step Implementation

The following steps outline the creation of a functional weather bot:

To Establish Generative AI-Connection kindly follow this

Connection Setup to Weather API using REST

  1. Navigate to Integration Go to Integration > Connect System.

  1. Add a New REST Connection Click Add New Connection and select REST.

  1. Enter Connection Details

  • Connection Name: WeatherAPI_REST

  • Base URL: https://api.weatherapi.com/v1/ (or the appropriate base URL as per the Weather API documentation).

  • Authorization Type: No Auth

  • Save Connection Click Save Settings to finalize the REST connection.

Content Category Creation

  1. Navigate to Content Go to Content > Content Categories.

  1. Add New Category Click Add New Category

  1. Enter Category Name Use a unique category name (e.g., Weather Category v1).

    1. Provide Description Enter a concise description (e.g., "Category for Weather Bot").

    2. Click Add Finalize by clicking the Add button.

  1. Navigate to Apps Go to Apps > Custom Apps.

  2. Create New Custom App Click New Custom App.

  1. Enter App Details

    1. Name: Weather Bot v1

    2. Custom App Type: Search

    3. Category: Select the Weather Category v1 created previously.

    4. Check the Box: This is a Generative AI App.

    5. Click Save Save the configuration.

Data Source Configuration

  1. Navigate to Data Sources Within your newly created Custom App, go to the Data Sources tab.

    1. Create New Data Source Click Create New Data Source.

  1. Enter Data Source Details

    1. Name: WeatherDataSource

    2. Integration Configuration: Select your Generative AI connection (created in Step 1) or the REST connection (created in Step 2).

    3. Click Save.

Method Definition

  1. Navigate to Methods Within your newly created Custom App, go to the Methods tab.

  2. Create New Method Click Create New Method.

  1. Weather API Method Steps

1. Get Forecast Method

  • Name: Get Forecast Method

  • Request Type: GET

  • Request Headers: Null / Default values

  • Method Path: /forecast.json

  • Query Parameters: ?q={{Location}}&days={{number of days}}&key= Add the API key generated

    • q = location

    • days = number of days to forecast

    • key = your API key

  • Result Type: List of records

  • Record JsonPath: $.forecast

  • Record Template: forecastday: {{forecastday}}

  • Record Limit: 100

  • Valid Result Template: Contains weather records for the specified range

  • Empty Result Template: "No data."

  • Save

  • Test Example:

    • Days: 17

    • Location: Austin, Texas

2. Get Current Weather Method

  • Name: Get Current Weather Method

  • Request Type: GET

  • Request Headers: Null / Default values

  • Method Path: /current.json

  • Query Parameters: ?q={{CurrentLocation}}&key=Add the API key generated

    • q = location

    • key = your API key

  • Result Type: ListofRecords

  • Record JSON Path: $

  • Record Template: current: {{current}}

  • Record Limit: 100

  • Valid Result Template: Current weather data for the specified location

  • Empty Result Template: "Sorry, we couldn't get the information."

  • Test Example:

    • Location: (provide specific location)

3. For Get Specific Day Weather Method

  • Name: Get Specific Day Weather Method

  • Request Type: GET

  • Request Headers: Null / Default values

  • Method Path: /future.json

  • Query Parameters: ?q={{SpecificDateLocation}}&dt={{SpecificDate}}&key=Add the API key generated

    • q = location

    • dt = specific date

    • key = your API key

  • Result Type: ListofRecords

  • Record JSON Path: $.forecast

  • Record Template: current: forecastday: {{forecastday}}

  • Record Limit: 100

  • Valid Result Template: {{Records}} How else can I help you?

  • Empty Result Template:"Sorry, we couldn't get the information." How else can I help you?

  • Test Example:

    • Location: (provide specific location)

    • Date: (provide specific date)

Note: We need to subscribe to see the future weather report. As we have lost the free trial period, we are not able to show the end results.

  1. For Generative AI Method Steps

  • Name: Chat Completion RAG

  • Request Type: chatcompletion-rag

  • Parameters

    • Model: Select your preferred Generative AI model (e.g., OpenAI gpt-4).

    • System Message: Provide instructions for the bot’s behavior:

    • This is a sample prompt/system message, this can be configured as per the use case need.

"{\"systemMessage\":\"{   \\\"bot_persona\\\": {     \\\"name\\\": \\\"Sunny\\\",     \\\"role\\\": \\\"You are Sunny, the weather assistant with a warm, cheerful, and playful personality. Think of yourself as a ray of sunshine: helpful, upbeat, and always ready to brighten someone's day with the weather forecast.\\\",     \\\"goal\\\": [       \\\"Provide users with weather updates and forecasts for:\\\",       \\\"Today\\\",       \\\"A set number of future days\\\",       \\\"A specific future date\\\",       \\\"Always give relevant recommendations based on the current or forecasted weather (e.g., what to wear, whether to bring an umbrella, if it's a good day for the beach).\\\",       \\\"After sharing the weather, you may also ask if the user would like activity suggestions based on the weather and their location.\\\",       \\\"If they agree, suggest nearby activities that are suitable for the conditions.\\\"     ],     \\\"answer_restriction\\\": [       \\\"Do not mention tool or intent names (like GetCurrentWeatherIntent, GetForecastIntent, GetWeatherforSpecificDateIntent) in responses.\\\"     ],     \\\"workflow\\\": {       \\\"scenario_1_current_weather\\\": {         \\\"trigger\\\": \\\"User asks about the current weather\\\",         \\\"actions\\\": [           \\\"Ask for the user's location.\\\",           \\\"Accept formats: US Zip Code, UK Postcode, Canada Postal Code, IP address, Latitude/Longitude (decimal degrees), City name.\\\",           \\\"Get data from GetCurrentWeatherIntent tool (Do not mention tool name) and provide the information to user in a format: Use <ul><li> for listing, <br> for line breaks.\\\"         ]       },       \\\"scenario_2_forecast_future_days\\\": {         \\\"trigger\\\": \\\"User asks for a weather forecast for a future date\\\",         \\\"actions\\\": [           \\\"Ask for the user's location (same formats).\\\",           \\\"Ask how many days from today the forecast should cover.\\\",           \\\"Get data from GetForecastIntent tool (Do not mention tool name) and provide the information to user in a format: Use <ul><li> for listing, <br> for line breaks.\\\"         ]       },       \\\"scenario_3_specific_future_date\\\": {         \\\"trigger\\\": \\\"User asks for weather on a specific date (between 14 and 365 days from today)\\\",         \\\"actions\\\": [           \\\"Ask for the user's location.\\\",           \\\"Ask for the specific date in yyyy-MM-dd format.\\\",           \\\"Get data from GetWeatherforSpecificDateIntent tool (Do not mention tool name) and provide the information to user in a format: Use <ul><li> for listing, <br> for line breaks.\\\"         ]       },       \\\"after_weather\\\": {         \\\"prompt\\\": \\\"Ask the user if they’d like activity suggestions based on the weather and location.\\\",         \\\"if_yes\\\": \\\"Suggest nearby activities appropriate for the weather using <ul><li>.\\\"       }     },     \\\"strict_rules\\\": {       \\\"html_formatting\\\": {         \\\"line_break\\\": \\\"<br>\\\",         \\\"bold\\\": \\\"<b>...</b>\\\",         \\\"lists\\\": \\\"<ul><li>...</li></ul>\\\"       },       \\\"hyperlink_display\\\": \\\"Display as plain text only (no tags or formatting).\\\",       \\\"prohibited_elements\\\": \\\"Do not use icons or images under any circumstances.\\\"     }   } }\", \"userQuestion\":\"{{UserInput}}\", \"sessionTime\":\"10\", \"OrganizationID\":\"{{Context.OrganizationID}}\", \"EmployeeID\":\"{{Context.EmployeeID}}\" , \"model\":\"OpenAI gpt-4\", \"streaming\":\"False\"}"

  • UserQuestion: {{UserInput}}

  • Streaming: False

  • SessionTime: 10

  • OrganizationID: {{Context.OrganizationID}}

  • EmployeeID: {{Context.OrganizationID}}

  • Configure Method Output:

    • Result Type: ListofRecords

    • Record Limit: 10

  • Configure Method Result:

    • Record JsonPath: $.choices[0].message

    • Valid Result Template: {{Records}}

    • Record Template: {{content}}

    • Empty Result Template: "Is there anything else I can assist you with?"

  • Uncheck: Automatically prompt for next question

  • Save & Test

    • Click Save & Test. This will initiate a test API call.

Intent Creation

  1. Navigate to Intents

    1. In your Custom App, go to the Intents tab.

  1. Create New Intent

    1. Click Create New Intent.

    2. Enter Intent Details as Follows:

      • Name: ChatIntent

      • Intent Type: Search

      • Intent Action: Execute Method

      • Primary Method: Azure Chat RAG Method

      • Data Source: Generative AI

      • Dialogue Delegation Strategy: Set to fall back to the default skill if the intent cannot be fulfilled

      • Fallback Intent: Set this intent as a fallback by checking the box

      • Action: Save the intent configuration

  1. Get Forecast Intent

  • Name: GetForecastIntent

  • Intent Type: Search

  • Intent Action: Execute Method

  • Primary Method: Get Forecast Method

  • Data Source: Weather API

  • Dialogue Delegation Strategy: None (do not check any boxes)

  • Action: Save the intent configuration

  1. Get Current Weather Intent

  • Name: GetCurrentWeatherIntent

  • Intent Type: Search

  • Intent Action: Execute Method

  • Primary Method: Get Current Weather Method

  • Data Source: Weather API

  • Dialogue Delegation Strategy: None (do not check any boxes).

  • Action: Save the intent configuration.

  1. Get Weather for Specific Date Intent

  • Name: GetWeatherforSpecificDateIntent

  • Intent Type: Search

  • Intent Action: Execute Method

  • Primary Method: Get Weather for Specific Date Method

  • Data Source: Weather API

  • Dialogue Delegation Strategy: None (do not check any boxes).

  • Action: Save the intent configuration.

  1. Get Weather for Specific Day Intent

  • Name: GetWeatherforSpecificDayIntent

  • Intent Type: Search

  • Intent Action: Execute Method

  • Primary Method: Get Specific Day Weather Method

  • Data Source: Weather API

  • Dialogue Delegation Strategy: None (do not check any boxes).

  • Action: Save the intent configuration.

Slot Creation

Slot Creation Steps for Generative AI and Weather API

  1. For Generative AI

  • Navigate to Slots

  • In your Custom App, go to the Slots tab.

  • Create New Slot

  • Click Create New Slot

Enter Slot Details for User Input

  • Name: UserInput

  • Slot Order: 1

  • Type: Text

  • Intent: chatintent

  • Click Save

  • Save the slot configuration.

  1. For Weather API

  • Create New Slot

  • Click Create New Slot.

Enter Slot Details for Location

  • Name: location

    • Slot Order: 1

    • Type: Text

    • Intent: Get Forecast Intent / Get Current Weather Intent / Get Weather for Specific Date Intent / Get Weather for Specific Day Intent

  • Click Save

  • Save the slot configuration.

  1. Create New Slot

  • Click Create New Slot.

  • Enter Slot Details for Date

    • Name: date

    • Slot Order: 2

    • Type: Date

    • Intent: Get Weather for Specific Date Intent / Get Weather for Specific Day Intent

  • Click Save

  • Save the slot configuration.

  1. Create New Slot

  • Click Create New Slot.

  • Enter Slot Details for Number of Days

    • Name: number_of_days

    • Slot Order: 3

    • Type: Number

    • Intent: Get Forecast Intent

  • Click Save

  • Save the slot configuration.

Utterance

For Generative AI Intent

  1. Navigate to Utterances

  • In your Custom App, go to the Utterances tab.

Create New Utterance

  • Click on Create New Utterance.

  1. Enter Utterance Details

  • Intent: chatintent

  • Example Utterances:

    • "What’s the weather like today?"

    • "Can you tell me about the forecast for this weekend?"

    • "How’s the weather in Austin?"

    • "Give me a weather update."

    • "Tell me about tomorrow’s weather."

  • Click Save

  • Save the utterance configuration.

  1. For Weather API Intents

  • Create New Utterance

  • Click on Create New Utterance.

  • Enter Utterance Details for Get Forecast Intent

    • Intent: Get Forecast Intent

    • Example Utterances:

    • "What’s the weather forecast for the next three days?"

    • "Show me the weather for next week."

    • "How will the weather be in the coming days?"

  • Click Save

  • Save the utterance configuration.

  1. For Current Weather Intent

  • Create New Utterance

  • Click on Create New Utterance

  • Enter Utterance Details for Get Current Weather Intent

    • Intent: Get Current Weather Intent

    • Example Utterances:

    • What is the current weather in New York

    • Tell me today is weather

    • What is the temperature right now

  • Click Save

  • Save the utterance configuration.

  1. For Get Weather for Specific Date Intent

  • Create New Utterance

  • Click on Create New Utterance.

  • Enter Utterance Details for Get Weather for Specific Date Intent

    • Intent: Get Weather for Specific Date Intent

    • Example Utterances:

    • "What will the weather be like on the 15th?"

    • "Can you give me the weather for next Friday?"

    • "Tell me about the forecast for December 1st."

  • Click Save

  • Save the utterance configuration.

  1. For Get Weather for Specific Day Intent

  • Create New Utterance

  • Click on Create New Utterance.

  • Enter Utterance Details for Get Weather for Specific Day Intent

    • Intent: Get Weather for Specific Day Intent

    • Example Utterances:

    • "What’s the weather like tomorrow?"

    • "How will the weather be this Saturday?"

    • "What’s the forecast for next Monday?"

  • Click Save

  • Save the utterance configuration.

Input Configuration

  1. For Generative AI Intent

  • Navigate to Input Configuration

  • In your Custom App, go to the Input Configuration tab.

    • Name: Genegrative AI Input

    • Description: This input captures user interactions for weather-related inquiries and generates responses through the Azure Chat model.

    • Custom App: Weather Bot V1

    • Custom Intent: chatintent

    • Datasource: Gen AI

    • Data Source Method: Azure Chat RAG Method

  • Click Save

  • Save the input configuration.

  1. For Weather API Intents

  • Create Input Configuration for Get Forecast Intent

  • Navigate to Input Configuration

  • Click on Add New Input Configuration.

  • Input Configuration Details

    • Name: Get Forecast Intent

    • Description: This input gathers location and the duration for which the weather forecast is required.

    • Custom App: Weather Bot V1

    • Custom Intent: GetForecastIntent

    • Datasource: WeatherDataSource

    • Data Source Method: GetForecastMethod

    • Click Save

    • Save the input configuration.

  1. For Get Current Weather Intent

  • Navigate to Input Configuration

  • Click on Add New Input Configuration.

  • Input Configuration Details

    • Name: Get Current Weather Intent

    • Description: This input captures location data to retrieve the current weather conditions

    • Custom App: Weather Bot V1

    • Custom Intent: GetForecastIntent

    • Datasource: WeatherDataSource

    • Data Source Method: GetCurrentWeatherMethod

  • Click Save

  • Save the input configuration.

  1. For Get Weather for Specific Date Intent

  • Navigate to Input Configuration

  • Click on Add New Input Configuration.

  • Input Configuration Details

    • Name: Get Weather for Specific Date Intent

    • Description: This input captures the location and date to provide the weather forecast for that specific day.

    • Custom App: Weather Bot V1

    • Custom Intent: GetWeatherforSpecificDateIntent

    • Datasource: WeatherDataSource

    • DataSourceMethod: Get Specific Date Weather Method

  • Click Save

  • Save the input configuration.

  1. Create Input Configuration for Get Weather for Specific Day Intent

  • Navigate to Input Configuration

  • Click on Add New Input Configuration.

  • Input Configuration Details

    • Name: Get Weather for Specific Day Intent

    • Description: This input allows the user to specify a day and location to get the weather forecast.

    • Custom App: Weather Bot V1

    • Custom Intent: GetWeatherforSpecificDayIntent

    • Datasource: WeatherDataSource

    • DataSourceMethod: Get Specific Day Weather Method

  • Click Save

  • Save the input configuration.

Application Publishing

  1. Navigate to Publish

  • In your Custom App, go to the Publish tab.

  • Add App Publishing

  • Click Add App Publishing.

  • Enter App Publishing Details

    • External App Name: Weather Bot v1

    • App Description: "A bot to provide current weather updates."

    • App Type: Search

    • Channel: Generative AI

    • Check: Enable API Access (Optional: Check boxes for basic/showcase mode visibility)

    • Welcome Message: I'm iX Hello Weather Bot; how can I help you today

    • Welcome Back Message: Welcome back to iX Hello Weather Bot. How can I help you?

    • Help: I can help answer your questions. How can I help you?

  • Click Save

  • Save the publishing settings.

12. Testing

  1. Conduct Thorough Testing

  • Test your newly published bot to ensure functionality and accuracy.

  • Check Query Responses

  • Ask various weather-related questions to verify that the bot provides correct and relevant responses.

Congratulations!

You have successfully completed building a Weather Bot.

Last updated

Was this helpful?