- Published on
AI Agent to Retrieve Current Weather
- Authors
- Name
- Jai
- @jkntji

Step 1: Define Your Function in OpenAI
Begin by configuring the getWeather
function in your OpenAI Assistant with the following schema:
{
"name": "getWeather",
"description": "Get the weather in a location",
"strict": false,
"parameters": {
"type": "object",
"properties": {
"latitude": {
"type": "number",
"description": "Latitude of the location"
},
"longitude": {
"type": "number",
"description": "Longitude of the location"
}
},
"required": ["latitude", "longitude"],
"additionalProperties": false
}
}
Step 2: Sign In to Predictable Dialogs
- Navigate to Predictable Dialogs and sign in.
Step 3: Configure Your AI Resource
- Click on your profile picture, then select AI Resources.
- Choose the AI Resource you wish to configure.
- Click on Functions, then select the gear icon next to the
getWeather
function.
Step 4: Configure the Endpoint
- Choose GET as your HTTP method.
- Enter your endpoint URL with the static parameter:
https://api.open-meteo.com/v1/forecast?current=temperature_2m
Note: Don't include latitude
and longitude
in the URL—they'll be dynamically generated by your AI model during function calls.
- Click Save.
Step 5: Test the Function
- Initiate a new session with your chatbot.
- Enter a prompt like "What's the weather at 52.52 latitude and 13.41 longitude?"
- Observe how your chatbot automatically makes the function call, retrieves current temperature data, and responds accordingly.
Viewing Function Call Details
Go to the Sessions tab and select your conversation.
You'll see detailed function call information including:
- Triggered function (
getWeather
) and arguments (latitude
,longitude
). - Endpoint URL and method used (
GET https://api.open-meteo.com
). - Response received from the endpoint.
- Duration of the API call in milliseconds.
- Triggered function (

Hope this was useful and inspired you to use function calls for your use cases.