maitai-python 1.0.0b0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- maitai/__init__.py +17 -0
- maitai/_config.py +69 -0
- maitai/_config_listener_thread.py +14 -0
- maitai/_evaluator.py +263 -0
- maitai/_inference.py +101 -0
- maitai/_maitai_client.py +34 -0
- maitai/_openai.py +334 -0
- maitai/_openai_types.py +13 -0
- maitai/_types.py +37 -0
- maitai/_utils.py +112 -0
- maitai_common/__init__.py +0 -0
- maitai_common/processes/__init__.py +0 -0
- maitai_common/processes/io_thread.py +62 -0
- maitai_common/processes/websocket_listener_thread.py +95 -0
- maitai_common/utils/__init__.py +0 -0
- maitai_common/utils/proto_utils.py +13 -0
- maitai_gen/__init__.py +0 -0
- maitai_gen/application/__init__.py +39 -0
- maitai_gen/chat/__init__.py +272 -0
- maitai_gen/company/__init__.py +21 -0
- maitai_gen/inference/__init__.py +19 -0
- maitai_gen/notification/__init__.py +34 -0
- maitai_gen/sandbox/__init__.py +43 -0
- maitai_gen/sentinel/__init__.py +47 -0
- maitai_gen/session/__init__.py +28 -0
- maitai_python-1.0.0b0.dist-info/METADATA +18 -0
- maitai_python-1.0.0b0.dist-info/RECORD +29 -0
- maitai_python-1.0.0b0.dist-info/WHEEL +5 -0
- maitai_python-1.0.0b0.dist-info/top_level.txt +3 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
2
|
+
# sources: application.proto
|
|
3
|
+
# plugin: python-betterproto
|
|
4
|
+
# This file has been @generated
|
|
5
|
+
|
|
6
|
+
from dataclasses import dataclass
|
|
7
|
+
from typing import Dict
|
|
8
|
+
|
|
9
|
+
import betterproto
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@dataclass(eq=False, repr=False)
|
|
13
|
+
class ApplicationObjective(betterproto.Message):
|
|
14
|
+
id: int = betterproto.int64_field(1)
|
|
15
|
+
date_created: int = betterproto.int64_field(2)
|
|
16
|
+
application_id: int = betterproto.int64_field(3)
|
|
17
|
+
objective_body: str = betterproto.string_field(4)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@dataclass(eq=False, repr=False)
|
|
21
|
+
class ApplicationContext(betterproto.Message):
|
|
22
|
+
id: int = betterproto.int64_field(1)
|
|
23
|
+
date_created: int = betterproto.int64_field(2)
|
|
24
|
+
application_id: int = betterproto.int64_field(3)
|
|
25
|
+
context_body: str = betterproto.string_field(4)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@dataclass(eq=False, repr=False)
|
|
29
|
+
class Application(betterproto.Message):
|
|
30
|
+
id: int = betterproto.int64_field(1)
|
|
31
|
+
date_created: int = betterproto.int64_field(2)
|
|
32
|
+
application_name: str = betterproto.string_field(3)
|
|
33
|
+
application_ref_name: str = betterproto.string_field(4)
|
|
34
|
+
company_id: int = betterproto.int64_field(5)
|
|
35
|
+
application_objective: "ApplicationObjective" = betterproto.message_field(6)
|
|
36
|
+
state: str = betterproto.string_field(7)
|
|
37
|
+
meta: Dict[str, str] = betterproto.map_field(
|
|
38
|
+
8, betterproto.TYPE_STRING, betterproto.TYPE_STRING
|
|
39
|
+
)
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
2
|
+
# sources: chat.proto
|
|
3
|
+
# plugin: python-betterproto
|
|
4
|
+
# This file has been @generated
|
|
5
|
+
|
|
6
|
+
from dataclasses import dataclass
|
|
7
|
+
from typing import (
|
|
8
|
+
TYPE_CHECKING,
|
|
9
|
+
Dict,
|
|
10
|
+
List,
|
|
11
|
+
Optional,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
import betterproto
|
|
15
|
+
import grpclib
|
|
16
|
+
from betterproto.grpc.grpclib_server import ServiceBase
|
|
17
|
+
|
|
18
|
+
from .. import sentinel as _sentinel__
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
if TYPE_CHECKING:
|
|
22
|
+
import grpclib.server
|
|
23
|
+
from betterproto.grpc.grpclib_client import MetadataLike
|
|
24
|
+
from grpclib.metadata import Deadline
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class EvaluationContentType(betterproto.Enum):
|
|
28
|
+
MESSAGE = 0
|
|
29
|
+
TEXT = 1
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
@dataclass(eq=False, repr=False)
|
|
33
|
+
class ChatCompletionRequest(betterproto.Message):
|
|
34
|
+
params: "ChatCompletionParams" = betterproto.message_field(1)
|
|
35
|
+
application_ref_name: str = betterproto.string_field(2)
|
|
36
|
+
session_id: str = betterproto.string_field(3)
|
|
37
|
+
reference_id: str = betterproto.string_field(4)
|
|
38
|
+
action_type: str = betterproto.string_field(5)
|
|
39
|
+
company_id: int = betterproto.int64_field(6)
|
|
40
|
+
apply_corrections: bool = betterproto.bool_field(7)
|
|
41
|
+
id: int = betterproto.int64_field(8)
|
|
42
|
+
date_created: int = betterproto.int64_field(9)
|
|
43
|
+
request_id: str = betterproto.string_field(10)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
@dataclass(eq=False, repr=False)
|
|
47
|
+
class ChatCompletionParams(betterproto.Message):
|
|
48
|
+
messages: List["ChatMessage"] = betterproto.message_field(1)
|
|
49
|
+
model: str = betterproto.string_field(2)
|
|
50
|
+
max_tokens: int = betterproto.int32_field(3)
|
|
51
|
+
response_format: "ResponseFormat" = betterproto.message_field(4)
|
|
52
|
+
temperature: float = betterproto.double_field(5)
|
|
53
|
+
top_p: float = betterproto.double_field(6)
|
|
54
|
+
stop: str = betterproto.string_field(7)
|
|
55
|
+
logprobs: List[float] = betterproto.double_field(8)
|
|
56
|
+
top_logprobs: int = betterproto.int32_field(9)
|
|
57
|
+
n: int = betterproto.int32_field(10)
|
|
58
|
+
seed: int = betterproto.int32_field(11)
|
|
59
|
+
stream: bool = betterproto.bool_field(12)
|
|
60
|
+
stream_options: "StreamOptions" = betterproto.message_field(13)
|
|
61
|
+
logit_bias: Dict[int, float] = betterproto.map_field(
|
|
62
|
+
14, betterproto.TYPE_INT64, betterproto.TYPE_DOUBLE
|
|
63
|
+
)
|
|
64
|
+
presence_penalty: float = betterproto.double_field(15)
|
|
65
|
+
frequency_penalty: float = betterproto.double_field(16)
|
|
66
|
+
user: str = betterproto.string_field(17)
|
|
67
|
+
tools: List["Tool"] = betterproto.message_field(18)
|
|
68
|
+
tool_choice: str = betterproto.string_field(19)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
@dataclass(eq=False, repr=False)
|
|
72
|
+
class ResponseFormat(betterproto.Message):
|
|
73
|
+
type: str = betterproto.string_field(1)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
@dataclass(eq=False, repr=False)
|
|
77
|
+
class StreamOptions(betterproto.Message):
|
|
78
|
+
include_usage: bool = betterproto.bool_field(1)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
@dataclass(eq=False, repr=False)
|
|
82
|
+
class Tool(betterproto.Message):
|
|
83
|
+
type: str = betterproto.string_field(1)
|
|
84
|
+
function: "Function" = betterproto.message_field(2)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
@dataclass(eq=False, repr=False)
|
|
88
|
+
class Function(betterproto.Message):
|
|
89
|
+
name: str = betterproto.string_field(1)
|
|
90
|
+
description: str = betterproto.string_field(2)
|
|
91
|
+
parameters: Dict[str, str] = betterproto.map_field(
|
|
92
|
+
3, betterproto.TYPE_STRING, betterproto.TYPE_STRING
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
@dataclass(eq=False, repr=False)
|
|
97
|
+
class ChatCompletionResponse(betterproto.Message):
|
|
98
|
+
id: str = betterproto.string_field(1)
|
|
99
|
+
response_id: int = betterproto.int64_field(2)
|
|
100
|
+
object: str = betterproto.string_field(3)
|
|
101
|
+
created: int = betterproto.int64_field(4)
|
|
102
|
+
model: str = betterproto.string_field(5)
|
|
103
|
+
system_fingerprint: str = betterproto.string_field(6)
|
|
104
|
+
choices: List["ChatCompletionChoice"] = betterproto.message_field(7)
|
|
105
|
+
usage: "ChatCompletionUsage" = betterproto.message_field(8)
|
|
106
|
+
request_id: str = betterproto.string_field(9)
|
|
107
|
+
original_choices: List["ChatCompletionChoice"] = betterproto.message_field(10)
|
|
108
|
+
evaluate_response: Optional["EvaluateResponse"] = betterproto.message_field(
|
|
109
|
+
11, optional=True, group="_evaluate_response"
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
@dataclass(eq=False, repr=False)
|
|
114
|
+
class ChatCompletionChoice(betterproto.Message):
|
|
115
|
+
index: int = betterproto.int32_field(1)
|
|
116
|
+
message: "ChatMessage" = betterproto.message_field(2)
|
|
117
|
+
logprobs: List[float] = betterproto.double_field(3)
|
|
118
|
+
finish_reason: str = betterproto.string_field(4)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
@dataclass(eq=False, repr=False)
|
|
122
|
+
class ChatMessage(betterproto.Message):
|
|
123
|
+
role: str = betterproto.string_field(1)
|
|
124
|
+
content: str = betterproto.string_field(2)
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
@dataclass(eq=False, repr=False)
|
|
128
|
+
class ChatCompletionUsage(betterproto.Message):
|
|
129
|
+
prompt_tokens: int = betterproto.int32_field(1)
|
|
130
|
+
completion_tokens: int = betterproto.int32_field(2)
|
|
131
|
+
total_tokens: int = betterproto.int32_field(3)
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
@dataclass(eq=False, repr=False)
|
|
135
|
+
class ChatCompletionChunk(betterproto.Message):
|
|
136
|
+
id: str = betterproto.string_field(1)
|
|
137
|
+
choices: List["Choice"] = betterproto.message_field(2)
|
|
138
|
+
created: int = betterproto.int64_field(3)
|
|
139
|
+
model: str = betterproto.string_field(4)
|
|
140
|
+
object: str = betterproto.string_field(5)
|
|
141
|
+
system_fingerprint: str = betterproto.string_field(6)
|
|
142
|
+
usage: "ChatCompletionUsage" = betterproto.message_field(7)
|
|
143
|
+
evaluate_response: Optional["EvaluateResponse"] = betterproto.message_field(
|
|
144
|
+
8, optional=True, group="_evaluate_response"
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
@dataclass(eq=False, repr=False)
|
|
149
|
+
class ChoiceDelta(betterproto.Message):
|
|
150
|
+
content: str = betterproto.string_field(1)
|
|
151
|
+
role: str = betterproto.string_field(3)
|
|
152
|
+
tool_calls: List["ToolCall"] = betterproto.message_field(4)
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
@dataclass(eq=False, repr=False)
|
|
156
|
+
class ToolCall(betterproto.Message):
|
|
157
|
+
id: str = betterproto.string_field(1)
|
|
158
|
+
type: str = betterproto.string_field(2)
|
|
159
|
+
function: "ToolCallFunction" = betterproto.message_field(3)
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
@dataclass(eq=False, repr=False)
|
|
163
|
+
class ToolCallFunction(betterproto.Message):
|
|
164
|
+
name: str = betterproto.string_field(1)
|
|
165
|
+
arguments: str = betterproto.string_field(2)
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
@dataclass(eq=False, repr=False)
|
|
169
|
+
class Choice(betterproto.Message):
|
|
170
|
+
delta: "ChoiceDelta" = betterproto.message_field(1)
|
|
171
|
+
finish_reason: str = betterproto.string_field(2)
|
|
172
|
+
index: int = betterproto.int32_field(3)
|
|
173
|
+
logprobs: List["LogProbs"] = betterproto.message_field(4)
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
@dataclass(eq=False, repr=False)
|
|
177
|
+
class LogProbs(betterproto.Message):
|
|
178
|
+
content: "LogPropsContent" = betterproto.message_field(1)
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
@dataclass(eq=False, repr=False)
|
|
182
|
+
class LogPropsContent(betterproto.Message):
|
|
183
|
+
token: str = betterproto.string_field(1)
|
|
184
|
+
logprob: float = betterproto.double_field(2)
|
|
185
|
+
bytes: List[int] = betterproto.int32_field(3)
|
|
186
|
+
top_logprobs: List["LogProbs"] = betterproto.message_field(4)
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
@dataclass(eq=False, repr=False)
|
|
190
|
+
class EvaluateRequest(betterproto.Message):
|
|
191
|
+
id: int = betterproto.int64_field(1)
|
|
192
|
+
date_created: int = betterproto.int64_field(2)
|
|
193
|
+
application_id: int = betterproto.int64_field(3)
|
|
194
|
+
application_ref_name: str = betterproto.string_field(4)
|
|
195
|
+
session_id: str = betterproto.string_field(5)
|
|
196
|
+
reference_id: str = betterproto.string_field(6)
|
|
197
|
+
action_type: str = betterproto.string_field(7)
|
|
198
|
+
evaluation_content_type: "EvaluationContentType" = betterproto.enum_field(8)
|
|
199
|
+
eval_results_set: "EvaluateResponse" = betterproto.message_field(10)
|
|
200
|
+
company_id: int = betterproto.int64_field(11)
|
|
201
|
+
evaluation_context: str = betterproto.string_field(13)
|
|
202
|
+
text_content: str = betterproto.string_field(9)
|
|
203
|
+
message_content: List["ChatMessage"] = betterproto.message_field(12)
|
|
204
|
+
request_id: str = betterproto.string_field(14)
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
@dataclass(eq=False, repr=False)
|
|
208
|
+
class EvaluateResult(betterproto.Message):
|
|
209
|
+
id: int = betterproto.int64_field(1)
|
|
210
|
+
status: str = betterproto.string_field(2)
|
|
211
|
+
description: str = betterproto.string_field(3)
|
|
212
|
+
confidence: float = betterproto.double_field(4)
|
|
213
|
+
meta: Dict[str, str] = betterproto.map_field(
|
|
214
|
+
5, betterproto.TYPE_STRING, betterproto.TYPE_STRING
|
|
215
|
+
)
|
|
216
|
+
sentinel_id: int = betterproto.int64_field(6)
|
|
217
|
+
eval_time: int = betterproto.int64_field(7)
|
|
218
|
+
sentinel: "_sentinel__.Sentinel" = betterproto.message_field(8)
|
|
219
|
+
date_created: int = betterproto.int64_field(9)
|
|
220
|
+
usage: "ChatCompletionUsage" = betterproto.message_field(10)
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
@dataclass(eq=False, repr=False)
|
|
224
|
+
class EvaluateResponse(betterproto.Message):
|
|
225
|
+
application_id: int = betterproto.int64_field(3)
|
|
226
|
+
session_id: str = betterproto.string_field(4)
|
|
227
|
+
request_id: int = betterproto.int64_field(5)
|
|
228
|
+
evaluation_results: List["EvaluateResult"] = betterproto.message_field(6)
|
|
229
|
+
evaluation_request_id: str = betterproto.string_field(7)
|
|
230
|
+
evaluation_request: "EvaluateRequest" = betterproto.message_field(8)
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
class EvaluationServiceStub(betterproto.ServiceStub):
|
|
234
|
+
async def evaluate(
|
|
235
|
+
self,
|
|
236
|
+
evaluate_request: "EvaluateRequest",
|
|
237
|
+
*,
|
|
238
|
+
timeout: Optional[float] = None,
|
|
239
|
+
deadline: Optional["Deadline"] = None,
|
|
240
|
+
metadata: Optional["MetadataLike"] = None
|
|
241
|
+
) -> "EvaluateResponse":
|
|
242
|
+
return await self._unary_unary(
|
|
243
|
+
"/chat.EvaluationService/Evaluate",
|
|
244
|
+
evaluate_request,
|
|
245
|
+
EvaluateResponse,
|
|
246
|
+
timeout=timeout,
|
|
247
|
+
deadline=deadline,
|
|
248
|
+
metadata=metadata,
|
|
249
|
+
)
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
class EvaluationServiceBase(ServiceBase):
|
|
253
|
+
|
|
254
|
+
async def evaluate(self, evaluate_request: "EvaluateRequest") -> "EvaluateResponse":
|
|
255
|
+
raise grpclib.GRPCError(grpclib.const.Status.UNIMPLEMENTED)
|
|
256
|
+
|
|
257
|
+
async def __rpc_evaluate(
|
|
258
|
+
self, stream: "grpclib.server.Stream[EvaluateRequest, EvaluateResponse]"
|
|
259
|
+
) -> None:
|
|
260
|
+
request = await stream.recv_message()
|
|
261
|
+
response = await self.evaluate(request)
|
|
262
|
+
await stream.send_message(response)
|
|
263
|
+
|
|
264
|
+
def __mapping__(self) -> Dict[str, grpclib.const.Handler]:
|
|
265
|
+
return {
|
|
266
|
+
"/chat.EvaluationService/Evaluate": grpclib.const.Handler(
|
|
267
|
+
self.__rpc_evaluate,
|
|
268
|
+
grpclib.const.Cardinality.UNARY_UNARY,
|
|
269
|
+
EvaluateRequest,
|
|
270
|
+
EvaluateResponse,
|
|
271
|
+
),
|
|
272
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
2
|
+
# sources: company.proto
|
|
3
|
+
# plugin: python-betterproto
|
|
4
|
+
# This file has been @generated
|
|
5
|
+
|
|
6
|
+
from dataclasses import dataclass
|
|
7
|
+
from typing import Dict
|
|
8
|
+
|
|
9
|
+
import betterproto
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@dataclass(eq=False, repr=False)
|
|
13
|
+
class Company(betterproto.Message):
|
|
14
|
+
id: int = betterproto.int64_field(1)
|
|
15
|
+
date_created: int = betterproto.int64_field(2)
|
|
16
|
+
company_name: str = betterproto.string_field(3)
|
|
17
|
+
url: str = betterproto.string_field(4)
|
|
18
|
+
log: str = betterproto.string_field(5)
|
|
19
|
+
meta: Dict[str, str] = betterproto.map_field(
|
|
20
|
+
6, betterproto.TYPE_STRING, betterproto.TYPE_STRING
|
|
21
|
+
)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
2
|
+
# sources: inference.proto
|
|
3
|
+
# plugin: python-betterproto
|
|
4
|
+
# This file has been @generated
|
|
5
|
+
|
|
6
|
+
from dataclasses import dataclass
|
|
7
|
+
|
|
8
|
+
import betterproto
|
|
9
|
+
|
|
10
|
+
from .. import chat as _chat__
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@dataclass(eq=False, repr=False)
|
|
14
|
+
class InferenceStreamResponse(betterproto.Message):
|
|
15
|
+
chat_completion_chunk: "_chat__.ChatCompletionChunk" = betterproto.message_field(1)
|
|
16
|
+
chat_completion_response: "_chat__.ChatCompletionResponse" = (
|
|
17
|
+
betterproto.message_field(2)
|
|
18
|
+
)
|
|
19
|
+
evaluate_response: "_chat__.EvaluateResponse" = betterproto.message_field(3)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
2
|
+
# sources: notification.proto
|
|
3
|
+
# plugin: python-betterproto
|
|
4
|
+
# This file has been @generated
|
|
5
|
+
|
|
6
|
+
from dataclasses import dataclass
|
|
7
|
+
from typing import Dict
|
|
8
|
+
|
|
9
|
+
import betterproto
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@dataclass(eq=False, repr=False)
|
|
13
|
+
class Notification(betterproto.Message):
|
|
14
|
+
id: int = betterproto.int64_field(1)
|
|
15
|
+
date_created: int = betterproto.int64_field(2)
|
|
16
|
+
company_id: int = betterproto.int64_field(3)
|
|
17
|
+
evaluation_request_id: int = betterproto.int64_field(4)
|
|
18
|
+
evaluation_results_id: int = betterproto.int64_field(5)
|
|
19
|
+
notification_id: int = betterproto.int64_field(6)
|
|
20
|
+
meta: Dict[str, str] = betterproto.map_field(
|
|
21
|
+
7, betterproto.TYPE_STRING, betterproto.TYPE_STRING
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@dataclass(eq=False, repr=False)
|
|
26
|
+
class NotificationInteraction(betterproto.Message):
|
|
27
|
+
id: int = betterproto.int64_field(1)
|
|
28
|
+
date_created: int = betterproto.int64_field(2)
|
|
29
|
+
notification_id: int = betterproto.int64_field(3)
|
|
30
|
+
interaction_type: str = betterproto.string_field(4)
|
|
31
|
+
interaction_value: str = betterproto.string_field(5)
|
|
32
|
+
meta: Dict[str, str] = betterproto.map_field(
|
|
33
|
+
6, betterproto.TYPE_STRING, betterproto.TYPE_STRING
|
|
34
|
+
)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
2
|
+
# sources: sandbox.proto
|
|
3
|
+
# plugin: python-betterproto
|
|
4
|
+
# This file has been @generated
|
|
5
|
+
|
|
6
|
+
from dataclasses import dataclass
|
|
7
|
+
from typing import (
|
|
8
|
+
Dict,
|
|
9
|
+
List,
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
import betterproto
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@dataclass(eq=False, repr=False)
|
|
16
|
+
class SandboxApplication(betterproto.Message):
|
|
17
|
+
id: int = betterproto.int64_field(1)
|
|
18
|
+
company_id: int = betterproto.int64_field(2)
|
|
19
|
+
sandbox_application_name: str = betterproto.string_field(3)
|
|
20
|
+
date_created: int = betterproto.int64_field(4)
|
|
21
|
+
sandbox_application_prompt: str = betterproto.string_field(5)
|
|
22
|
+
sandbox_sessions: List["SandboxSession"] = betterproto.message_field(6)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@dataclass(eq=False, repr=False)
|
|
26
|
+
class SandboxSession(betterproto.Message):
|
|
27
|
+
id: int = betterproto.int64_field(1)
|
|
28
|
+
token: str = betterproto.string_field(2)
|
|
29
|
+
sandbox_application_id: int = betterproto.int64_field(3)
|
|
30
|
+
date_created: int = betterproto.int64_field(4)
|
|
31
|
+
sandbox_messages: List["SandboxMessage"] = betterproto.message_field(5)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
@dataclass(eq=False, repr=False)
|
|
35
|
+
class SandboxMessage(betterproto.Message):
|
|
36
|
+
id: int = betterproto.int64_field(1)
|
|
37
|
+
sandbox_session_id: int = betterproto.int64_field(2)
|
|
38
|
+
date_created: int = betterproto.int64_field(3)
|
|
39
|
+
sender: str = betterproto.string_field(4)
|
|
40
|
+
message: str = betterproto.string_field(5)
|
|
41
|
+
meta: Dict[str, str] = betterproto.map_field(
|
|
42
|
+
6, betterproto.TYPE_STRING, betterproto.TYPE_STRING
|
|
43
|
+
)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
2
|
+
# sources: sentinel.proto
|
|
3
|
+
# plugin: python-betterproto
|
|
4
|
+
# This file has been @generated
|
|
5
|
+
|
|
6
|
+
from dataclasses import dataclass
|
|
7
|
+
from typing import (
|
|
8
|
+
Dict,
|
|
9
|
+
List,
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
import betterproto
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@dataclass(eq=False, repr=False)
|
|
16
|
+
class Sentinel(betterproto.Message):
|
|
17
|
+
id: int = betterproto.int64_field(1)
|
|
18
|
+
application_id: int = betterproto.int64_field(2)
|
|
19
|
+
sentinel_name: str = betterproto.string_field(3)
|
|
20
|
+
date_created: int = betterproto.int64_field(4)
|
|
21
|
+
sentinel_directive: "SentinelDirective" = betterproto.message_field(5)
|
|
22
|
+
state: str = betterproto.string_field(6)
|
|
23
|
+
action_types: List[str] = betterproto.string_field(7)
|
|
24
|
+
severity: int = betterproto.int64_field(8)
|
|
25
|
+
meta: Dict[str, str] = betterproto.map_field(
|
|
26
|
+
9, betterproto.TYPE_STRING, betterproto.TYPE_STRING
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@dataclass(eq=False, repr=False)
|
|
31
|
+
class SentinelDirective(betterproto.Message):
|
|
32
|
+
id: int = betterproto.int64_field(1)
|
|
33
|
+
sentinel_id: int = betterproto.int64_field(2)
|
|
34
|
+
date_created: int = betterproto.int64_field(3)
|
|
35
|
+
directive_body: "DirectiveBody" = betterproto.message_field(4)
|
|
36
|
+
examples: List["SentinelExample"] = betterproto.message_field(5)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
@dataclass(eq=False, repr=False)
|
|
40
|
+
class DirectiveBody(betterproto.Message):
|
|
41
|
+
main: str = betterproto.string_field(1)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
@dataclass(eq=False, repr=False)
|
|
45
|
+
class SentinelExample(betterproto.Message):
|
|
46
|
+
example_type: str = betterproto.string_field(1)
|
|
47
|
+
example_body: str = betterproto.string_field(2)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
2
|
+
# sources: session.proto
|
|
3
|
+
# plugin: python-betterproto
|
|
4
|
+
# This file has been @generated
|
|
5
|
+
|
|
6
|
+
from dataclasses import dataclass
|
|
7
|
+
from typing import List
|
|
8
|
+
|
|
9
|
+
import betterproto
|
|
10
|
+
|
|
11
|
+
from .. import chat as _chat__
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@dataclass(eq=False, repr=False)
|
|
15
|
+
class Session(betterproto.Message):
|
|
16
|
+
session_id: int = betterproto.int64_field(1)
|
|
17
|
+
date_created: int = betterproto.int64_field(2)
|
|
18
|
+
application_id: int = betterproto.int64_field(3)
|
|
19
|
+
eval_requests: List["_chat__.EvaluateRequest"] = betterproto.message_field(4)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@dataclass(eq=False, repr=False)
|
|
23
|
+
class SessionContext(betterproto.Message):
|
|
24
|
+
id: int = betterproto.int64_field(1)
|
|
25
|
+
application_id: int = betterproto.int64_field(2)
|
|
26
|
+
session_id: int = betterproto.int64_field(3)
|
|
27
|
+
date_created: int = betterproto.int64_field(4)
|
|
28
|
+
context_body: str = betterproto.string_field(5)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: maitai-python
|
|
3
|
+
Version: 1.0.0b0
|
|
4
|
+
Summary: MaiTai SDK for Python
|
|
5
|
+
Home-page: https://docs.trymaitai.ai
|
|
6
|
+
Author: Maitai
|
|
7
|
+
Author-email: support@trymaitai.ai
|
|
8
|
+
License: MIT
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Requires-Dist: requests
|
|
12
|
+
Requires-Dist: openai
|
|
13
|
+
Requires-Dist: betterproto
|
|
14
|
+
Requires-Dist: httpx
|
|
15
|
+
Requires-Dist: aiohttp
|
|
16
|
+
Requires-Dist: setuptools
|
|
17
|
+
Requires-Dist: websocket-client
|
|
18
|
+
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
maitai/__init__.py,sha256=4Oq7ihBKSMOdPmvJRlp_AdWXfJ2TvTJe_Mji471r9Tk,459
|
|
2
|
+
maitai/_config.py,sha256=vIEc57aNF7FsZnfFPkrm3qN_tPpRCyoLaI4-ECjf4F0,2249
|
|
3
|
+
maitai/_config_listener_thread.py,sha256=Wg8dh5K8ubmZMZJ3RWdtenGCFnhR0B5gzpqhhnMy6kM,495
|
|
4
|
+
maitai/_evaluator.py,sha256=8dWGcVVKzTDpIiAFTF4FzX4Ec1gf-_7c8br-CbijP18,12978
|
|
5
|
+
maitai/_inference.py,sha256=XWBb-T6aJcqtNkqo5GusA9hGKTfiq2l4it8rapxQJLE,4659
|
|
6
|
+
maitai/_maitai_client.py,sha256=s-OkiBAhDND2DpcUqvnfXiv_VAfnHk5FFwThJVbyz-w,1135
|
|
7
|
+
maitai/_openai.py,sha256=C8K1PygwkQMSo3ziz5dw0c4hKDMkhCNOByW4rNq-DsE,16039
|
|
8
|
+
maitai/_openai_types.py,sha256=8OrDnYca0PSU4ICYeB0DGkVIV-sAh89_zRcJPu8h_i0,236
|
|
9
|
+
maitai/_types.py,sha256=yQ2bfyAlxOGWoXAosTYH1r4BcqkBdeZQNjWoq9r1DOs,1307
|
|
10
|
+
maitai/_utils.py,sha256=tFdgjRxaskbRNQXSK_rZmmLF_IiF9ELLTdH0Hmm3kuM,4243
|
|
11
|
+
maitai_common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
|
+
maitai_common/processes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
|
+
maitai_common/processes/io_thread.py,sha256=vmI-T11Fz9SO2wbIepgChG6lnii39IMSOQb5096pXS4,1977
|
|
14
|
+
maitai_common/processes/websocket_listener_thread.py,sha256=gJg838HnG7QGki0CtNM1m86bQWBgtvL1rnCGrCRStGQ,3392
|
|
15
|
+
maitai_common/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
|
+
maitai_common/utils/proto_utils.py,sha256=MhJx_exWOIrroS13UDvmSon_AAJ0O6kbJ_5QApJBtWI,407
|
|
17
|
+
maitai_gen/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
|
+
maitai_gen/application/__init__.py,sha256=VLSzeOJinN_lJTDQT6pc52vauQF-GN3DB4QWZckC1XE,1364
|
|
19
|
+
maitai_gen/chat/__init__.py,sha256=zAkFhey37vUHvAqQzgT4kTChk7hjQlMFWZgFBy9Ngl4,9847
|
|
20
|
+
maitai_gen/company/__init__.py,sha256=AuGIsQJzcxnkZZl5-4wEr1zWeI4d4fMXrASBu-OuXG0,641
|
|
21
|
+
maitai_gen/inference/__init__.py,sha256=pn77lTsfX9JlEwEFTEVKFAdsbnmXS_o0jzYn20SIL1k,600
|
|
22
|
+
maitai_gen/notification/__init__.py,sha256=2WaCP-EwmiPDkneJyGJnB1fpgriukmjHH2ZPgH-1XK0,1198
|
|
23
|
+
maitai_gen/sandbox/__init__.py,sha256=fX4BSSo_Qbkh4jhk56E9r5SxO44XmwGh4O3OZCAcKtI,1460
|
|
24
|
+
maitai_gen/sentinel/__init__.py,sha256=hWwzr0izFZ1qS6zhWo2ZuPS5bBCeLjxBcpamF3Xmbho,1518
|
|
25
|
+
maitai_gen/session/__init__.py,sha256=riq0bcNozstLBCkAUmcNAj6RyX7gP5IIFcBO6CLSwqA,886
|
|
26
|
+
maitai_python-1.0.0b0.dist-info/METADATA,sha256=pRjbN5TTdZYw1HOV8kGmw5Hh95pQrPtpXjXj8YGapcw,465
|
|
27
|
+
maitai_python-1.0.0b0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
28
|
+
maitai_python-1.0.0b0.dist-info/top_level.txt,sha256=-5U1krxnwlqB-AY7nEe29ZcNvwByNc-SnBe-mph-QjI,32
|
|
29
|
+
maitai_python-1.0.0b0.dist-info/RECORD,,
|