maitai-python 1.0.5__tar.gz → 1.0.6__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.5 → maitai_python-1.0.6}/PKG-INFO +1 -1
- {maitai_python-1.0.5 → maitai_python-1.0.6}/maitai/_config.py +6 -1
- {maitai_python-1.0.5 → maitai_python-1.0.6}/maitai/_openai.py +2 -2
- {maitai_python-1.0.5 → maitai_python-1.0.6}/maitai/_openai_async.py +2 -2
- {maitai_python-1.0.5 → maitai_python-1.0.6}/maitai_python.egg-info/PKG-INFO +1 -1
- {maitai_python-1.0.5 → maitai_python-1.0.6}/setup.py +1 -1
- {maitai_python-1.0.5 → maitai_python-1.0.6}/README.md +0 -0
- {maitai_python-1.0.5 → maitai_python-1.0.6}/maitai/__init__.py +0 -0
- {maitai_python-1.0.5 → maitai_python-1.0.6}/maitai/_azure.py +0 -0
- {maitai_python-1.0.5 → maitai_python-1.0.6}/maitai/_config_listener_thread.py +0 -0
- {maitai_python-1.0.5 → maitai_python-1.0.6}/maitai/_evaluator.py +0 -0
- {maitai_python-1.0.5 → maitai_python-1.0.6}/maitai/_inference.py +0 -0
- {maitai_python-1.0.5 → maitai_python-1.0.6}/maitai/_maitai_client.py +0 -0
- {maitai_python-1.0.5 → maitai_python-1.0.6}/maitai/_openai_types.py +0 -0
- {maitai_python-1.0.5 → maitai_python-1.0.6}/maitai/_types.py +0 -0
- {maitai_python-1.0.5 → maitai_python-1.0.6}/maitai/_utils.py +0 -0
- {maitai_python-1.0.5 → maitai_python-1.0.6}/maitai_common/__init__.py +0 -0
- {maitai_python-1.0.5 → maitai_python-1.0.6}/maitai_common/config/__init__.py +0 -0
- {maitai_python-1.0.5 → maitai_python-1.0.6}/maitai_common/config/config_service.py +0 -0
- {maitai_python-1.0.5 → maitai_python-1.0.6}/maitai_common/processes/__init__.py +0 -0
- {maitai_python-1.0.5 → maitai_python-1.0.6}/maitai_common/processes/io_thread.py +0 -0
- {maitai_python-1.0.5 → maitai_python-1.0.6}/maitai_common/processes/stream_evaluation_thread.py +0 -0
- {maitai_python-1.0.5 → maitai_python-1.0.6}/maitai_common/processes/websocket_listener_thread.py +0 -0
- {maitai_python-1.0.5 → maitai_python-1.0.6}/maitai_common/utils/__init__.py +0 -0
- {maitai_python-1.0.5 → maitai_python-1.0.6}/maitai_common/utils/proto_utils.py +0 -0
- {maitai_python-1.0.5 → maitai_python-1.0.6}/maitai_gen/__init__.py +0 -0
- {maitai_python-1.0.5 → maitai_python-1.0.6}/maitai_gen/application/__init__.py +0 -0
- {maitai_python-1.0.5 → maitai_python-1.0.6}/maitai_gen/chat/__init__.py +0 -0
- {maitai_python-1.0.5 → maitai_python-1.0.6}/maitai_gen/company/__init__.py +0 -0
- {maitai_python-1.0.5 → maitai_python-1.0.6}/maitai_gen/config/__init__.py +0 -0
- {maitai_python-1.0.5 → maitai_python-1.0.6}/maitai_gen/inference/__init__.py +0 -0
- {maitai_python-1.0.5 → maitai_python-1.0.6}/maitai_gen/notification/__init__.py +0 -0
- {maitai_python-1.0.5 → maitai_python-1.0.6}/maitai_gen/sandbox/__init__.py +0 -0
- {maitai_python-1.0.5 → maitai_python-1.0.6}/maitai_gen/sentinel/__init__.py +0 -0
- {maitai_python-1.0.5 → maitai_python-1.0.6}/maitai_gen/session/__init__.py +0 -0
- {maitai_python-1.0.5 → maitai_python-1.0.6}/maitai_python.egg-info/SOURCES.txt +0 -0
- {maitai_python-1.0.5 → maitai_python-1.0.6}/maitai_python.egg-info/dependency_links.txt +0 -0
- {maitai_python-1.0.5 → maitai_python-1.0.6}/maitai_python.egg-info/requires.txt +0 -0
- {maitai_python-1.0.5 → maitai_python-1.0.6}/maitai_python.egg-info/top_level.txt +0 -0
- {maitai_python-1.0.5 → maitai_python-1.0.6}/setup.cfg +0 -0
|
@@ -19,11 +19,15 @@ class Config:
|
|
|
19
19
|
self.websocket_listener_thread = None
|
|
20
20
|
self.config_listener_thread = None
|
|
21
21
|
self._application_action_configs: dict[str, dict[str, ActionConfig]] = {}
|
|
22
|
+
self.initialized = False
|
|
22
23
|
|
|
23
24
|
@property
|
|
24
25
|
def api_key(self):
|
|
25
26
|
if self._api_key is None:
|
|
26
|
-
|
|
27
|
+
if self.initialized:
|
|
28
|
+
raise ValueError("Maitai API Key has not been set")
|
|
29
|
+
else:
|
|
30
|
+
self.initialize(api_key=os.environ.get("MAITAI_API_KEY"))
|
|
27
31
|
return self._api_key
|
|
28
32
|
|
|
29
33
|
@api_key.setter
|
|
@@ -35,6 +39,7 @@ class Config:
|
|
|
35
39
|
self._initialize_company()
|
|
36
40
|
self.refresh_applications()
|
|
37
41
|
self._initialize_websocket()
|
|
42
|
+
self.initialized = True
|
|
38
43
|
|
|
39
44
|
def get_application(self, application_ref_name: str) -> Application:
|
|
40
45
|
return self._applications.get(application_ref_name)
|
|
@@ -118,11 +118,11 @@ class Completions:
|
|
|
118
118
|
evaluation_enabled = maitai_config.evaluation_enabled
|
|
119
119
|
if apply_corrections is None:
|
|
120
120
|
apply_corrections = maitai_config.apply_corrections
|
|
121
|
-
if model
|
|
121
|
+
if model == openai.NOT_GIVEN:
|
|
122
122
|
model = maitai_config.model
|
|
123
123
|
if temperature == openai.NOT_GIVEN:
|
|
124
124
|
temperature = maitai_config.temperature
|
|
125
|
-
if stream
|
|
125
|
+
if stream == openai.NOT_GIVEN:
|
|
126
126
|
stream = maitai_config.streaming
|
|
127
127
|
if response_format == openai.NOT_GIVEN:
|
|
128
128
|
response_format = {"type": maitai_config.response_format}
|
|
@@ -121,11 +121,11 @@ class AsyncCompletions:
|
|
|
121
121
|
evaluation_enabled = maitai_config.evaluation_enabled
|
|
122
122
|
if apply_corrections is None:
|
|
123
123
|
apply_corrections = maitai_config.apply_corrections
|
|
124
|
-
if model
|
|
124
|
+
if model == openai.NOT_GIVEN:
|
|
125
125
|
model = maitai_config.model
|
|
126
126
|
if temperature == openai.NOT_GIVEN:
|
|
127
127
|
temperature = maitai_config.temperature
|
|
128
|
-
if stream
|
|
128
|
+
if stream == openai.NOT_GIVEN:
|
|
129
129
|
stream = maitai_config.streaming
|
|
130
130
|
if response_format == openai.NOT_GIVEN:
|
|
131
131
|
response_format = {"type": maitai_config.response_format}
|
|
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.5 → maitai_python-1.0.6}/maitai_common/processes/stream_evaluation_thread.py
RENAMED
|
File without changes
|
{maitai_python-1.0.5 → maitai_python-1.0.6}/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
|