-
-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathpoc.ai
More file actions
48 lines (43 loc) · 1.04 KB
/
poc.ai
File metadata and controls
48 lines (43 loc) · 1.04 KB
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
route /poc {
"""Test POC API"""
get /hello {
"""Get hello API"""
query {
"""hello content"""
@string(min_len=3, max_len=30)
content: str,
"""hello age"""
age: int = 18,
}
print(query);
print(body);
print(request);
print(header);
print(query.content);
print(query.age + 2);
let name = "aiscript";
print("name: " + name);
return "get: hello";
}
post /hello, put /hello2 {
"""Post and put hello API"""
query {
@string(min_len=3, max_len=30)
content: str,
"""age"""
age: int = 18,
@in(["ios", "android"])
platform: str = "ios",
}
@json
body {
"""test flag"""
test: bool = true,
}
ai fn ask(question) {
return prompt question;
}
let answer = ask(query.content);
return "AI answer: " + answer;
}
}