maitai-python 1.0.27b0__tar.gz → 1.0.28b0__tar.gz
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_python-1.0.27b0 → maitai_python-1.0.28b0}/PKG-INFO +1 -1
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai/_openai.py +2 -0
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai/_openai_async.py +2 -0
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai_common/config/config_service.py +1 -8
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai_common/version.py +1 -1
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai_gen/chat/__init__.py +11 -0
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai_gen/config/__init__.py +1 -0
- maitai_python-1.0.28b0/maitai_gen/embedding/__init__.py +25 -0
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai_gen/sentinel/__init__.py +1 -0
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai_gen/session/__init__.py +2 -1
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai_python.egg-info/PKG-INFO +1 -1
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai_python.egg-info/SOURCES.txt +1 -0
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/README.md +0 -0
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai/__init__.py +0 -0
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai/_azure.py +0 -0
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai/_config.py +0 -0
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai/_config_listener_thread.py +0 -0
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai/_evaluator.py +0 -0
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai/_inference.py +0 -0
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai/_maitai_client.py +0 -0
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai/_openai_types.py +0 -0
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai/_utils.py +0 -0
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai_common/__init__.py +0 -0
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai_common/config/__init__.py +0 -0
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai_common/processes/__init__.py +0 -0
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai_common/processes/io_thread.py +0 -0
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai_common/processes/websocket_listener_thread.py +0 -0
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai_common/utils/__init__.py +0 -0
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai_common/utils/proto_utils.py +0 -0
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai_common/utils/types.py +0 -0
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai_gen/__init__.py +0 -0
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai_gen/application/__init__.py +0 -0
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai_gen/company/__init__.py +0 -0
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai_gen/inference/__init__.py +0 -0
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai_gen/key/__init__.py +0 -0
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai_gen/notification/__init__.py +0 -0
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai_gen/sandbox/__init__.py +0 -0
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai_python.egg-info/dependency_links.txt +0 -0
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai_python.egg-info/requires.txt +0 -0
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai_python.egg-info/top_level.txt +0 -0
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/setup.cfg +0 -0
- {maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/setup.py +0 -0
|
@@ -153,6 +153,8 @@ class Completions:
|
|
|
153
153
|
frequency_penalty = maitai_config.frequency_penalty
|
|
154
154
|
if presence_penalty == openai.NOT_GIVEN:
|
|
155
155
|
presence_penalty = maitai_config.presence_penalty
|
|
156
|
+
if timeout == openai.NOT_GIVEN and maitai_config.timeout > 0:
|
|
157
|
+
timeout = maitai_config.timeout
|
|
156
158
|
if stream_options == openai.NOT_GIVEN and stream:
|
|
157
159
|
stream_options = ChatCompletionStreamOptionsParam(include_usage=True)
|
|
158
160
|
completion_params = get_chat_completion_params(
|
|
@@ -158,6 +158,8 @@ class AsyncCompletions:
|
|
|
158
158
|
frequency_penalty = maitai_config.frequency_penalty
|
|
159
159
|
if presence_penalty == openai.NOT_GIVEN:
|
|
160
160
|
presence_penalty = maitai_config.presence_penalty
|
|
161
|
+
if timeout == openai.NOT_GIVEN and maitai_config.timeout > 0:
|
|
162
|
+
timeout = maitai_config.timeout
|
|
161
163
|
if stream_options == openai.NOT_GIVEN and stream:
|
|
162
164
|
stream_options = ChatCompletionStreamOptionsParam(include_usage=True)
|
|
163
165
|
|
|
@@ -16,20 +16,12 @@ MODELS = {
|
|
|
16
16
|
"gpt-4-0125-preview": "openai",
|
|
17
17
|
"gpt-4-turbo-preview": "openai",
|
|
18
18
|
"gpt-4-1106-preview": "openai",
|
|
19
|
-
"gpt-4-vision-preview": "openai",
|
|
20
19
|
"gpt-4": "openai",
|
|
21
|
-
"gpt-4-0314": "openai",
|
|
22
20
|
"gpt-4-0613": "openai",
|
|
23
|
-
"gpt-4-32k": "openai",
|
|
24
|
-
"gpt-4-32k-0314": "openai",
|
|
25
|
-
"gpt-4-32k-0613": "openai",
|
|
26
21
|
"gpt-3.5-turbo": "openai",
|
|
27
22
|
"gpt-3.5-turbo-16k": "openai",
|
|
28
|
-
"gpt-3.5-turbo-0301": "openai",
|
|
29
|
-
"gpt-3.5-turbo-0613": "openai",
|
|
30
23
|
"gpt-3.5-turbo-1106": "openai",
|
|
31
24
|
"gpt-3.5-turbo-0125": "openai",
|
|
32
|
-
"gpt-3.5-turbo-16k-0613": "openai",
|
|
33
25
|
}
|
|
34
26
|
|
|
35
27
|
DEFAULT_CLIENT_MODEL = "gpt-4o"
|
|
@@ -51,6 +43,7 @@ def get_default_config() -> Config:
|
|
|
51
43
|
n=1,
|
|
52
44
|
frequency_penalty=0,
|
|
53
45
|
presence_penalty=0,
|
|
46
|
+
timeout=-1,
|
|
54
47
|
)
|
|
55
48
|
|
|
56
49
|
|
|
@@ -57,6 +57,7 @@ class ChatCompletionRequest(betterproto.Message):
|
|
|
57
57
|
return_evaluation: bool = betterproto.bool_field(13)
|
|
58
58
|
error: str = betterproto.string_field(14)
|
|
59
59
|
auth_keys: "_key__.KeyMap" = betterproto.message_field(15)
|
|
60
|
+
inference_location: str = betterproto.string_field(16)
|
|
60
61
|
|
|
61
62
|
|
|
62
63
|
@dataclass(eq=False, repr=False)
|
|
@@ -131,6 +132,8 @@ class ChatCompletionResponse(betterproto.Message):
|
|
|
131
132
|
11, optional=True, group="_evaluate_response"
|
|
132
133
|
)
|
|
133
134
|
correction_applied: bool = betterproto.bool_field(12)
|
|
135
|
+
first_token_time: int = betterproto.int64_field(13)
|
|
136
|
+
response_time: int = betterproto.int64_field(14)
|
|
134
137
|
|
|
135
138
|
|
|
136
139
|
@dataclass(eq=False, repr=False)
|
|
@@ -153,6 +156,7 @@ class ChatCompletionUsage(betterproto.Message):
|
|
|
153
156
|
prompt_tokens: int = betterproto.int32_field(1)
|
|
154
157
|
completion_tokens: int = betterproto.int32_field(2)
|
|
155
158
|
total_tokens: int = betterproto.int32_field(3)
|
|
159
|
+
cost: int = betterproto.int64_field(4)
|
|
156
160
|
|
|
157
161
|
|
|
158
162
|
@dataclass(eq=False, repr=False)
|
|
@@ -276,6 +280,13 @@ class EvaluateResponse(betterproto.Message):
|
|
|
276
280
|
evaluation_time: int = betterproto.int64_field(10)
|
|
277
281
|
|
|
278
282
|
|
|
283
|
+
@dataclass(eq=False, repr=False)
|
|
284
|
+
class Turn(betterproto.Message):
|
|
285
|
+
request: "ChatCompletionRequest" = betterproto.message_field(1)
|
|
286
|
+
response: "ChatCompletionResponse" = betterproto.message_field(2)
|
|
287
|
+
eval_request: "EvaluateRequest" = betterproto.message_field(3)
|
|
288
|
+
|
|
289
|
+
|
|
279
290
|
class EvaluationServiceStub(betterproto.ServiceStub):
|
|
280
291
|
async def evaluate(
|
|
281
292
|
self,
|
|
@@ -34,6 +34,7 @@ class Config(betterproto.Message):
|
|
|
34
34
|
n: int = betterproto.int64_field(11)
|
|
35
35
|
presence_penalty: float = betterproto.double_field(15)
|
|
36
36
|
frequency_penalty: float = betterproto.double_field(16)
|
|
37
|
+
timeout: float = betterproto.double_field(17)
|
|
37
38
|
|
|
38
39
|
|
|
39
40
|
@dataclass(eq=False, repr=False)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
2
|
+
# sources: embedding.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
|
+
|
|
12
|
+
@dataclass(eq=False, repr=False)
|
|
13
|
+
class ApplicationContextEmbeddingChunk(betterproto.Message):
|
|
14
|
+
id: int = betterproto.int64_field(1)
|
|
15
|
+
text: str = betterproto.string_field(2)
|
|
16
|
+
path: str = betterproto.string_field(3)
|
|
17
|
+
pos_start: int = betterproto.int64_field(4)
|
|
18
|
+
pos_end: int = betterproto.int64_field(5)
|
|
19
|
+
size: int = betterproto.int64_field(6)
|
|
20
|
+
application_context_id: int = betterproto.int64_field(7)
|
|
21
|
+
embedding: List[float] = betterproto.float_field(8)
|
|
22
|
+
parent_id: int = betterproto.int64_field(9)
|
|
23
|
+
children: List["ApplicationContextEmbeddingChunk"] = betterproto.message_field(10)
|
|
24
|
+
application_id: int = betterproto.int64_field(11)
|
|
25
|
+
score: float = betterproto.float_field(12)
|
|
@@ -26,7 +26,6 @@ class Session(betterproto.Message):
|
|
|
26
26
|
session_id: str = betterproto.string_field(1)
|
|
27
27
|
date_created: int = betterproto.int64_field(2)
|
|
28
28
|
application_id: int = betterproto.int64_field(3)
|
|
29
|
-
eval_requests: List["_chat__.EvaluateRequest"] = betterproto.message_field(4)
|
|
30
29
|
application_name: Optional[str] = betterproto.string_field(
|
|
31
30
|
5, optional=True, group="_application_name"
|
|
32
31
|
)
|
|
@@ -41,6 +40,8 @@ class Session(betterproto.Message):
|
|
|
41
40
|
meta: Dict[str, str] = betterproto.map_field(
|
|
42
41
|
12, betterproto.TYPE_STRING, betterproto.TYPE_STRING
|
|
43
42
|
)
|
|
43
|
+
timeline: List["_chat__.Turn"] = betterproto.message_field(13)
|
|
44
|
+
cost: int = betterproto.int64_field(14)
|
|
44
45
|
|
|
45
46
|
|
|
46
47
|
@dataclass(eq=False, repr=False)
|
|
@@ -26,6 +26,7 @@ maitai_gen/application/__init__.py
|
|
|
26
26
|
maitai_gen/chat/__init__.py
|
|
27
27
|
maitai_gen/company/__init__.py
|
|
28
28
|
maitai_gen/config/__init__.py
|
|
29
|
+
maitai_gen/embedding/__init__.py
|
|
29
30
|
maitai_gen/inference/__init__.py
|
|
30
31
|
maitai_gen/key/__init__.py
|
|
31
32
|
maitai_gen/notification/__init__.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{maitai_python-1.0.27b0 → maitai_python-1.0.28b0}/maitai_python.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|