maitai-python 1.2.35__py3-none-any.whl → 1.2.36__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/_maitai_client.py +0 -31
- maitai_common/version.py +1 -1
- {maitai_python-1.2.35.dist-info → maitai_python-1.2.36.dist-info}/METADATA +1 -1
- {maitai_python-1.2.35.dist-info → maitai_python-1.2.36.dist-info}/RECORD +6 -6
- {maitai_python-1.2.35.dist-info → maitai_python-1.2.36.dist-info}/WHEEL +0 -0
- {maitai_python-1.2.35.dist-info → maitai_python-1.2.36.dist-info}/top_level.txt +0 -0
maitai/_maitai_client.py
CHANGED
|
@@ -29,40 +29,9 @@ CLIENT_SETTINGS = {
|
|
|
29
29
|
DEFAULT_MAX_RETRIES = 2
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
def _get_aws_instance_metadata(url, timeout=2):
|
|
33
|
-
try:
|
|
34
|
-
token_url = "http://169.254.169.254/latest/api/token"
|
|
35
|
-
token_headers = {"X-aws-ec2-metadata-token-ttl-seconds": "21600"}
|
|
36
|
-
with httpx.Client() as client:
|
|
37
|
-
token_response = client.put(
|
|
38
|
-
token_url, headers=token_headers, timeout=timeout
|
|
39
|
-
)
|
|
40
|
-
|
|
41
|
-
if token_response.status_code == 200:
|
|
42
|
-
token = token_response.text
|
|
43
|
-
headers = {"X-aws-ec2-metadata-token": token}
|
|
44
|
-
else:
|
|
45
|
-
headers = None
|
|
46
|
-
|
|
47
|
-
response = client.get(url, headers=headers, timeout=timeout)
|
|
48
|
-
response.raise_for_status()
|
|
49
|
-
return response.text
|
|
50
|
-
except Exception:
|
|
51
|
-
return None
|
|
52
|
-
|
|
53
|
-
|
|
54
32
|
def _determine_maitai_host():
|
|
55
33
|
if maitai_host := os.environ.get("MAITAI_HOST"):
|
|
56
34
|
return maitai_host.rstrip("/")
|
|
57
|
-
|
|
58
|
-
if (
|
|
59
|
-
_get_aws_instance_metadata(
|
|
60
|
-
"http://169.254.169.254/latest/meta-data/placement/region"
|
|
61
|
-
)
|
|
62
|
-
== "us-west-2"
|
|
63
|
-
):
|
|
64
|
-
return "https://api.aws.us-west-2.trymaitai.ai"
|
|
65
|
-
|
|
66
35
|
return "https://api.trymaitai.ai"
|
|
67
36
|
|
|
68
37
|
|
maitai_common/version.py
CHANGED
|
@@ -8,7 +8,7 @@ maitai/_inference.py,sha256=MsUcACBmiS_H7J2iVIX5R8TyRG2vBlHoX84DgUDnFgs,14216
|
|
|
8
8
|
maitai/_logger.py,sha256=NBNpcvSk7Q_AvtuMamu4HpfjxA8sujLTKO0yi2r2UmQ,10916
|
|
9
9
|
maitai/_maitai.py,sha256=wIR5M44pk-JQQO-0Y8DSnbzr_AtI1w0CBDDxLw_j06Y,9063
|
|
10
10
|
maitai/_maitai_async.py,sha256=hZFths2-Bj8f8AKoj2YTgvjFcSxIAF3AyssLJddbHdU,9601
|
|
11
|
-
maitai/_maitai_client.py,sha256=
|
|
11
|
+
maitai/_maitai_client.py,sha256=tpBYQopi6lWAhRMMK-Zcz9zBovH_yILPSlcVTAPTnTg,6506
|
|
12
12
|
maitai/_pydantic.py,sha256=8clflOhR7-6AeLFBzmsYO0aaQSAkp8KMuxsrYwPthaA,5683
|
|
13
13
|
maitai/_types.py,sha256=UL3CMIZ0bc1I6vyGcGxCusxVl-OHsTGUFY8oIBckyEs,5875
|
|
14
14
|
maitai/_utils.py,sha256=sVed23wNcKVhzv6owUgrubCetJgWqHk3Yk_HTdofgSw,15879
|
|
@@ -55,7 +55,7 @@ maitai/workflow/_local.py,sha256=2VUf5Uvc1LsbssGkLZKfqq0nUfXLZvR5jYSuHMe52bw,169
|
|
|
55
55
|
maitai/workflow/_stream_http.py,sha256=4_xK8tGvECubKKax8FgY7pL_RaASRg2AAaCI5_gwghE,5971
|
|
56
56
|
maitai_common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
57
57
|
maitai_common/onnx_embedding_model.py,sha256=gxD5dG2hqyZq1tC9nGSbTvxhRqvRvxtSl6ZFk1rA5hk,4240
|
|
58
|
-
maitai_common/version.py,sha256=
|
|
58
|
+
maitai_common/version.py,sha256=kpB7PO_mFlcNHl81zS5ZjqrvQnsi-cGQxllcPG7FYJA,65
|
|
59
59
|
maitai_common/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
60
60
|
maitai_common/config/config_service.py,sha256=xcbmwXr5cGZI0_wE2AEbhXQbQwurkUiv8qfFklNNlXU,1120
|
|
61
61
|
maitai_models/adapter.py,sha256=DrbFHeeo9tNI10MmZwNSivcvmNfrljqsYikyHzmTZKs,424
|
|
@@ -121,7 +121,7 @@ maitai_workflow/context.py,sha256=wragfsGUwFQzKI7wC7kCHXfwWb-70BnW3rwnX1xm0-Q,78
|
|
|
121
121
|
maitai_workflow/profile_nav.py,sha256=i9kqAmxMQLtELGvK3X2KMOOcQzaDmbCB2HGi8dkWO7c,2012
|
|
122
122
|
maitai_workflow/datastore/__init__.py,sha256=PGdETeEJF3z7zuNroQlmjibgcBadpr388zqd1GhtfrA,477
|
|
123
123
|
maitai_workflow/datastore/filters.py,sha256=rCg9HsQG4iXt_10DeBjaqYnaT0I0hOXk9ngeHkn5stI,9604
|
|
124
|
-
maitai_python-1.2.
|
|
125
|
-
maitai_python-1.2.
|
|
126
|
-
maitai_python-1.2.
|
|
127
|
-
maitai_python-1.2.
|
|
124
|
+
maitai_python-1.2.36.dist-info/METADATA,sha256=T5C9KccrAprTttTFbR-xrfecaSXKjji79TkBra5q7E0,1966
|
|
125
|
+
maitai_python-1.2.36.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
126
|
+
maitai_python-1.2.36.dist-info/top_level.txt,sha256=xogwYKin1vXFIAWRw3Myqr3hkymwsucp67TCSAWO3Rg,51
|
|
127
|
+
maitai_python-1.2.36.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|