Skip to main content

Overview

The Swiss Transport Chatbot provides live public-transport connections across Switzerland — including trains, trams, buses, ships, and cableways.
This recipe demonstrates one AI agent connected to one function call (swiss_connection_search).

What you’ll build

  • Agent name: Swiss Transport Agent
  • Functions (1):
    1. swiss_connection_search — public-transport connections across Switzerland

Prerequisites

  • INNOCHAT workspace with Agent builder access.

Quick architecture

Steps to Build

Step 1: Create or Edit a Customer Support Agent

Agent Name: Swiss Transport Agent Description: Provides live public-transport connections in Switzerland. Users can ask for upcoming trains, buses, trams, ships, and cableway journeys between two Swiss stations, optionally specifying via-stations, travel modes, date, time, and arrival/departure preference.
Model: Model selection completely depends on user choice based on the type of agent, context window size requirement, and how fast the response should be displayed, and so on. Opt for GPT-5-mini or GPT-5-nano for faster responses. Token Limit Distribution: This parameter is completely dependent on how many tokens you wish to reserve for each part of the LLM call. The overall token limit depends on the LLM you picked, but you can fine tune the token distribution based on your particular use case.
Prompt:
Temperature: A parameter that controls the randomness or creativity of a large language model’s output by adjusting the probability of selecting the next word.

Step 2: Knowledge

Since it’s a basic agent creation with single LLM call, we can skip the Knowledge section and also uncheck the all sources parameter.

Step 3: Add the Function Call

Function Name: swiss_connection_search Description: This function queries the Transport.opendata.ch API to retrieve upcoming public‑transport connections between two Swiss stations.
Given inputs like departure and arrival station (name or ID), optional via‑stations, travel modes, date/time, and arrival/departure preference, it returns connection results. Each result includes the following fields:
  • departure_time: ISO timestamp of journey start
  • arrival_time: ISO timestamp of journey end
  • duration: e.g. “0:48” (hours:minutes)
  • transfers: integer number of transfers
  • from: departure station name
  • to: arrival station name
  • platform_from: departure platform (with prognosis if available)
  • platform_to: arrival platform (with prognosis if available)
  • transport_lines: names or numbers of lines used (e.g. “IC 13”, “S12”)
  • capacity: optional capacities for 1st/2nd class
API Endpoint: http://transport.opendata.ch/v1/connections Method: ‘GET’
Parameters:

Example

Example Input

Next train from Zürich to Bern at 09:00

Example Output

Here are the next connections from Zürich to Bern: Dep Zürich HB 09:02 → Arr Bern 10:00 (0h58, 1 transfer)
  • IC8 — Zürich HB (Plat 5) → Olten (Plat 4)
  • IC6 — Olten (Plat 6) → Bern (Plat 7) Real-time: on time. If no match found:
    “I’m sorry, I couldn’t find matching connections.”

Summary