-
Notifications
You must be signed in to change notification settings - Fork 1
/
schemas.py
72 lines (44 loc) · 1.07 KB
/
schemas.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
from os import link
from pydantic import BaseModel
# InputPattern
class InputPatternBase(BaseModel):
text: str
class InputPatternCreate(InputPatternBase):
pass
class InputPattern(InputPatternBase):
id: int
intent_id: int
class Config:
orm_mode = True
# ResponseLink
class ResponseLinkBase(BaseModel):
url: str
class ResponseLinkCreate(ResponseLinkBase):
pass
class ResponseLink(ResponseLinkBase):
id: int
intent_id: int
class Config:
orm_mode = True
# Intent
class IntentBase(BaseModel):
tag: str
response_text: str
class IntentCreate(IntentBase):
input_patterns: list[str] = []
response_links: list[str] = []
pass
class Intent(IntentBase):
id: int
input_patterns: list[InputPattern] = []
response_links: list[ResponseLink] = []
class Config:
orm_mode = True
class IntentResponse(IntentCreate):
id: int
class IntentTrainData(BaseModel):
tag: str
patterns: list[str] = []
class ChatResponse(BaseModel):
response_text: str
response_links: list[str] = []