maitai-python 1.2.0__py3-none-any.whl → 1.2.1__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 +4 -8
- maitai/_maitai.py +4 -0
- maitai/_maitai_async.py +7 -0
- maitai_common/version.py +1 -1
- {maitai_python-1.2.0.dist-info → maitai_python-1.2.1.dist-info}/METADATA +1 -1
- {maitai_python-1.2.0.dist-info → maitai_python-1.2.1.dist-info}/RECORD +8 -8
- {maitai_python-1.2.0.dist-info → maitai_python-1.2.1.dist-info}/WHEEL +0 -0
- {maitai_python-1.2.0.dist-info → maitai_python-1.2.1.dist-info}/top_level.txt +0 -0
maitai/__init__.py
CHANGED
|
@@ -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"))
|
maitai/_maitai.py
CHANGED
|
@@ -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
|
maitai/_maitai_async.py
CHANGED
|
@@ -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
|
maitai_common/version.py
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
maitai/__init__.py,sha256=
|
|
1
|
+
maitai/__init__.py,sha256=HjnRas9JQpcCPOh9m1ABfexl6BV69tRcJzArdQpCWkQ,593
|
|
2
2
|
maitai/_azure.py,sha256=ZQXVzmU2QPJ41wQUxqFkyeAKAJ6HrMoQKDbi3lyUJVc,8513
|
|
3
3
|
maitai/_config.py,sha256=n1RV9Udg5_EGNLCvVm8WR_RAmNeI2LCXkIWDXme727I,10104
|
|
4
4
|
maitai/_config_listener_thread.py,sha256=VaftjUXrP8oe6yg0TXUlIZW2vGw7bTk8p_95o4dSVgo,902
|
|
5
5
|
maitai/_context.py,sha256=WmCLGd7BK1ViImd7uDTsjly7ECcugioZhGjxXwETHfI,2401
|
|
6
6
|
maitai/_evaluator.py,sha256=qbwj--FCvNnRz-LTpuenMYf-2eGZRMrPqxepSerKWUo,10355
|
|
7
7
|
maitai/_inference.py,sha256=uINtF7KUFGfLDZ4wQ8rI45czfl7qYU4GcrGVv0nFaEc,13624
|
|
8
|
-
maitai/_maitai.py,sha256=
|
|
9
|
-
maitai/_maitai_async.py,sha256=
|
|
8
|
+
maitai/_maitai.py,sha256=AWnwbLviZd2SLXR6fR_UABenJsKg5Gh6fwfVba8HO0w,23588
|
|
9
|
+
maitai/_maitai_async.py,sha256=8PZC3BFrNBg8gNjtufdDycybMzBGhUIXdVdQkAXhVO0,23728
|
|
10
10
|
maitai/_maitai_client.py,sha256=NrICbHWhfx-u6pdXSUCjKRlPYmJO9nWb4hgnr3vf1y8,1981
|
|
11
11
|
maitai/_types.py,sha256=JEF0kGlnAdT-GDF927FfpH85FTz2dmaFp1FJg04WOos,6273
|
|
12
12
|
maitai/_utils.py,sha256=3JN5MClGZNkcmn-hWgi8fNV2n-Ytlek37H3S6TEHzuk,11276
|
|
13
13
|
maitai/tools/__init__.py,sha256=TxJ-g4A0eIzoIMD60ctIPVppCWcdcuZWms3hPGrqkSs,4043
|
|
14
14
|
maitai_common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
|
-
maitai_common/version.py,sha256=
|
|
15
|
+
maitai_common/version.py,sha256=VPkIDQwPJjvm-Jr51LgdnqtVODDJ34WFe1Pwmxqo3rY,64
|
|
16
16
|
maitai_common/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
17
|
maitai_common/config/config_service.py,sha256=U8hU0F9juZtrZwIayOM_OBShxynUS8gu5K0F40KvcA0,940
|
|
18
18
|
maitai_common/processes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -38,7 +38,7 @@ maitai_gen/rates/__init__.py,sha256=Aho7HzMKRfjQz10tMJCoRVttq_cGlYh2DxxpSyTQAzU,
|
|
|
38
38
|
maitai_gen/sandbox/__init__.py,sha256=IZ4hf76V1aZrYk5S-4p7z38e-op_s341utVG2domE_g,1549
|
|
39
39
|
maitai_gen/sentinel/__init__.py,sha256=3yR28usTBIAC-M_uxEUFgqXo2PWylEKEPYmWX_dp7Cs,2513
|
|
40
40
|
maitai_gen/session/__init__.py,sha256=kCJweCFagUqGkzktucaWLti9HSLaO5AML8Jewl89yM0,1242
|
|
41
|
-
maitai_python-1.2.
|
|
42
|
-
maitai_python-1.2.
|
|
43
|
-
maitai_python-1.2.
|
|
44
|
-
maitai_python-1.2.
|
|
41
|
+
maitai_python-1.2.1.dist-info/METADATA,sha256=Dd_xqvZboo7rlydtTiYqgFi_8pDcoXYxQgGxPrbtWIk,1494
|
|
42
|
+
maitai_python-1.2.1.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
|
43
|
+
maitai_python-1.2.1.dist-info/top_level.txt,sha256=-5U1krxnwlqB-AY7nEe29ZcNvwByNc-SnBe-mph-QjI,32
|
|
44
|
+
maitai_python-1.2.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|