maitai-python 1.2.11__tar.gz → 1.2.13__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.2.11 → maitai_python-1.2.13}/PKG-INFO +1 -1
- {maitai_python-1.2.11 → maitai_python-1.2.13}/maitai/_maitai.py +37 -6
- {maitai_python-1.2.11 → maitai_python-1.2.13}/maitai/_maitai_async.py +31 -5
- {maitai_python-1.2.11 → maitai_python-1.2.13}/maitai_common/config/config_service.py +6 -1
- {maitai_python-1.2.11 → maitai_python-1.2.13}/maitai_common/version.py +1 -1
- {maitai_python-1.2.11 → maitai_python-1.2.13}/maitai_python.egg-info/PKG-INFO +1 -1
- {maitai_python-1.2.11 → maitai_python-1.2.13}/README.md +0 -0
- {maitai_python-1.2.11 → maitai_python-1.2.13}/maitai/__init__.py +0 -0
- {maitai_python-1.2.11 → maitai_python-1.2.13}/maitai/_config.py +0 -0
- {maitai_python-1.2.11 → maitai_python-1.2.13}/maitai/_config_listener_thread.py +0 -0
- {maitai_python-1.2.11 → maitai_python-1.2.13}/maitai/_context.py +0 -0
- {maitai_python-1.2.11 → maitai_python-1.2.13}/maitai/_evaluator.py +0 -0
- {maitai_python-1.2.11 → maitai_python-1.2.13}/maitai/_inference.py +0 -0
- {maitai_python-1.2.11 → maitai_python-1.2.13}/maitai/_maitai_client.py +0 -0
- {maitai_python-1.2.11 → maitai_python-1.2.13}/maitai/_pydantic.py +0 -0
- {maitai_python-1.2.11 → maitai_python-1.2.13}/maitai/_types.py +0 -0
- {maitai_python-1.2.11 → maitai_python-1.2.13}/maitai/_utils.py +0 -0
- {maitai_python-1.2.11 → maitai_python-1.2.13}/maitai/models/__init__.py +0 -0
- {maitai_python-1.2.11 → maitai_python-1.2.13}/maitai/models/application.py +0 -0
- {maitai_python-1.2.11 → maitai_python-1.2.13}/maitai/models/chat.py +0 -0
- {maitai_python-1.2.11 → maitai_python-1.2.13}/maitai/models/config.py +0 -0
- {maitai_python-1.2.11 → maitai_python-1.2.13}/maitai/models/event.py +0 -0
- {maitai_python-1.2.11 → maitai_python-1.2.13}/maitai/models/inference.py +0 -0
- {maitai_python-1.2.11 → maitai_python-1.2.13}/maitai/models/key.py +0 -0
- {maitai_python-1.2.11 → maitai_python-1.2.13}/maitai/models/metric.py +0 -0
- {maitai_python-1.2.11 → maitai_python-1.2.13}/maitai/models/sentinel.py +0 -0
- {maitai_python-1.2.11 → maitai_python-1.2.13}/maitai/tools/__init__.py +0 -0
- {maitai_python-1.2.11 → maitai_python-1.2.13}/maitai_common/__init__.py +0 -0
- {maitai_python-1.2.11 → maitai_python-1.2.13}/maitai_common/config/__init__.py +0 -0
- {maitai_python-1.2.11 → maitai_python-1.2.13}/maitai_common/processes/__init__.py +0 -0
- {maitai_python-1.2.11 → maitai_python-1.2.13}/maitai_common/processes/io_thread.py +0 -0
- {maitai_python-1.2.11 → maitai_python-1.2.13}/maitai_common/processes/websocket_listener_thread.py +0 -0
- {maitai_python-1.2.11 → maitai_python-1.2.13}/maitai_python.egg-info/SOURCES.txt +0 -0
- {maitai_python-1.2.11 → maitai_python-1.2.13}/maitai_python.egg-info/dependency_links.txt +0 -0
- {maitai_python-1.2.11 → maitai_python-1.2.13}/maitai_python.egg-info/requires.txt +0 -0
- {maitai_python-1.2.11 → maitai_python-1.2.13}/maitai_python.egg-info/top_level.txt +0 -0
- {maitai_python-1.2.11 → maitai_python-1.2.13}/setup.cfg +0 -0
- {maitai_python-1.2.11 → maitai_python-1.2.13}/setup.py +0 -0
|
@@ -43,6 +43,7 @@ from maitai.models.chat import (
|
|
|
43
43
|
)
|
|
44
44
|
from maitai.models.config import InferenceLocations
|
|
45
45
|
from maitai.models.inference import InferenceStreamResponse
|
|
46
|
+
from maitai.models.key import Key
|
|
46
47
|
from maitai.models.metric import RequestTimingMetric
|
|
47
48
|
from maitai.tools import Tools
|
|
48
49
|
|
|
@@ -87,17 +88,47 @@ class Maitai:
|
|
|
87
88
|
"api_key is deprecated. Use provider specific keys instead. Supported variables: openai_api_key, groq_api_key, anthropic_api_key, cerebras_api_key, azure_api_key, sambanova_api_key"
|
|
88
89
|
)
|
|
89
90
|
if openai_api_key:
|
|
90
|
-
config.auth_keys.openai_api_key
|
|
91
|
+
if not config.auth_keys.openai_api_key:
|
|
92
|
+
config.auth_keys.openai_api_key = Key(
|
|
93
|
+
key_value=openai_api_key,
|
|
94
|
+
)
|
|
95
|
+
else:
|
|
96
|
+
config.auth_keys.openai_api_key.key_value = openai_api_key
|
|
91
97
|
if groq_api_key:
|
|
92
|
-
config.auth_keys.groq_api_key
|
|
98
|
+
if not config.auth_keys.groq_api_key:
|
|
99
|
+
config.auth_keys.groq_api_key = Key(
|
|
100
|
+
key_value=groq_api_key,
|
|
101
|
+
)
|
|
102
|
+
else:
|
|
103
|
+
config.auth_keys.groq_api_key.key_value = groq_api_key
|
|
93
104
|
if anthropic_api_key:
|
|
94
|
-
config.auth_keys.anthropic_api_key
|
|
105
|
+
if not config.auth_keys.anthropic_api_key:
|
|
106
|
+
config.auth_keys.anthropic_api_key = Key(
|
|
107
|
+
key_value=anthropic_api_key,
|
|
108
|
+
)
|
|
109
|
+
else:
|
|
110
|
+
config.auth_keys.anthropic_api_key.key_value = anthropic_api_key
|
|
95
111
|
if cerebras_api_key:
|
|
96
|
-
config.auth_keys.cerebras_api_key
|
|
112
|
+
if not config.auth_keys.cerebras_api_key:
|
|
113
|
+
config.auth_keys.cerebras_api_key = Key(
|
|
114
|
+
key_value=cerebras_api_key,
|
|
115
|
+
)
|
|
116
|
+
else:
|
|
117
|
+
config.auth_keys.cerebras_api_key.key_value = cerebras_api_key
|
|
97
118
|
if azure_api_key:
|
|
98
|
-
config.auth_keys.azure_api_key
|
|
119
|
+
if not config.auth_keys.azure_api_key:
|
|
120
|
+
config.auth_keys.azure_api_key = Key(
|
|
121
|
+
key_value=azure_api_key,
|
|
122
|
+
)
|
|
123
|
+
else:
|
|
124
|
+
config.auth_keys.azure_api_key.key_value = azure_api_key
|
|
99
125
|
if sambanova_api_key:
|
|
100
|
-
config.auth_keys.sambanova_api_key
|
|
126
|
+
if not config.auth_keys.sambanova_api_key:
|
|
127
|
+
config.auth_keys.sambanova_api_key = Key(
|
|
128
|
+
key_value=sambanova_api_key,
|
|
129
|
+
)
|
|
130
|
+
else:
|
|
131
|
+
config.auth_keys.sambanova_api_key.key_value = sambanova_api_key
|
|
101
132
|
self._client = None
|
|
102
133
|
azure_params = None
|
|
103
134
|
if azure_api_key:
|
|
@@ -43,6 +43,7 @@ from maitai.models.chat import (
|
|
|
43
43
|
)
|
|
44
44
|
from maitai.models.config import InferenceLocations
|
|
45
45
|
from maitai.models.inference import InferenceStreamResponse
|
|
46
|
+
from maitai.models.key import Key
|
|
46
47
|
from maitai.models.metric import RequestTimingMetric
|
|
47
48
|
from maitai.tools import Tools
|
|
48
49
|
|
|
@@ -87,17 +88,42 @@ class MaitaiAsync:
|
|
|
87
88
|
"api_key is deprecated. Use provider specific keys instead. Supported variables: openai_api_key, groq_api_key, anthropic_api_key, cerebras_api_key, azure_api_key, sambanova_api_key"
|
|
88
89
|
)
|
|
89
90
|
if openai_api_key:
|
|
90
|
-
config.auth_keys.openai_api_key
|
|
91
|
+
if not config.auth_keys.openai_api_key:
|
|
92
|
+
config.auth_keys.openai_api_key = Key(
|
|
93
|
+
key_value=openai_api_key,
|
|
94
|
+
)
|
|
95
|
+
else:
|
|
96
|
+
config.auth_keys.openai_api_key.key_value = openai_api_key
|
|
91
97
|
if groq_api_key:
|
|
92
|
-
config.auth_keys.groq_api_key
|
|
98
|
+
if not config.auth_keys.groq_api_key:
|
|
99
|
+
config.auth_keys.groq_api_key = Key(
|
|
100
|
+
key_value=groq_api_key,
|
|
101
|
+
)
|
|
102
|
+
else:
|
|
103
|
+
config.auth_keys.groq_api_key.key_value = groq_api_key
|
|
93
104
|
if anthropic_api_key:
|
|
94
105
|
config.auth_keys.anthropic_api_key.key_value = anthropic_api_key
|
|
95
106
|
if cerebras_api_key:
|
|
96
|
-
config.auth_keys.cerebras_api_key
|
|
107
|
+
if not config.auth_keys.cerebras_api_key:
|
|
108
|
+
config.auth_keys.cerebras_api_key = Key(
|
|
109
|
+
key_value=cerebras_api_key,
|
|
110
|
+
)
|
|
111
|
+
else:
|
|
112
|
+
config.auth_keys.cerebras_api_key.key_value = cerebras_api_key
|
|
97
113
|
if azure_api_key:
|
|
98
|
-
config.auth_keys.azure_api_key
|
|
114
|
+
if not config.auth_keys.azure_api_key:
|
|
115
|
+
config.auth_keys.azure_api_key = Key(
|
|
116
|
+
key_value=azure_api_key,
|
|
117
|
+
)
|
|
118
|
+
else:
|
|
119
|
+
config.auth_keys.azure_api_key.key_value = azure_api_key
|
|
99
120
|
if sambanova_api_key:
|
|
100
|
-
config.auth_keys.sambanova_api_key
|
|
121
|
+
if not config.auth_keys.sambanova_api_key:
|
|
122
|
+
config.auth_keys.sambanova_api_key = Key(
|
|
123
|
+
key_value=sambanova_api_key,
|
|
124
|
+
)
|
|
125
|
+
else:
|
|
126
|
+
config.auth_keys.sambanova_api_key.key_value = sambanova_api_key
|
|
101
127
|
self._client = None
|
|
102
128
|
if azure_api_key:
|
|
103
129
|
azure_params = AzureParams(
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
if os.environ.get("MAITAI_ENV") in ["prod", "staging", "development"]:
|
|
4
|
+
from maitai_models.config import Config, InferenceLocations
|
|
5
|
+
else:
|
|
6
|
+
from maitai.models.config import Config, InferenceLocations
|
|
2
7
|
|
|
3
8
|
|
|
4
9
|
def get_default_config() -> Config:
|
|
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.2.11 → maitai_python-1.2.13}/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
|