-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhandlers.py
executable file
·702 lines (597 loc) · 24.3 KB
/
handlers.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
import math
import json
import requests
from pprint import pprint
from datetime import datetime
import dateutil.parser
# request types
AGENCIES = "agencies"
ARRIVAL_ESTIMATES = "arrival-estimates"
ROUTES = "routes"
SEGMENTS = "segments"
VEHICLES = "vehicles"
STOPS = "stops"
def make_request(request_type, agencies=None, geo_area=None, routes=None, stops=None):
if type(agencies) is list:
agencies = ",".join(agencies) # convert list of agencies into string
if type(routes) is list:
routes = ",".join(routes) # convert list of stops into string
if type(stops) is list:
stops = ",".join(stops) # convert list of stops into string
payload = [('format', 'json'),
('agencies', agencies) if agencies else None,
('geo_area', geo_area) if geo_area else None,
('routes', routes) if routes else None,
('stops', stops) if stops else None
]
payload = [x for x in payload if x is not None]
api_url = "https://transloc-api-1-2.p.rapidapi.com/"
headers = {
"X-RapidAPI-Key": "49e8d6f922msh58d18d370a3dc27p12e16djsn3eb2f5483f33"
}
response = requests.get(api_url + request_type,
headers=headers,
params=payload)
if not response.ok:
print("Request errored with status code", response.status_code)
print("Reason:", response.reason)
if not response.json().get('data'):
print("Request returned no data. Payload:", payload)
return None
return response.json()['data']
def build_geo_area(latitude, longitude, radius=10000):
# latitude, longitude|radius (meters)
return str(latitude) + "," + str(longitude) + "|" + str(radius)
def uncouple_geo_area(geo):
return {
"latitude": float(geo[:geo.find(",")]),
"longitude": float(geo[geo.find(",")+1:geo.find("|")]),
"radius": int(geo[geo.find("|")+1:])
}
def find_by_key(key_id, field, entities):
if not entities or len(entities) == 0:
print("find_by_key passed a None value")
print("key_id:", key_id, "field:", field, "entities:", entities)
return
if not key_id:
print("Trying to find with None key_id")
print("key_id:", key_id, "field:", field, "entities:", entities)
return
for entity in entities:
if entity[field] == key_id:
return entity
print("Couldn't find", key_id)
print("key_id:", key_id, "field:", field, "entities:", entities)
def get_bus_fullness(vehicle):
try:
return "This bus is likely very full. " if (vehicle['passenger_load'] / (vehicle['standing_capacity'] + vehicle['seating_capacity'])) > 0.75 else ""
except:
return ""
def get_route(agency_id, route_name, geo_area=None):
routes = make_request(ROUTES, agencies=agency_id, geo_area=geo_area)
return find_by_key(route_name, 'long_name', routes)
def distance_between(lat_1, lon_1, lat_2, lon_2):
'''Uses the "great circle distance" formula and the circumference of the earth
to convert two GPS coordinates to the miles separating them'''
lat_1, lon_1 = math.radians(lat_1), math.radians(lon_1)
lat_2, lon_2 = math.radians(lat_2), math.radians(lon_2)
theta = lon_1 - lon_2
dist = math.sin(lat_1)*math.sin(lat_2) + math.cos(lat_1)*math.cos(lat_2)*math.cos(theta)
dist = math.acos(dist)
dist = math.degrees(dist)
dist = dist * 69.06 # 69.09 = circumference of earth in miles / 360 degrees
return dist
def get_route_stops(agency_id, route_id):
response = make_request(STOPS, agencies=agency_id, routes=[route_id])
stops = []
for stop in response:
if route_id in stop['routes']:
stops.append(stop)
return stops
def sort_stops(stops, location):
if type(location) is str:
location = uncouple_geo_area(location)
elif type(location) is not dict:
print("Invalid location format")
return None
closest_stop = sorted(stops, key=lambda x: distance_between(x['location']['lat'], x['location']['lng'], location['latitude'], location['longitude']))
return closest_stop
def get_vehicle_current_stop(vehicle):
if len(vehicle['arrival_estimates']) > 0:
return vehicle['arrival_estimates'][0]
else:
return None
def get_arrivals_for_stop(agency_id, stop_id, routes=None):
print("ROUTES", routes)
print("STOP_ID", stop_id)
arrivals = make_request(ARRIVAL_ESTIMATES, agencies=agency_id, routes=routes, stops=stop_id)
print("ARRIVALS", arrivals)
stop_arrivals = find_by_key(stop_id, "stop_id", arrivals)
return stop_arrivals.get('arrivals')
def get_arrival_time_estimates(arrivals):
if type(arrivals) is not list:
arrivals = [arrivals]
now = datetime.now()
return sorted([dateutil.parser.parse(arrival['arrival_at']).replace(tzinfo=None) - now for arrival in arrivals])
def format_time(arrival):
seconds = int(arrival.total_seconds())
minutes = int(seconds // 60)
hours = int(minutes // 60)
if minutes == 0:
return " is arriving now"
minutes = minutes % 60
text = " arrives in "
if hours > 0:
text += str(hours) + str(" hours " if hours > 1 else " hour")
if minutes > 0:
text += "and "
if minutes > 0:
text += str(minutes) + str(" minutes" if minutes > 1 else " minute")
return text
def get_arrival_text(arrival_times, bus_line, stop_name):
if len(arrival_times) == 0:
return "There are no buses arriving soon."
text = "The next " + bus_line + format_time(arrival_times[0]) + " at " + stop_name + "."
for i in range(1, len(arrival_times)):
text += " Another bus" + format_time(arrival_times[i]) + "."
return text
def get_one_bus_arrival_text(arrival_time, bus_line, stop_name):
text = "The " + bus_line + format_time(arrival_time) + " at " + stop_name + "."
return text
def convert_address_to_coordinates(address):
print("ADDRESS:", address)
api_key = "AIzaSyDWCnuBAOcZHyNDzRTa6JC9PtDRnML6UQI"
if type(address) is not dict:
print("Invalid attempt to convert address:", address)
return None
try:
address_string = "+".join([address['addressLine1'],
address['city'], address['stateOrRegion'],
address['postalCode'], address['countryCode']])
except KeyError:
address_string = "+".join(address.values())
response = requests.get('https://maps.googleapis.com/maps/api/geocode/json?address=' + address_string + "&key=" + api_key)
if len(response.json()['results']) == 0:
print("No location could be determined from this address:", address)
return None
else:
return response.json()['results'][0]['geometry']['location']
def get_next_bus(intent_request, bus_lines, geo_area, where=False):
text = ""
if type(bus_lines) is str:
bus_lines = [bus_lines] # we want to loop through bus routes, not characters of a string
agencies = make_request(AGENCIES, geo_area=geo_area)
if not agencies:
return "We can't find any routes near you"
print("AGENCIES:", agencies)
matched_route = None
for ag in agencies:
ag_id = ag['agency_id']
for bus_line in bus_lines:
routes = make_request(ROUTES, agencies=ag_id).get(ag_id)
route = find_by_key(bus_line, 'long_name', routes)
if not route:
print("Couldn't find route", bus_line, "in agency", ag_id)
continue
matched_route = route
route_name = matched_route['long_name']
agency = ag
agency_id = ag_id
break
if not matched_route:
return "I couldn't find any routes by that name near you"
print("AGENCY:", agency.get('long_name'))
print("MATCHED ROUTE:", matched_route.get('route_id'))
stops = make_request(STOPS, agencies=agency_id, geo_area=geo_area, routes=matched_route['route_id'])
sorted_stops = sort_stops(stops, geo_area)
nearest_stop = None
for stop in sorted_stops:
if matched_route['route_id'] in stop['routes']:
nearest_stop = stop
break
if not nearest_stop:
return "I couldn't find any stops near you for the " + bus_line
print("Nearest stop:", nearest_stop['stop_id'])
estimates = get_arrivals_for_stop(agency_id, stop_id=nearest_stop['stop_id'], routes=matched_route['route_id'])
print("ESTIMATES:", estimates)
if not estimates:
return "There are no upcoming " + route_name + " buses near you."
arrival_time_deltas = get_arrival_time_estimates(estimates)
if where:
your_bus_id = estimates[0]['vehicle_id']
print("YOUR BUS ID:", your_bus_id)
response = make_request(VEHICLES, agencies=agency_id, routes=matched_route['route_id'])
vehicles = response.get(agency_id)
your_bus = find_by_key(your_bus_id, "vehicle_id", vehicles)
vehicle_current_stop = get_vehicle_current_stop(your_bus)
current_stop = find_by_key(vehicle_current_stop.get('stop_id'), 'stop_id', sorted_stops)
if not current_stop:
return "Can't find that bus right now"
text = "The next bus is currently at " + str(current_stop.get('name')) + ". "
text += get_bus_fullness(your_bus)
text += get_one_bus_arrival_text(arrival_time_deltas[0], bus_line, nearest_stop['name'])
else:
text = get_arrival_text(arrival_time_deltas, bus_line, nearest_stop['name'])
return text
def get_next_bus_from_bus_arrivals(intent_request, bus_lines, geo_area, where=False):
if type(bus_lines) is str:
bus_lines = [bus_lines] # we want to loop through bus routes, not characters of a string
agencies = make_request(AGENCIES, geo_area=geo_area)
if not agencies:
return "We can't find any routes near you"
print("AGENCIES:", agencies)
matched_route = None
for ag in agencies:
ag_id = ag['agency_id']
for bus_line in bus_lines:
routes = make_request(ROUTES, agencies=ag_id).get(ag_id)
route = find_by_key(bus_line, 'long_name', routes)
if not route:
print("Couldn't find route", bus_line, "in agency", ag_id)
continue
matched_route = route
agency = ag
agency_id = ag_id
break
if not matched_route:
return "I couldn't find any routes by that name near you"
print("AGENCY:", agency.get('long_name'))
print("MATCHED ROUTE:", matched_route.get('route_id'))
stops = make_request(STOPS, agencies=agency_id, geo_area=geo_area, routes=matched_route['route_id'])
sorted_stops = sort_stops(stops, geo_area)
nearest_stop = None
for stop in sorted_stops:
if matched_route['route_id'] in stop['routes']:
nearest_stop = stop
break
if not nearest_stop:
return "I couldn't find any stops near you for the " + bus_line
print("Nearest stop:", nearest_stop['stop_id'], nearest_stop['name'])
response = make_request(VEHICLES, agencies=agency_id, routes=matched_route['route_id'])
vehicles = response.get(agency_id)
closest_bus_stops_away = 100
closest_bus = None
for vehicle in vehicles:
arrival_estimates = vehicle.get("arrival_estimates")
for i, estimate in enumerate(arrival_estimates):
if estimate.get("stop_id") == nearest_stop.get("stop_id"):
if i < closest_bus_stops_away:
closest_bus_stops_away = i
closest_bus = vehicle
break
if closest_bus is None:
return "Couldn't find a bus"
arrival = find_by_key(nearest_stop['stop_id'], 'stop_id', closest_bus.get("arrival_estimates"))
arrival_time = get_arrival_time_estimates(arrival)[0]
vehicle_current_stop = get_vehicle_current_stop(closest_bus)
current_stop = find_by_key(vehicle_current_stop.get('stop_id'), 'stop_id', sorted_stops)
if not current_stop:
return "Can't find that bus right now"
text = "The next bus is currently at " + str(current_stop.get('name')) + ". "
text += get_bus_fullness(closest_bus)
text += get_one_bus_arrival_text(arrival_time, bus_line, nearest_stop['name'])
return text
def build_response_alexa(text):
response = {
'version': '1.0',
'response': {
'outputSpeech': {
'type': 'PlainText',
'text': text,
}
}
}
return response
def build_permission_card_response_alexa(permissions):
response = {
'version': '1.0',
'response': {
'card':{
'type': 'AskForPermissionsConsent',
'permissions': permissions
}
}
}
return response
def on_launch_alexa(intent_request, session):
return build_response_alexa("Welcome to Bus Buddy")
def on_intent_alexa(intent_request, session, addr):
intent = intent_request["intent"]
intent_name = intent_request["intent"]["name"]
bus_lines = intent["slots"]["bus_line"]["resolutions"]["resolutionsPerAuthority"][0].get("values")
geo_area = build_geo_area(addr["lat"], addr["lng"])
bus_names = [bus['value']['name'] for bus in bus_lines]
if intent_name == "GetNextBus":
text = get_next_bus(intent_request, bus_names, geo_area=geo_area, where=False)
elif intent_name == "WhereIsBus":
text = get_next_bus(intent_request, bus_names, geo_area=geo_area, where=True)
else:
return build_response_alexa("Invalid Intent")
return build_response_alexa(text)
def build_response_google(text):
return {'fulfillmentText': text}
def on_intent_google(intent_request):
intent = intent_request["queryResult"]["intent"]
params = intent_request.get('queryResult').get('parameters')
print("PARAMS:", params)
request_type = params['request_type']
# coordinates for Whyburn: latitude=38.0294814, longitude=-78.5193463
# geo_area='38.0294814,-78.5193463|10000'
latitude = 38.0294814
longitude = -78.5193463
# if "location" in params.keys():
# location = params['location']
# print("ADDRESS DETECTED:", location)
#
# location = convert_address_to_coordinates(location)
# print("ADDRESS RESOLVED TO:", location)
# if location:
# latitude = location['lat']
# longitude = location['lng']
# else:
# print("Could not convert address to coordinates. Using default coordinates")
geo_area = build_geo_area(latitude, longitude)
if intent['displayName'] == "GetNextBus":
if request_type == "when":
text = get_next_bus(intent_request, [params['bus_line']], geo_area=geo_area, where=False)
elif request_type == "where":
text = get_next_bus_from_bus_arrivals(intent_request, [params['bus_line']], geo_area=geo_area, where=True)
else:
raise ValueError("Invalid request")
else:
raise ValueError("Invalid intent")
return build_response_google(text)
def get_postal_addr_alexa(event):
system = event["context"]["System"]
user = system["user"]
api_token = system["apiAccessToken"]
host = system["apiEndpoint"]
device_id = system["device"]["deviceId"]
endpoint = "/v1/devices/" + str(device_id) + "/settings/address"
headers = {
"Authorization": "Bearer " + api_token
}
response = requests.get(host + endpoint, headers=headers)
return response.json()
def lambda_handler(event, context):
pprint(event)
addr = {
"lat": None,
"lng": None
}
supported_interfaces = event["context"]["System"]["device"]["supportedInterfaces"]
user = event["context"]["System"]["user"]
gps_permission_status = user["permissions"]["scopes"]["alexa::devices:all:geolocation:read"]["status"]
if supported_interfaces.get("Geolocation") is not None:
if gps_permission_status == "DENIED":
return build_permission_card_response_alexa(["alexa::devices:all:geolocation:read"])
else:
if event["context"].get("Geolocation"):
geo = event["context"]["Geolocation"]
addr["lat"] = geo["coordinate"]["latitudeInDegrees"]
addr["lng"] = geo["coordinate"]["longitudeInDegrees"]
else:
return build_response_alexa("GPS info not available. Please enable location services and try again.")
else:
response = get_postal_addr_alexa(event)
pprint(response)
if response.get("code") and response["code"] == "ACCESS_DENIED":
return build_permission_card_response_alexa(["read::alexa:device:all:address"])
else:
addr = convert_address_to_coordinates(response)
if event["request"]["type"] == "IntentRequest":
return on_intent_alexa(event["request"], event["session"], addr)
elif event["request"]["type"] == "LaunchRequest":
return on_launch_alexa(event["request"], event["session"])
else:
return build_response_alexa("I think an error occurred")
def google_handler(request):
return json.dumps(on_intent_google(request.get_json()))
print(on_intent_google({
"responseId": "a059d473-0ac4-4542-9794-ad9ae4b2dfb4",
"queryResult": {
"queryText": "when is the next Northline at Barracks Road Charlottesville Virginia",
"parameters": {
"bus_line": "Northline",
"request_type": "where",
"location": {
"street-address": "Barracks Road",
"city": "Charlottesville",
"admin-area": "Virginia"
}
},
"allRequiredParamsPresent": True,
"fulfillmentText": "The Northline is on in the way",
"fulfillmentMessages": [
{
"text": {
"text": [
"The Northline is on in the way"
]
}
}
],
"outputContexts": [
{
"name": "projects/busbuddy-64e11/agent/sessions/ABwppHFGsgKnRFezct-CQz67b8ih2sac9e6N9gkE6bjgqkOpEcYDKomj0D54QeVm1OeKSLqbbjMUYQ39sSo/contexts/actions_capability_screen_output",
"parameters": {
"location.original": "Barracks Road Charlottesville Virginia",
"request_type": "when",
"bus_line": "Northline",
"location": {
"street-address": "Barracks Road",
"street-address.original": "Barracks Road",
"street-address.object": {},
"city": "Charlottesville",
"city.original": "Charlottesville",
"city.object": {},
"admin-area": "Virginia",
"admin-area.original": "Virginia",
"admin-area.object": {}
},
"bus_line.original": "Northline",
"request_type.original": "when"
}
},
{
"name": "projects/busbuddy-64e11/agent/sessions/ABwppHFGsgKnRFezct-CQz67b8ih2sac9e6N9gkE6bjgqkOpEcYDKomj0D54QeVm1OeKSLqbbjMUYQ39sSo/contexts/actions_capability_audio_output",
"parameters": {
"location.original": "Barracks Road Charlottesville Virginia",
"request_type": "when",
"bus_line": "Northline",
"location": {
"street-address": "Barracks Road",
"street-address.original": "Barracks Road",
"street-address.object": {},
"city": "Charlottesville",
"city.original": "Charlottesville",
"city.object": {},
"admin-area": "Virginia",
"admin-area.original": "Virginia",
"admin-area.object": {}
},
"bus_line.original": "Northline",
"request_type.original": "when"
}
},
{
"name": "projects/busbuddy-64e11/agent/sessions/ABwppHFGsgKnRFezct-CQz67b8ih2sac9e6N9gkE6bjgqkOpEcYDKomj0D54QeVm1OeKSLqbbjMUYQ39sSo/contexts/google_assistant_input_type_keyboard",
"parameters": {
"location.original": "Barracks Road Charlottesville Virginia",
"request_type": "when",
"bus_line": "Northline",
"location": {
"street-address": "Barracks Road",
"street-address.original": "Barracks Road",
"street-address.object": {},
"city": "Charlottesville",
"city.original": "Charlottesville",
"city.object": {},
"admin-area": "Virginia",
"admin-area.original": "Virginia",
"admin-area.object": {}
},
"bus_line.original": "Northline",
"request_type.original": "when"
}
},
{
"name": "projects/busbuddy-64e11/agent/sessions/ABwppHFGsgKnRFezct-CQz67b8ih2sac9e6N9gkE6bjgqkOpEcYDKomj0D54QeVm1OeKSLqbbjMUYQ39sSo/contexts/actions_capability_media_response_audio",
"parameters": {
"location.original": "Barracks Road Charlottesville Virginia",
"request_type": "when",
"bus_line": "Northline",
"location": {
"street-address": "Barracks Road",
"street-address.original": "Barracks Road",
"street-address.object": {},
"city": "Charlottesville",
"city.original": "Charlottesville",
"city.object": {},
"admin-area": "Virginia",
"admin-area.original": "Virginia",
"admin-area.object": {}
},
"bus_line.original": "Northline",
"request_type.original": "when"
}
},
{
"name": "projects/busbuddy-64e11/agent/sessions/ABwppHFGsgKnRFezct-CQz67b8ih2sac9e6N9gkE6bjgqkOpEcYDKomj0D54QeVm1OeKSLqbbjMUYQ39sSo/contexts/actions_capability_web_browser",
"parameters": {
"location.original": "Barracks Road Charlottesville Virginia",
"request_type": "when",
"bus_line": "Northline",
"location": {
"street-address": "Barracks Road",
"street-address.original": "Barracks Road",
"street-address.object": {},
"city": "Charlottesville",
"city.original": "Charlottesville",
"city.object": {},
"admin-area": "Virginia",
"admin-area.original": "Virginia",
"admin-area.object": {}
},
"bus_line.original": "Northline",
"request_type.original": "when"
}
}
],
"intent": {
"name": "projects/busbuddy-64e11/agent/intents/d6f859df-fae2-4c6c-aba6-e2ffdc637fc2",
"displayName": "GetNextBus"
},
"intentDetectionConfidence": 1,
"languageCode": "en-us"
},
"originalDetectIntentRequest": {
"source": "google",
"version": "2",
"payload": {
"isInSandbox": True,
"surface": {
"capabilities": [
{
"name": "actions.capability.WEB_BROWSER"
},
{
"name": "actions.capability.SCREEN_OUTPUT"
},
{
"name": "actions.capability.MEDIA_RESPONSE_AUDIO"
},
{
"name": "actions.capability.AUDIO_OUTPUT"
}
]
},
"requestType": "SIMULATOR",
"inputs": [
{
"rawInputs": [
{
"query": "when is the next Northline at Barracks Road Charlottesville Virginia",
"inputType": "KEYBOARD"
}
],
"arguments": [
{
"rawText": "when is the next Northline at Barracks Road Charlottesville Virginia",
"textValue": "when is the next Northline at Barracks Road Charlottesville Virginia",
"name": "text"
}
],
"intent": "actions.intent.TEXT"
}
],
"user": {
"lastSeen": "2019-03-31T06:09:30Z",
"locale": "en-US",
"userId": "ABwppHHuZv9-V5SSWdWySTggylc8W2Qqx5GEng9kpM9F1l55JxOlxXEbYGI2VpgTSyVxWENuLxUGAng0_X0"
},
"conversation": {
"conversationId": "ABwppHFGsgKnRFezct-CQz67b8ih2sac9e6N9gkE6bjgqkOpEcYDKomj0D54QeVm1OeKSLqbbjMUYQ39sSo",
"type": "ACTIVE",
"conversationToken": "[]"
},
"availableSurfaces": [
{
"capabilities": [
{
"name": "actions.capability.SCREEN_OUTPUT"
},
{
"name": "actions.capability.WEB_BROWSER"
},
{
"name": "actions.capability.AUDIO_OUTPUT"
}
]
}
]
}
},
"session": "projects/busbuddy-64e11/agent/sessions/ABwppHFGsgKnRFezct-CQz67b8ih2sac9e6N9gkE6bjgqkOpEcYDKomj0D54QeVm1OeKSLqbbjMUYQ39sSo"
}
))