-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdemo_api.py
50 lines (40 loc) · 1.11 KB
/
demo_api.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
from knowledgebase import api
import json
msg = api.call_api(
"HKMTR_en",
constraints=[{
"departure": api.is_equal_to("University"),
"destination": api.is_equal_to("Kowloon Bay"),
}],
)
print(json.dumps(msg))
msg = api.call_api(
"香港地铁",
constraints=[{
"出发地": api.is_equal_to("銅鑼灣"),
"目的地": api.is_equal_to("香港仔"),
}],
)
print(json.dumps(msg,ensure_ascii=False))
msg = api.call_api(
"restaurants_en_US_booking",
constraints=[{
"name": api.is_equal_to("Chilli Fagara"),
"number_of_people": api.is_equal_to(3),
"user_name": api.is_equal_to("Ruth"),
"time": api.is_equal_to("4:00 pm"),
"date": api.is_equal_to("today")
}],
)
print(json.dumps(msg))
msg = api.call_api(
"餐馆预订",
constraints=[{
"名字": api.is_equal_to("Brick Lane"),
"人数": api.is_equal_to(3),
"用户名": api.is_equal_to("Ruth"),
"时间": api.is_equal_to("上午 4:00"),
"预订日期": api.is_equal_to("today")
}],
)
print(json.dumps(msg,ensure_ascii=False))