-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschemas.py
149 lines (89 loc) · 1.93 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
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
from pydantic import BaseModel
from typing import Optional
class PatternBase(BaseModel):
text: str
class Config:
orm_mode = True
class PatternCreate(PatternBase):
pass
class Pattern(PatternBase):
id: int
intent_id: int
class Config:
orm_mode = True
class ResponseBase(BaseModel):
text: str
class Config:
orm_mode = True
class ResponseCreate(ResponseBase):
pass
class Response(ResponseBase):
id: int
intent_id: int
class Config:
orm_mode = True
class IntentBase(BaseModel):
tag: str
patterns: list[PatternCreate]
responses: list[ResponseCreate]
class IntentCreate(IntentBase):
pass
class Intent(IntentBase):
id: int
class Config:
orm_mode = True
class NPCBase(BaseModel):
name: str
avatar: Optional[str] = None
bio: str
voice: str
style: str
intents: list[Intent] = []
class NPCCreate(NPCBase):
pass
class NPC(NPCBase):
id: int
class Config:
orm_mode = True
class AvatarUpdate(BaseModel):
avatar: str
class ProjectBase(BaseModel):
name: str
description: str
class ProjectCreate(ProjectBase):
pass
class Project(ProjectBase):
id: int
user_id: int
npcs: list[NPC] = []
class Config:
orm_mode = True
class UserBase(BaseModel):
email: str
class UserCreate(UserBase):
password: str
class User(UserBase):
id: int
projects: list[Project] = []
class Config:
orm_mode = True
class NPCIntentBase(BaseModel):
pass
class NPCIntentCreate(NPCIntentBase):
pass
class NPCIntent(NPCIntentBase):
id: int
npc_id: int
intent_id: int
class Config:
orm_mode = True
class ProjectNPCBase(BaseModel):
pass
class ProjectNPCCreate(ProjectNPCBase):
pass
class ProjectNPC(ProjectNPCBase):
id: int
project_id: int
npc_id: int
class Config:
orm_mode = True