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
Navigate to Integration Go to Integration > Connect System.

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

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
Navigate to Content Go to Content > Content Categories.

Add New Category Click Add New Category

Enter Category Name Use a unique category name (e.g., Weather Category v1).
Provide Description Enter a concise description (e.g., "Category for Weather Bot").
Click Add Finalize by clicking the Add button.

Navigate to Apps Go to Apps > Custom Apps.
Create New Custom App Click New Custom App.

Enter App Details
Name: Weather Bot v1
Custom App Type: Search
Category: Select the Weather Category v1 created previously.
Check the Box: This is a Generative AI App.
Click Save Save the configuration.

Data Source Configuration
Navigate to Data Sources Within your newly created Custom App, go to the Data Sources tab.
Create New Data Source Click Create New Data Source.

Enter Data Source Details
Name: WeatherDataSource
Integration Configuration: Select your Generative AI connection (created in Step 1) or the REST connection (created in Step 2).
Click Save.

Method Definition
Navigate to Methods Within your newly created Custom App, go to the Methods tab.
Create New Method Click Create New Method.

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.
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
Navigate to Intents
In your Custom App, go to the Intents tab.

Create New Intent
Click Create New Intent.
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

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

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.

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.

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
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.

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.

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.

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
Navigate to Utterances
In your Custom App, go to the Utterances tab.
Create New Utterance
Click on Create New Utterance.

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.

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.

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.

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.

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
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.

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.

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.

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.

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
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
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?