maitai-python 1.1.46__tar.gz → 1.2.1__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.1.46 → maitai_python-1.2.1}/PKG-INFO +1 -2
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai/__init__.py +4 -8
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai/_maitai.py +5 -1
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai/_maitai_async.py +8 -1
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai_common/version.py +1 -1
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai_gen/evaluation/__init__.py +13 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai_gen/finetuning/__init__.py +13 -8
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai_python.egg-info/PKG-INFO +1 -2
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai_python.egg-info/requires.txt +0 -1
- {maitai_python-1.1.46 → maitai_python-1.2.1}/setup.py +0 -1
- {maitai_python-1.1.46 → maitai_python-1.2.1}/README.md +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai/_azure.py +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai/_config.py +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai/_config_listener_thread.py +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai/_context.py +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai/_evaluator.py +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai/_inference.py +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai/_maitai_client.py +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai/_types.py +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai/_utils.py +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai/tools/__init__.py +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai_common/__init__.py +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai_common/config/__init__.py +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai_common/config/config_service.py +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai_common/processes/__init__.py +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai_common/processes/io_thread.py +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai_common/processes/websocket_listener_thread.py +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai_gen/__init__.py +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai_gen/application/__init__.py +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai_gen/backtest/__init__.py +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai_gen/billing/__init__.py +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai_gen/chat/__init__.py +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai_gen/company/__init__.py +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai_gen/config/__init__.py +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai_gen/embedding/__init__.py +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai_gen/event/__init__.py +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai_gen/inference/__init__.py +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai_gen/key/__init__.py +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai_gen/metric/__init__.py +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai_gen/model.py +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai_gen/notification/__init__.py +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai_gen/rates/__init__.py +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai_gen/sandbox/__init__.py +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai_gen/sentinel/__init__.py +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai_gen/session/__init__.py +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai_python.egg-info/SOURCES.txt +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai_python.egg-info/dependency_links.txt +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/maitai_python.egg-info/top_level.txt +0 -0
- {maitai_python-1.1.46 → maitai_python-1.2.1}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: maitai-python
|
|
3
|
-
Version: 1.1
|
|
3
|
+
Version: 1.2.1
|
|
4
4
|
Summary: Maitai SDK for Python
|
|
5
5
|
Home-page: https://docs.trymaitai.ai
|
|
6
6
|
Author: Maitai
|
|
@@ -11,7 +11,6 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
11
11
|
Description-Content-Type: text/markdown
|
|
12
12
|
Requires-Dist: requests
|
|
13
13
|
Requires-Dist: openai>=1.34.0
|
|
14
|
-
Requires-Dist: betterproto
|
|
15
14
|
Requires-Dist: httpx
|
|
16
15
|
Requires-Dist: aiohttp
|
|
17
16
|
Requires-Dist: betterproto==2.0.0b7
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import os
|
|
2
2
|
|
|
3
|
-
from maitai._azure import
|
|
4
|
-
MaitaiAsyncAzureOpenAIClient as AsyncAzureOpenAI,
|
|
5
|
-
MaitaiAzureOpenAIClient as AzureOpenAI,
|
|
6
|
-
)
|
|
3
|
+
from maitai._azure import MaitaiAsyncAzureOpenAIClient, MaitaiAzureOpenAIClient
|
|
7
4
|
from maitai._context import ContextManager
|
|
8
5
|
from maitai._evaluator import Evaluator as Evaluator
|
|
9
6
|
from maitai._inference import Inference as Inference
|
|
@@ -15,12 +12,11 @@ context = ContextManager()
|
|
|
15
12
|
AsyncOpenAI = MaitaiAsync
|
|
16
13
|
OpenAI = Maitai
|
|
17
14
|
|
|
15
|
+
AsyncAzureOpenAI = MaitaiAsyncAzureOpenAIClient
|
|
16
|
+
AzureOpenAI = MaitaiAzureOpenAIClient
|
|
17
|
+
|
|
18
18
|
|
|
19
19
|
def initialize(api_key):
|
|
20
20
|
from maitai._config import config
|
|
21
21
|
|
|
22
22
|
config.initialize(api_key)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if os.environ.get("MAITAI_API_KEY") and os.environ.get("MAITAI_ENV") != "development":
|
|
26
|
-
initialize(os.environ.get("MAITAI_API_KEY"))
|
|
@@ -66,6 +66,10 @@ class Maitai:
|
|
|
66
66
|
maitai_api_key = os.environ.get("MAITAI_API_KEY")
|
|
67
67
|
if maitai_api_key:
|
|
68
68
|
config.initialize(maitai_api_key)
|
|
69
|
+
else:
|
|
70
|
+
raise ValueError(
|
|
71
|
+
"MAITAI_API_KEY has not been set. Either set via environment variable or pass it directly into the client."
|
|
72
|
+
)
|
|
69
73
|
if api_key:
|
|
70
74
|
if not openai_api_key:
|
|
71
75
|
openai_api_key = api_key
|
|
@@ -256,7 +260,7 @@ class Completions:
|
|
|
256
260
|
max_tokens = maitai_config.max_tokens
|
|
257
261
|
if max_completion_tokens and max_completion_tokens != openai.NOT_GIVEN:
|
|
258
262
|
max_tokens = max_completion_tokens
|
|
259
|
-
if n == openai.NOT_GIVEN:
|
|
263
|
+
if n == openai.NOT_GIVEN and maitai_config.n:
|
|
260
264
|
n = maitai_config.n
|
|
261
265
|
if frequency_penalty == openai.NOT_GIVEN:
|
|
262
266
|
frequency_penalty = maitai_config.frequency_penalty
|
|
@@ -62,8 +62,15 @@ class MaitaiAsync:
|
|
|
62
62
|
http_client: Optional[httpx.Client] = None,
|
|
63
63
|
_strict_response_validation: bool = False,
|
|
64
64
|
):
|
|
65
|
+
if not maitai_api_key:
|
|
66
|
+
maitai_api_key = os.environ.get("MAITAI_API_KEY")
|
|
65
67
|
if maitai_api_key:
|
|
66
68
|
config.initialize(maitai_api_key)
|
|
69
|
+
else:
|
|
70
|
+
raise ValueError(
|
|
71
|
+
"MAITAI_API_KEY has not been set. Either set via environment variable or pass it directly into the client."
|
|
72
|
+
)
|
|
73
|
+
|
|
67
74
|
if api_key:
|
|
68
75
|
if not openai_api_key:
|
|
69
76
|
openai_api_key = api_key
|
|
@@ -254,7 +261,7 @@ class AsyncCompletions:
|
|
|
254
261
|
max_tokens = maitai_config.max_tokens
|
|
255
262
|
if max_completion_tokens and max_completion_tokens != openai.NOT_GIVEN:
|
|
256
263
|
max_tokens = max_completion_tokens
|
|
257
|
-
if n == openai.NOT_GIVEN:
|
|
264
|
+
if n == openai.NOT_GIVEN and maitai_config.n:
|
|
258
265
|
n = maitai_config.n
|
|
259
266
|
if frequency_penalty == openai.NOT_GIVEN:
|
|
260
267
|
frequency_penalty = maitai_config.frequency_penalty
|
|
@@ -36,3 +36,16 @@ class EvaluationRun(betterproto.Message):
|
|
|
36
36
|
)
|
|
37
37
|
request_count: int = betterproto.int64_field(13)
|
|
38
38
|
requests: List["_chat__.EvaluateRequest"] = betterproto.message_field(14)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
@dataclass(eq=False, repr=False)
|
|
42
|
+
class TestSet(betterproto.Message):
|
|
43
|
+
id: int = betterproto.int64_field(1)
|
|
44
|
+
name: str = betterproto.string_field(2)
|
|
45
|
+
company_id: int = betterproto.int64_field(3)
|
|
46
|
+
application_id: int = betterproto.int64_field(4)
|
|
47
|
+
application_action_id: int = betterproto.int64_field(5)
|
|
48
|
+
meta: Dict[str, str] = betterproto.map_field(
|
|
49
|
+
6, betterproto.TYPE_STRING, betterproto.TYPE_STRING
|
|
50
|
+
)
|
|
51
|
+
date_created: int = betterproto.int64_field(7)
|
|
@@ -67,15 +67,20 @@ class ExportRequest(betterproto.Message):
|
|
|
67
67
|
fourbit: bool = betterproto.bool_field(8)
|
|
68
68
|
run_name: Optional[str] = betterproto.string_field(9, optional=True)
|
|
69
69
|
base_model: str = betterproto.string_field(10)
|
|
70
|
+
display_name: str = betterproto.string_field(11)
|
|
70
71
|
|
|
71
72
|
|
|
72
73
|
@dataclass(eq=False, repr=False)
|
|
73
74
|
class FinetuneRequest(betterproto.Message):
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
75
|
+
company_id: str = betterproto.string_field(1)
|
|
76
|
+
application_id: str = betterproto.string_field(2)
|
|
77
|
+
intent_id: str = betterproto.string_field(3)
|
|
78
|
+
input_file: str = betterproto.string_field(4)
|
|
79
|
+
run_name: str = betterproto.string_field(5)
|
|
80
|
+
conversation_mode: bool = betterproto.bool_field(6)
|
|
81
|
+
fourbit: bool = betterproto.bool_field(7)
|
|
82
|
+
prompt: Optional[str] = betterproto.string_field(8, optional=True)
|
|
83
|
+
max_steps: Optional[int] = betterproto.int32_field(9, optional=True)
|
|
84
|
+
run_id: int = betterproto.int64_field(10)
|
|
85
|
+
base_model: str = betterproto.string_field(11)
|
|
86
|
+
display_name: str = betterproto.string_field(12)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: maitai-python
|
|
3
|
-
Version: 1.1
|
|
3
|
+
Version: 1.2.1
|
|
4
4
|
Summary: Maitai SDK for Python
|
|
5
5
|
Home-page: https://docs.trymaitai.ai
|
|
6
6
|
Author: Maitai
|
|
@@ -11,7 +11,6 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
11
11
|
Description-Content-Type: text/markdown
|
|
12
12
|
Requires-Dist: requests
|
|
13
13
|
Requires-Dist: openai>=1.34.0
|
|
14
|
-
Requires-Dist: betterproto
|
|
15
14
|
Requires-Dist: httpx
|
|
16
15
|
Requires-Dist: aiohttp
|
|
17
16
|
Requires-Dist: betterproto==2.0.0b7
|
|
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.1.46 → maitai_python-1.2.1}/maitai_common/processes/websocket_listener_thread.py
RENAMED
|
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
|