maitai-python 1.2.4b0__tar.gz → 1.2.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.2.4b0 → maitai_python-1.2.6}/PKG-INFO +1 -1
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai/_maitai_client.py +9 -4
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai/_utils.py +36 -7
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai_common/version.py +1 -1
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai_gen/finetuning/__init__.py +2 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai_python.egg-info/PKG-INFO +1 -1
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/README.md +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai/__init__.py +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai/_config.py +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai/_config_listener_thread.py +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai/_context.py +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai/_evaluator.py +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai/_inference.py +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai/_maitai.py +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai/_maitai_async.py +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai/_types.py +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai/tools/__init__.py +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai_common/__init__.py +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai_common/config/__init__.py +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai_common/config/config_service.py +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai_common/processes/__init__.py +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai_common/processes/io_thread.py +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai_common/processes/websocket_listener_thread.py +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai_gen/__init__.py +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai_gen/application/__init__.py +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai_gen/backtest/__init__.py +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai_gen/billing/__init__.py +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai_gen/chat/__init__.py +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai_gen/company/__init__.py +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai_gen/config/__init__.py +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai_gen/embedding/__init__.py +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai_gen/evaluation/__init__.py +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai_gen/event/__init__.py +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai_gen/inference/__init__.py +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai_gen/key/__init__.py +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai_gen/metric/__init__.py +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai_gen/model.py +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai_gen/notification/__init__.py +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai_gen/rates/__init__.py +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai_gen/sandbox/__init__.py +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai_gen/sentinel/__init__.py +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai_gen/session/__init__.py +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai_python.egg-info/SOURCES.txt +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai_python.egg-info/dependency_links.txt +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai_python.egg-info/requires.txt +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/maitai_python.egg-info/top_level.txt +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/setup.cfg +0 -0
- {maitai_python-1.2.4b0 → maitai_python-1.2.6}/setup.py +0 -0
|
@@ -95,8 +95,14 @@ class MaitaiClient:
|
|
|
95
95
|
atexit.register(self.cleanup)
|
|
96
96
|
|
|
97
97
|
def cleanup(self):
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
try:
|
|
99
|
+
asyncio.get_running_loop().create_task(self.close_async_session())
|
|
100
|
+
except Exception as e:
|
|
101
|
+
pass
|
|
102
|
+
try:
|
|
103
|
+
self.close_session()
|
|
104
|
+
except Exception as e:
|
|
105
|
+
pass
|
|
100
106
|
if self._loop.is_running():
|
|
101
107
|
self._loop.call_soon_threadsafe(self._loop.stop)
|
|
102
108
|
if self._thr.is_alive():
|
|
@@ -132,8 +138,7 @@ class MaitaiClient:
|
|
|
132
138
|
cls._async_session = None
|
|
133
139
|
|
|
134
140
|
def __del__(self):
|
|
135
|
-
self.
|
|
136
|
-
self.run_async_with_result(self.close_async_session())
|
|
141
|
+
self.cleanup()
|
|
137
142
|
|
|
138
143
|
@classmethod
|
|
139
144
|
def run_async(cls, coro):
|
|
@@ -34,25 +34,54 @@ class OpenAISchemaGenerator(GenerateJsonSchema):
|
|
|
34
34
|
json_schema = super().generate(schema, mode=mode)
|
|
35
35
|
|
|
36
36
|
# Inline the referenced objects
|
|
37
|
-
def resolve_refs(obj):
|
|
37
|
+
def resolve_refs(obj, processed_refs=None):
|
|
38
|
+
if processed_refs is None:
|
|
39
|
+
processed_refs = set()
|
|
40
|
+
|
|
38
41
|
if isinstance(obj, dict):
|
|
39
42
|
if "$ref" in obj and obj["$ref"].startswith("#/$defs/"):
|
|
40
43
|
ref_name = obj["$ref"].split("/")[-1]
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
|
|
45
|
+
# If we've seen this ref before, return a simplified version
|
|
46
|
+
if ref_name in processed_refs:
|
|
47
|
+
return {"type": "object"}
|
|
48
|
+
|
|
49
|
+
processed_refs.add(ref_name)
|
|
50
|
+
return resolve_refs(
|
|
51
|
+
json_schema.get("$defs", {}).get(ref_name, {}), processed_refs
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
return {k: resolve_refs(v, processed_refs) for k, v in obj.items()}
|
|
43
55
|
elif isinstance(obj, list):
|
|
44
|
-
return [resolve_refs(item) for item in obj]
|
|
56
|
+
return [resolve_refs(item, processed_refs) for item in obj]
|
|
45
57
|
return obj
|
|
46
58
|
|
|
47
|
-
|
|
59
|
+
# Get the main schema from $defs if it exists
|
|
60
|
+
main_schema = None
|
|
61
|
+
if "allOf" in json_schema and json_schema["allOf"]:
|
|
62
|
+
ref = json_schema["allOf"][0].get("$ref")
|
|
63
|
+
if ref and ref.startswith("#/$defs/"):
|
|
64
|
+
ref_name = ref.split("/")[-1]
|
|
65
|
+
main_schema = json_schema["$defs"][ref_name]
|
|
66
|
+
|
|
67
|
+
properties = resolve_refs(
|
|
68
|
+
main_schema["properties"] if main_schema else json_schema["properties"]
|
|
69
|
+
)
|
|
48
70
|
|
|
49
71
|
return {
|
|
50
|
-
"name":
|
|
72
|
+
"name": (
|
|
73
|
+
main_schema.get("title", "") if main_schema else schema.get("title", "")
|
|
74
|
+
).lower()
|
|
75
|
+
+ "_schema",
|
|
51
76
|
"strict": True,
|
|
52
77
|
"schema": {
|
|
53
78
|
"type": "object",
|
|
54
79
|
"properties": properties,
|
|
55
|
-
"required":
|
|
80
|
+
"required": (
|
|
81
|
+
main_schema.get("required", [])
|
|
82
|
+
if main_schema
|
|
83
|
+
else json_schema.get("required", [])
|
|
84
|
+
),
|
|
56
85
|
"additionalProperties": False,
|
|
57
86
|
},
|
|
58
87
|
}
|
|
@@ -68,6 +68,7 @@ class ExportRequest(betterproto.Message):
|
|
|
68
68
|
run_name: Optional[str] = betterproto.string_field(9, optional=True)
|
|
69
69
|
base_model: str = betterproto.string_field(10)
|
|
70
70
|
display_name: str = betterproto.string_field(11)
|
|
71
|
+
prompt_deletions: List[str] = betterproto.string_field(12)
|
|
71
72
|
|
|
72
73
|
|
|
73
74
|
@dataclass(eq=False, repr=False)
|
|
@@ -84,3 +85,4 @@ class FinetuneRequest(betterproto.Message):
|
|
|
84
85
|
run_id: int = betterproto.int64_field(10)
|
|
85
86
|
base_model: str = betterproto.string_field(11)
|
|
86
87
|
display_name: str = betterproto.string_field(12)
|
|
88
|
+
prompt_deletions: List[str] = betterproto.string_field(13)
|
|
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.4b0 → maitai_python-1.2.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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|