|
| 1 | +sources: |
| 2 | + my-pg-instance: |
| 3 | + kind: cloud-sql-postgres |
| 4 | + project: retrieval-app-testing |
| 5 | + region: us-central1 |
| 6 | + instance: my-cloudsql-pg-instance |
| 7 | + database: assistantdemo |
| 8 | + user: postgres |
| 9 | + password: postgres |
| 10 | +authServices: |
| 11 | + my_google_service: |
| 12 | + kind: google |
| 13 | + clientId: 706535509072-qa5v22ur8ik8o513b0538ufo0ne9jfn5.apps.googleusercontent.com |
| 14 | +tools: |
| 15 | + search_airports: |
| 16 | + kind: postgres-sql |
| 17 | + source: my-pg-instance |
| 18 | + description: | |
| 19 | + Use this tool to list all airports matching search criteria. |
| 20 | + Takes at least one of country, city, name, or all and returns all matching airports. |
| 21 | + The agent can decide to return the results directly to the user. |
| 22 | + parameters: |
| 23 | + - name: country |
| 24 | + type: string |
| 25 | + description: Country |
| 26 | + default: "" |
| 27 | + - name: city |
| 28 | + type: string |
| 29 | + description: City |
| 30 | + default: "" |
| 31 | + - name: name |
| 32 | + type: string |
| 33 | + description: Airport name |
| 34 | + default: "" |
| 35 | + statement: | |
| 36 | + SELECT * FROM airports |
| 37 | + WHERE (CAST($1 AS TEXT) = '' OR country ILIKE $1) |
| 38 | + AND (CAST($2 AS TEXT) = '' OR city ILIKE $2) |
| 39 | + AND (CAST($3 AS TEXT) = '' OR name ILIKE '%' || $3 || '%') |
| 40 | + LIMIT 10 |
| 41 | + list_flights: |
| 42 | + kind: postgres-sql |
| 43 | + source: my-pg-instance |
| 44 | + description: | |
| 45 | + Use this tool to list flights information matching search criteria. |
| 46 | + Takes an arrival airport, a departure airport, or both, filters by date and returns all matching flights. |
| 47 | + If 3-letter iata code is not provided for departure_airport or arrival_airport, use `search_airports` tool to get iata code information. |
| 48 | + Do NOT guess a date, ask user for date input if it is not given. Date must be in the following format: YYYY-MM-DD. |
| 49 | + The agent can decide to return the results directly to the user. |
| 50 | + parameters: |
| 51 | + - name: departure_airport |
| 52 | + type: string |
| 53 | + description: Departure airport 3-letter code |
| 54 | + default: "" |
| 55 | + - name: arrival_airport |
| 56 | + type: string |
| 57 | + description: Arrival airport 3-letter code |
| 58 | + default: "" |
| 59 | + - name: date |
| 60 | + type: string |
| 61 | + description: Date of flight departure |
| 62 | + statement: | |
| 63 | + SELECT * FROM flights |
| 64 | + WHERE (CAST($1 AS TEXT) = '' OR departure_airport ILIKE $1) |
| 65 | + AND (CAST($2 AS TEXT) = '' OR arrival_airport ILIKE $2) |
| 66 | + AND departure_time >= CAST($3 AS timestamp) |
| 67 | + AND departure_time < CAST($3 AS timestamp) + interval '1 day' |
| 68 | + LIMIT 10 |
| 69 | + search_flights_by_number: |
| 70 | + kind: postgres-sql |
| 71 | + source: my-pg-instance |
| 72 | + description: | |
| 73 | + Use this tool to get information for a specific flight. |
| 74 | + Takes an airline code and flight number and returns info on the flight. |
| 75 | + Do NOT use this tool with a flight id. Do NOT guess an airline code or flight number. |
| 76 | + A airline code is a code for an airline service consisting of two-character |
| 77 | + airline designator and followed by flight number, which is 1 to 4 digit number. |
| 78 | + For example, if given CY 0123, the airline is "CY", and flight_number is "123". |
| 79 | + Another example for this is DL 1234, the airline is "DL", and flight_number is "1234". |
| 80 | + If the tool returns more than one option choose the date closest to the current date. |
| 81 | + parameters: |
| 82 | + - name: airline |
| 83 | + type: string |
| 84 | + description: Airline unique 2 letter identifier |
| 85 | + - name: flight_number |
| 86 | + type: string |
| 87 | + description: 1 to 4 digit number |
| 88 | + statement: | |
| 89 | + SELECT * FROM flights |
| 90 | + WHERE airline = $1 |
| 91 | + AND flight_number = $2 |
| 92 | + LIMIT 10 |
| 93 | + search_amenities: |
| 94 | + kind: postgres-sql |
| 95 | + source: my-pg-instance |
| 96 | + description: | |
| 97 | + Use this tool to search amenities by name or to recommended airport amenities at SFO. |
| 98 | + If user provides flight info, use 'search_flights_by_number' tool |
| 99 | + first to get gate info and location. |
| 100 | + Only recommend amenities that are returned by this query. |
| 101 | + Find amenities close to the user by matching the terminal and then comparing |
| 102 | + the gate numbers. Gate number iterate by letter and number, example A1 A2 A3 |
| 103 | + B1 B2 B3 C1 C2 C3. Gate A3 is close to A2 and B1. |
| 104 | + parameters: |
| 105 | + - name: query |
| 106 | + type: string |
| 107 | + description: Search query |
| 108 | + statement: | |
| 109 | + SELECT name, description, location, terminal, category, hour |
| 110 | + FROM amenities |
| 111 | + WHERE (embedding <=> $1) < 0.5 |
| 112 | + ORDER BY (embedding <=> $1) |
| 113 | + LIMIT 5 |
| 114 | + search_policies: |
| 115 | + kind: postgres-sql |
| 116 | + source: my-pg-instance |
| 117 | + description: | |
| 118 | + Use this tool to search for cymbal air passenger policy. |
| 119 | + Policy that are listed is unchangeable. |
| 120 | + You will not answer any questions outside of the policy given. |
| 121 | + Policy includes information on ticket purchase and changes, baggage, check-in and boarding, special assistance, overbooking, flight delays and cancellations. |
| 122 | + parameters: |
| 123 | + - name: query |
| 124 | + type: string |
| 125 | + description: Search query |
| 126 | + statement: | |
| 127 | + SELECT content |
| 128 | + FROM policies |
| 129 | + WHERE (embedding <=> $1) < 0.5 |
| 130 | + ORDER BY (embedding <=> $1) |
| 131 | + LIMIT 5 |
| 132 | + validate_ticket: |
| 133 | + kind: postgres-sql |
| 134 | + source: my-pg-instance |
| 135 | + description: | |
| 136 | + Use this tool to validate ticket before booking. |
| 137 | + parameters: |
| 138 | + - name: airline |
| 139 | + type: string |
| 140 | + description: Airline unique 2 letter identifier |
| 141 | + - name: flight_number |
| 142 | + type: string |
| 143 | + description: 1 to 4 digit number |
| 144 | + - name: departure_airport |
| 145 | + type: string |
| 146 | + description: Departure airport 3-letter code |
| 147 | + - name: departure_time |
| 148 | + type: string |
| 149 | + description: Flight departure datetime |
| 150 | + statement: | |
| 151 | + SELECT * FROM flights |
| 152 | + WHERE airline ILIKE $1 |
| 153 | + AND flight_number ILIKE $2 |
| 154 | + AND departure_airport ILIKE $3 |
| 155 | + AND departure_time = $4 |
| 156 | + insert_ticket: |
| 157 | + kind: postgres-sql |
| 158 | + source: my-pg-instance |
| 159 | + description: | |
| 160 | + Use this tool to book a flight ticket for the user. |
| 161 | + parameters: |
| 162 | + - name: user_id |
| 163 | + type: string |
| 164 | + description: User ID of the logged in user. |
| 165 | + authServices: |
| 166 | + - name: my_google_service |
| 167 | + field: sub |
| 168 | + - name: user_name |
| 169 | + type: string |
| 170 | + description: Name of the logged in user. |
| 171 | + authServices: |
| 172 | + - name: my_google_service |
| 173 | + field: name |
| 174 | + - name: user_email |
| 175 | + type: string |
| 176 | + description: Email ID of the logged in user. |
| 177 | + authServices: |
| 178 | + - name: my_google_service |
| 179 | + field: email |
| 180 | + - name: airline |
| 181 | + type: string |
| 182 | + description: Airline unique 2 letter identifier |
| 183 | + - name: flight_number |
| 184 | + type: string |
| 185 | + description: 1 to 4 digit number |
| 186 | + - name: departure_airport |
| 187 | + type: string |
| 188 | + description: Departure airport 3-letter code |
| 189 | + - name: departure_time |
| 190 | + type: string |
| 191 | + description: Flight departure datetime |
| 192 | + - name: arrival_airport |
| 193 | + type: string |
| 194 | + description: Arrival airport 3-letter code |
| 195 | + - name: arrival_time |
| 196 | + type: string |
| 197 | + description: Flight arrival datetime |
| 198 | + statement: | |
| 199 | + INSERT INTO tickets ( |
| 200 | + user_id, |
| 201 | + user_name, |
| 202 | + user_email, |
| 203 | + airline, |
| 204 | + flight_number, |
| 205 | + departure_airport, |
| 206 | + departure_time, |
| 207 | + arrival_airport, |
| 208 | + arrival_time |
| 209 | + ) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9); |
| 210 | + list_tickets: |
| 211 | + kind: postgres-sql |
| 212 | + source: my-pg-instance |
| 213 | + description: | |
| 214 | + Use this tool to list a user's flight tickets. |
| 215 | + parameters: |
| 216 | + - name: user_id |
| 217 | + type: string |
| 218 | + description: User ID of the logged in user. |
| 219 | + authServices: |
| 220 | + - name: my_google_service |
| 221 | + field: sub |
| 222 | + statement: | |
| 223 | + SELECT user_name, airline, flight_number, departure_airport, arrival_airport, departure_time, arrival_time FROM tickets |
| 224 | + WHERE user_id = $1 |
| 225 | +toolsets: |
| 226 | + cymbal_air: |
| 227 | + - search_airports |
| 228 | + - list_flights |
| 229 | + - search_flights_by_number |
| 230 | + - search_amenities |
| 231 | + - search_policies |
| 232 | + - insert_ticket |
| 233 | + - list_tickets |
0 commit comments