mostlyai 4.3.0__tar.gz → 4.3.2__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.
- {mostlyai-4.3.0 → mostlyai-4.3.2}/PKG-INFO +7 -7
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/__init__.py +1 -1
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/base.py +4 -4
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/context.py +1 -1
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/db/base.py +6 -6
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/file/base.py +5 -5
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/file/table/json.py +5 -5
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/client/api.py +69 -69
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/domain.py +36 -21
- mostlyai-4.3.2/mostlyai/sdk/py.typed +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/pyproject.toml +7 -7
- {mostlyai-4.3.0 → mostlyai-4.3.2}/.gitignore +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/LICENSE +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/README.md +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/__init__.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/auto_detect.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/conversions.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/db/__init__.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/db/bigquery.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/db/databricks.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/db/hive.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/db/mssql.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/db/mysql.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/db/oracle.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/db/postgresql.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/db/snowflake.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/db/sqlite.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/db/types_coercion.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/dtype.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/exceptions.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/file/__init__.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/file/container/__init__.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/file/container/aws.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/file/container/azure.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/file/container/bucket_based.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/file/container/gcs.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/file/container/minio.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/file/table/__init__.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/file/table/csv.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/file/table/feather.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/file/table/parquet.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/file/utils.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/language_model.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/metadata_objects.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/non_context.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/progress_callback.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/pull.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/pull_context.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/pull_utils.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/push.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/util/__init__.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/util/common.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_data/util/kerberos.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_local/__init__.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_local/cli.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_local/connectors.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_local/execution/__init__.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_local/execution/jobs.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_local/execution/plan.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_local/execution/step_analyze_training_data.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_local/execution/step_create_data_report.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_local/execution/step_create_model_report.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_local/execution/step_deliver_data.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_local/execution/step_encode_training_data.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_local/execution/step_finalize_generation.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_local/execution/step_finalize_training.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_local/execution/step_generate_data.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_local/execution/step_generate_model_report_data.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_local/execution/step_pull_training_data.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_local/execution/step_train_model.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_local/generators.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_local/progress.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_local/routes.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_local/server.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_local/storage.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_local/synthetic_datasets.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/client/__init__.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/client/_base_utils.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/client/_naming_conventions.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/client/_utils.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/client/base.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/client/connectors.py +6 -6
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/client/exceptions.py +0 -0
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/client/generators.py +25 -25
- {mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/client/synthetic_datasets.py +22 -22
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mostlyai
|
|
3
|
-
Version: 4.3.
|
|
3
|
+
Version: 4.3.2
|
|
4
4
|
Summary: Synthetic Data SDK
|
|
5
5
|
Project-URL: homepage, https://app.mostly.ai/
|
|
6
6
|
Project-URL: repository, https://github.com/mostly-ai/mostlyai
|
|
@@ -57,8 +57,8 @@ Requires-Dist: fastapi<0.116,>=0.115.6; extra == 'local'
|
|
|
57
57
|
Requires-Dist: filelock>=3.16.1; extra == 'local'
|
|
58
58
|
Requires-Dist: gcsfs>=2023.1.0; extra == 'local'
|
|
59
59
|
Requires-Dist: joblib>=1.2.0; extra == 'local'
|
|
60
|
-
Requires-Dist: mostlyai-engine==1.1.
|
|
61
|
-
Requires-Dist: mostlyai-qa==1.5.
|
|
60
|
+
Requires-Dist: mostlyai-engine==1.1.6; extra == 'local'
|
|
61
|
+
Requires-Dist: mostlyai-qa==1.5.6; extra == 'local'
|
|
62
62
|
Requires-Dist: networkx<4,>=3.0; extra == 'local'
|
|
63
63
|
Requires-Dist: openpyxl>=3.1.5; extra == 'local'
|
|
64
64
|
Requires-Dist: python-multipart>=0.0.20; extra == 'local'
|
|
@@ -77,8 +77,8 @@ Requires-Dist: fastapi<0.116,>=0.115.6; extra == 'local-cpu'
|
|
|
77
77
|
Requires-Dist: filelock>=3.16.1; extra == 'local-cpu'
|
|
78
78
|
Requires-Dist: gcsfs>=2023.1.0; extra == 'local-cpu'
|
|
79
79
|
Requires-Dist: joblib>=1.2.0; extra == 'local-cpu'
|
|
80
|
-
Requires-Dist: mostlyai-engine[cpu]==1.1.
|
|
81
|
-
Requires-Dist: mostlyai-qa[cpu]==1.5.
|
|
80
|
+
Requires-Dist: mostlyai-engine[cpu]==1.1.6; extra == 'local-cpu'
|
|
81
|
+
Requires-Dist: mostlyai-qa[cpu]==1.5.6; extra == 'local-cpu'
|
|
82
82
|
Requires-Dist: networkx<4,>=3.0; extra == 'local-cpu'
|
|
83
83
|
Requires-Dist: openpyxl>=3.1.5; extra == 'local-cpu'
|
|
84
84
|
Requires-Dist: python-multipart>=0.0.20; extra == 'local-cpu'
|
|
@@ -98,8 +98,8 @@ Requires-Dist: fastapi<0.116,>=0.115.6; extra == 'local-gpu'
|
|
|
98
98
|
Requires-Dist: filelock>=3.16.1; extra == 'local-gpu'
|
|
99
99
|
Requires-Dist: gcsfs>=2023.1.0; extra == 'local-gpu'
|
|
100
100
|
Requires-Dist: joblib>=1.2.0; extra == 'local-gpu'
|
|
101
|
-
Requires-Dist: mostlyai-engine[gpu]==1.1.
|
|
102
|
-
Requires-Dist: mostlyai-qa[gpu]==1.5.
|
|
101
|
+
Requires-Dist: mostlyai-engine[gpu]==1.1.6; extra == 'local-gpu'
|
|
102
|
+
Requires-Dist: mostlyai-qa[gpu]==1.5.6; extra == 'local-gpu'
|
|
103
103
|
Requires-Dist: networkx<4,>=3.0; extra == 'local-gpu'
|
|
104
104
|
Requires-Dist: openpyxl>=3.1.5; extra == 'local-gpu'
|
|
105
105
|
Requires-Dist: python-multipart>=0.0.20; extra == 'local-gpu'
|
|
@@ -534,9 +534,9 @@ class DataTable(abc.ABC):
|
|
|
534
534
|
def read_data(
|
|
535
535
|
self,
|
|
536
536
|
where: dict[str, Any] | None = None,
|
|
537
|
-
|
|
537
|
+
limit: int | None = None,
|
|
538
538
|
columns: list[str] | None = None,
|
|
539
|
-
|
|
539
|
+
shuffle: bool | None = False,
|
|
540
540
|
order_by: OrderBy | None = None,
|
|
541
541
|
do_coerce_dtypes: bool | None = False,
|
|
542
542
|
) -> pd.DataFrame:
|
|
@@ -544,9 +544,9 @@ class DataTable(abc.ABC):
|
|
|
544
544
|
Read data from this data source.
|
|
545
545
|
|
|
546
546
|
:param where: dict of column name and value(s) or a lambda function to filter on
|
|
547
|
-
:param
|
|
547
|
+
:param limit: limit the number of rows returned. If None, return all rows
|
|
548
548
|
:param columns: list of columns to include. If None, all columns are included
|
|
549
|
-
:param
|
|
549
|
+
:param shuffle: whether to shuffle the returned data rows
|
|
550
550
|
:param order_by: optionally, one or multiple columns (asc/desc) to order by
|
|
551
551
|
:param do_coerce_dtypes: bool on whether dtypes shall be converted corresponding to encoding_types
|
|
552
552
|
"""
|
|
@@ -165,7 +165,7 @@ def add_scp_context(
|
|
|
165
165
|
columns=scp_table.columns,
|
|
166
166
|
where={child_key: (ctx_keys[parent_key_prefixed])},
|
|
167
167
|
do_coerce_dtypes=do_coerce_dtypes,
|
|
168
|
-
|
|
168
|
+
shuffle=False,
|
|
169
169
|
)
|
|
170
170
|
|
|
171
171
|
# filtering sibling data with the keys presented on tgt
|
|
@@ -1191,9 +1191,9 @@ class SqlAlchemyTable(DBTable, abc.ABC):
|
|
|
1191
1191
|
def read_data(
|
|
1192
1192
|
self,
|
|
1193
1193
|
where: dict[str, Any] | None = None,
|
|
1194
|
-
|
|
1194
|
+
limit: int | None = None,
|
|
1195
1195
|
columns: list[str] | None = None,
|
|
1196
|
-
|
|
1196
|
+
shuffle: bool | None = None,
|
|
1197
1197
|
order_by: OrderBy | None = None,
|
|
1198
1198
|
do_coerce_dtypes: bool | None = False,
|
|
1199
1199
|
) -> pd.DataFrame:
|
|
@@ -1205,15 +1205,15 @@ class SqlAlchemyTable(DBTable, abc.ABC):
|
|
|
1205
1205
|
if len(stmts) == 1 and self.ENABLE_ORDER_AND_LIMIT_ON_SQL:
|
|
1206
1206
|
# single statement; include ordering and limiting in the SQL statement
|
|
1207
1207
|
# and execute it
|
|
1208
|
-
stmt = self._sa_order(stmts[0],
|
|
1209
|
-
stmt = self._sa_limit(stmt,
|
|
1208
|
+
stmt = self._sa_order(stmts[0], shuffle, order_by)
|
|
1209
|
+
stmt = self._sa_limit(stmt, limit)
|
|
1210
1210
|
df = self._sa_execute([stmt])
|
|
1211
1211
|
else: # len(stmts) > 1 or self.ENABLE_ORDER_AND_LIMIT_ON_SQL is False
|
|
1212
1212
|
# multiple statements; execute them, concatenate results and apply
|
|
1213
1213
|
# ordering and limiting on the final result (in memory)
|
|
1214
1214
|
df = self._sa_execute(stmts)
|
|
1215
|
-
df = self._df_order(df,
|
|
1216
|
-
df = self._df_limit(df,
|
|
1215
|
+
df = self._df_order(df, shuffle, order_by)
|
|
1216
|
+
df = self._df_limit(df, limit)
|
|
1217
1217
|
if do_coerce_dtypes:
|
|
1218
1218
|
df = coerce_dtypes_by_encoding(df, self.encoding_types)
|
|
1219
1219
|
_LOG.info(f"read DB data `{self.name}` {df.shape} in {time.time() - t0:.2f}s")
|
|
@@ -281,9 +281,9 @@ class FileDataTable(DataTable, abc.ABC):
|
|
|
281
281
|
def read_data(
|
|
282
282
|
self,
|
|
283
283
|
where: dict[str, Any] | None = None,
|
|
284
|
-
|
|
284
|
+
limit: int | None = None,
|
|
285
285
|
columns: list[str] | None = None,
|
|
286
|
-
|
|
286
|
+
shuffle: bool | None = False,
|
|
287
287
|
order_by: OrderBy | None = None,
|
|
288
288
|
do_coerce_dtypes: bool | None = False,
|
|
289
289
|
) -> pd.DataFrame:
|
|
@@ -300,10 +300,10 @@ class FileDataTable(DataTable, abc.ABC):
|
|
|
300
300
|
split_blocks=True,
|
|
301
301
|
)
|
|
302
302
|
)
|
|
303
|
-
if
|
|
303
|
+
if shuffle:
|
|
304
304
|
df = df.sample(frac=1)
|
|
305
|
-
if
|
|
306
|
-
df = df.head(
|
|
305
|
+
if limit is not None:
|
|
306
|
+
df = df.head(limit)
|
|
307
307
|
if order_by:
|
|
308
308
|
df = order_df_by(df, order_by)
|
|
309
309
|
if do_coerce_dtypes:
|
|
@@ -51,9 +51,9 @@ class JsonDataTable(FileDataTable):
|
|
|
51
51
|
def read_data(
|
|
52
52
|
self,
|
|
53
53
|
where: dict[str, Any] | None = None,
|
|
54
|
-
|
|
54
|
+
limit: int | None = None,
|
|
55
55
|
columns: list[str] | None = None,
|
|
56
|
-
|
|
56
|
+
shuffle: bool | None = False,
|
|
57
57
|
order_by: OrderBy | None = None,
|
|
58
58
|
do_coerce_dtypes: bool | None = False,
|
|
59
59
|
) -> pd.DataFrame:
|
|
@@ -91,10 +91,10 @@ class JsonDataTable(FileDataTable):
|
|
|
91
91
|
)
|
|
92
92
|
if columns:
|
|
93
93
|
df = df[columns]
|
|
94
|
-
if
|
|
94
|
+
if shuffle:
|
|
95
95
|
df = df.sample(frac=1)
|
|
96
|
-
if
|
|
97
|
-
df = df.head(
|
|
96
|
+
if limit is not None:
|
|
97
|
+
df = df.head(limit)
|
|
98
98
|
if order_by:
|
|
99
99
|
df = order_df_by(df, order_by)
|
|
100
100
|
if do_coerce_dtypes:
|
|
@@ -54,7 +54,17 @@ class MostlyAI(_MostlyBaseClient):
|
|
|
54
54
|
"""
|
|
55
55
|
Instantiate an SDK instance, either in CLIENT or in LOCAL mode.
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
Args:
|
|
58
|
+
base_url: The base URL. If not provided, a default value is used.
|
|
59
|
+
api_key: The API key for authenticating. If not provided, it would rely on environment variables.
|
|
60
|
+
local: Whether to run in local mode or not.
|
|
61
|
+
local_dir: The directory to use for local mode. If not provided, `~/mostlyai` will be used.
|
|
62
|
+
local_port: The port to use for local mode with TCP transport. If not provided, UDS transport is used by default.
|
|
63
|
+
timeout: Timeout for HTTPS requests in seconds.
|
|
64
|
+
ssl_verify: Whether to verify SSL certificates.
|
|
65
|
+
quiet: Whether to suppress rich output.
|
|
66
|
+
|
|
67
|
+
Example for SDK in CLIENT mode with explicit arguments:
|
|
58
68
|
```python
|
|
59
69
|
from mostlyai.sdk import MostlyAI
|
|
60
70
|
mostly = MostlyAI(
|
|
@@ -65,7 +75,7 @@ class MostlyAI(_MostlyBaseClient):
|
|
|
65
75
|
# MostlyAI(base_url='https://app.mostly.ai', api_key='***')
|
|
66
76
|
```
|
|
67
77
|
|
|
68
|
-
Example for
|
|
78
|
+
Example for SDK in CLIENT mode with environment variables:
|
|
69
79
|
```python
|
|
70
80
|
import os
|
|
71
81
|
from mostlyai.sdk import MostlyAI
|
|
@@ -76,7 +86,7 @@ class MostlyAI(_MostlyBaseClient):
|
|
|
76
86
|
# MostlyAI(base_url='https://app.mostly.ai', api_key='***')
|
|
77
87
|
```
|
|
78
88
|
|
|
79
|
-
Example for
|
|
89
|
+
Example for SDK in LOCAL mode connecting via UDS:
|
|
80
90
|
```python
|
|
81
91
|
from mostlyai.sdk import MostlyAI
|
|
82
92
|
mostly = MostlyAI(local=True)
|
|
@@ -84,23 +94,13 @@ class MostlyAI(_MostlyBaseClient):
|
|
|
84
94
|
# MostlyAI(local=True)
|
|
85
95
|
```
|
|
86
96
|
|
|
87
|
-
Example for
|
|
97
|
+
Example for SDK in LOCAL mode connecting via TCP:
|
|
88
98
|
```python
|
|
89
99
|
from mostlyai.sdk import MostlyAI
|
|
90
100
|
mostly = MostlyAI(local=True, local_port=8080)
|
|
91
101
|
mostly
|
|
92
102
|
# MostlyAI(local=True, local_port=8080)
|
|
93
103
|
```
|
|
94
|
-
|
|
95
|
-
Args:
|
|
96
|
-
base_url: The base URL. If not provided, a default value is used.
|
|
97
|
-
api_key: The API key for authenticating. If not provided, it would rely on environment variables.
|
|
98
|
-
local: Whether to run in local mode or not.
|
|
99
|
-
local_dir: The directory to use for local mode. If not provided, `~/mostlyai` will be used.
|
|
100
|
-
local_port: The port to use for local mode with TCP transport. If not provided, UDS transport is used by default.
|
|
101
|
-
timeout: Timeout for HTTPS requests in seconds.
|
|
102
|
-
ssl_verify: Whether to verify SSL certificates.
|
|
103
|
-
quiet: Whether to suppress rich output.
|
|
104
104
|
"""
|
|
105
105
|
|
|
106
106
|
def __init__(
|
|
@@ -243,6 +243,13 @@ class MostlyAI(_MostlyBaseClient):
|
|
|
243
243
|
|
|
244
244
|
See [ConnectorConfig](api_domain.md#mostlyai.sdk.domain.ConnectorConfig) for more information on the available configuration parameters.
|
|
245
245
|
|
|
246
|
+
Args:
|
|
247
|
+
config: Configuration for the connector. Can be either a ConnectorConfig object or an equivalent dictionary.
|
|
248
|
+
test_connection: Whether to validate the connection before saving.
|
|
249
|
+
|
|
250
|
+
Returns:
|
|
251
|
+
The created connector.
|
|
252
|
+
|
|
246
253
|
Example for creating a connector to a AWS S3 storage:
|
|
247
254
|
```python
|
|
248
255
|
from mostlyai.sdk import MostlyAI
|
|
@@ -260,10 +267,6 @@ class MostlyAI(_MostlyBaseClient):
|
|
|
260
267
|
)
|
|
261
268
|
```
|
|
262
269
|
|
|
263
|
-
Args:
|
|
264
|
-
config: Configuration for the connector. Can be either a ConnectorConfig object or an equivalent dictionary.
|
|
265
|
-
test_connection: Whether to validate the connection before saving.
|
|
266
|
-
|
|
267
270
|
The structures of the `config`, `secrets` and `ssl` parameters depend on the connector `type`:
|
|
268
271
|
|
|
269
272
|
- Cloud storage:
|
|
@@ -380,9 +383,6 @@ class MostlyAI(_MostlyBaseClient):
|
|
|
380
383
|
secrets:
|
|
381
384
|
password: string
|
|
382
385
|
```
|
|
383
|
-
|
|
384
|
-
Returns:
|
|
385
|
-
Connector: The created connector.
|
|
386
386
|
"""
|
|
387
387
|
c = self.connectors.create(config=config, test_connection=test_connection)
|
|
388
388
|
return c
|
|
@@ -401,7 +401,18 @@ class MostlyAI(_MostlyBaseClient):
|
|
|
401
401
|
|
|
402
402
|
See [GeneratorConfig](api_domain.md#mostlyai.sdk.domain.GeneratorConfig) for more information on the available configuration parameters.
|
|
403
403
|
|
|
404
|
-
|
|
404
|
+
Args:
|
|
405
|
+
config: The configuration parameters of the generator to be created. Either `config` or `data` must be provided.
|
|
406
|
+
data: A single pandas DataFrame, or a path to a CSV or PARQUET file. Either `config` or `data` must be provided.
|
|
407
|
+
name: Name of the generator.
|
|
408
|
+
start: Whether to start training immediately.
|
|
409
|
+
wait: Whether to wait for training to finish.
|
|
410
|
+
progress_bar: Whether to display a progress bar during training.
|
|
411
|
+
|
|
412
|
+
Returns:
|
|
413
|
+
The created generator.
|
|
414
|
+
|
|
415
|
+
Example of short-hand notation reading data from path:
|
|
405
416
|
```python
|
|
406
417
|
from mostlyai.sdk import MostlyAI
|
|
407
418
|
mostly = MostlyAI()
|
|
@@ -410,7 +421,7 @@ class MostlyAI(_MostlyBaseClient):
|
|
|
410
421
|
)
|
|
411
422
|
```
|
|
412
423
|
|
|
413
|
-
Example of short-hand notation
|
|
424
|
+
Example of short-hand notation passing data as DataFrame:
|
|
414
425
|
```python
|
|
415
426
|
# read original data
|
|
416
427
|
import pandas as pd
|
|
@@ -469,17 +480,6 @@ class MostlyAI(_MostlyBaseClient):
|
|
|
469
480
|
}
|
|
470
481
|
)
|
|
471
482
|
```
|
|
472
|
-
|
|
473
|
-
Args:
|
|
474
|
-
config: The configuration parameters of the generator to be created. Either `config` or `data` must be provided.
|
|
475
|
-
data: A single pandas DataFrame, or a path to a CSV or PARQUET file. Either `config` or `data` must be provided.
|
|
476
|
-
name: Name of the generator.
|
|
477
|
-
start: Whether to start training immediately.
|
|
478
|
-
wait: Whether to wait for training to finish.
|
|
479
|
-
progress_bar: Whether to display a progress bar during training.
|
|
480
|
-
|
|
481
|
-
Returns:
|
|
482
|
-
Generator: The created generator.
|
|
483
483
|
"""
|
|
484
484
|
if data is None and config is None:
|
|
485
485
|
raise ValueError("Either config or data must be provided")
|
|
@@ -528,6 +528,19 @@ class MostlyAI(_MostlyBaseClient):
|
|
|
528
528
|
|
|
529
529
|
See [SyntheticDatasetConfig](api_domain.md#mostlyai.sdk.domain.SyntheticDatasetConfig) for more information on the available configuration parameters.
|
|
530
530
|
|
|
531
|
+
Args:
|
|
532
|
+
generator: The generator instance or its UUID.
|
|
533
|
+
config: Configuration for the synthetic dataset.
|
|
534
|
+
size : Sample size(s) for the subject table(s).
|
|
535
|
+
seed: Seed data for the subject table(s).
|
|
536
|
+
name: Name of the synthetic dataset.
|
|
537
|
+
start: Whether to start generation immediately.
|
|
538
|
+
wait: Whether to wait for generation to finish.
|
|
539
|
+
progress_bar: Whether to display a progress bar during generation.
|
|
540
|
+
|
|
541
|
+
Returns:
|
|
542
|
+
The created synthetic dataset.
|
|
543
|
+
|
|
531
544
|
Example configuration using short-hand notation:
|
|
532
545
|
```python
|
|
533
546
|
from mostlyai.sdk import MostlyAI
|
|
@@ -574,19 +587,6 @@ class MostlyAI(_MostlyBaseClient):
|
|
|
574
587
|
}
|
|
575
588
|
)
|
|
576
589
|
```
|
|
577
|
-
|
|
578
|
-
Args:
|
|
579
|
-
generator: The generator instance or its UUID.
|
|
580
|
-
config: Configuration for the synthetic dataset.
|
|
581
|
-
size : Sample size(s) for the subject table(s).
|
|
582
|
-
seed: Seed data for the subject table(s).
|
|
583
|
-
name: Name of the synthetic dataset.
|
|
584
|
-
start: Whether to start generation immediately.
|
|
585
|
-
wait: Whether to wait for generation to finish.
|
|
586
|
-
progress_bar: Whether to display a progress bar during generation.
|
|
587
|
-
|
|
588
|
-
Returns:
|
|
589
|
-
SyntheticDataset: The created synthetic dataset.
|
|
590
590
|
"""
|
|
591
591
|
config = harmonize_sd_config(
|
|
592
592
|
generator,
|
|
@@ -617,6 +617,16 @@ class MostlyAI(_MostlyBaseClient):
|
|
|
617
617
|
|
|
618
618
|
See [SyntheticProbeConfig](api_domain.md#mostlyai.sdk.domain.SyntheticProbeConfig) for more information on the available configuration parameters.
|
|
619
619
|
|
|
620
|
+
Args:
|
|
621
|
+
generator: The generator instance or its UUID.
|
|
622
|
+
size: Sample size(s) for the subject table(s).
|
|
623
|
+
seed: Seed data for the subject table(s).
|
|
624
|
+
config: Configuration for the probe.
|
|
625
|
+
return_type: Format of the return value. "auto" for pandas DataFrame if a single table, otherwise a dictionary.
|
|
626
|
+
|
|
627
|
+
Returns:
|
|
628
|
+
The created synthetic probe.
|
|
629
|
+
|
|
620
630
|
Example for probing a generator for 10 synthetic samples:
|
|
621
631
|
```python
|
|
622
632
|
from mostlyai.sdk import MostlyAI
|
|
@@ -647,16 +657,6 @@ class MostlyAI(_MostlyBaseClient):
|
|
|
647
657
|
}),
|
|
648
658
|
)
|
|
649
659
|
```
|
|
650
|
-
|
|
651
|
-
Args:
|
|
652
|
-
generator: The generator instance or its UUID.
|
|
653
|
-
size: Sample size(s) for the subject table(s).
|
|
654
|
-
seed: Seed data for the subject table(s).
|
|
655
|
-
config: Configuration for the probe.
|
|
656
|
-
return_type: Format of the return value. "auto" for pandas DataFrame if a single table, otherwise a dictionary.
|
|
657
|
-
|
|
658
|
-
Returns:
|
|
659
|
-
The created synthetic probe.
|
|
660
660
|
"""
|
|
661
661
|
config = harmonize_sd_config(
|
|
662
662
|
generator,
|
|
@@ -676,6 +676,9 @@ class MostlyAI(_MostlyBaseClient):
|
|
|
676
676
|
"""
|
|
677
677
|
Retrieve information about the current user.
|
|
678
678
|
|
|
679
|
+
Returns:
|
|
680
|
+
Information about the current user.
|
|
681
|
+
|
|
679
682
|
Example for retrieving information about the current user:
|
|
680
683
|
```python
|
|
681
684
|
from mostlyai.sdk import MostlyAI
|
|
@@ -683,9 +686,6 @@ class MostlyAI(_MostlyBaseClient):
|
|
|
683
686
|
mostly.me()
|
|
684
687
|
# {'id': '488f2f26-...', 'first_name': 'Tom', ...}
|
|
685
688
|
```
|
|
686
|
-
|
|
687
|
-
Returns:
|
|
688
|
-
Information about the current user.
|
|
689
689
|
"""
|
|
690
690
|
return self.request(verb=GET, path=["users", "me"], response_type=CurrentUser)
|
|
691
691
|
|
|
@@ -693,6 +693,9 @@ class MostlyAI(_MostlyBaseClient):
|
|
|
693
693
|
"""
|
|
694
694
|
Retrieve information about the platform.
|
|
695
695
|
|
|
696
|
+
Returns:
|
|
697
|
+
Information about the platform.
|
|
698
|
+
|
|
696
699
|
Example for retrieving information about the platform:
|
|
697
700
|
```python
|
|
698
701
|
from mostlyai.sdk import MostlyAI
|
|
@@ -700,9 +703,6 @@ class MostlyAI(_MostlyBaseClient):
|
|
|
700
703
|
mostly.about()
|
|
701
704
|
# {'version': 'v316', 'assistant': True}
|
|
702
705
|
```
|
|
703
|
-
|
|
704
|
-
Returns:
|
|
705
|
-
Information about the platform.
|
|
706
706
|
"""
|
|
707
707
|
return self.request(verb=GET, path=["about"], response_type=AboutService)
|
|
708
708
|
|
|
@@ -710,6 +710,9 @@ class MostlyAI(_MostlyBaseClient):
|
|
|
710
710
|
"""
|
|
711
711
|
Retrieve a list of available models of a specific type.
|
|
712
712
|
|
|
713
|
+
Returns:
|
|
714
|
+
A dictionary with list of available models for each ModelType.
|
|
715
|
+
|
|
713
716
|
Example for retrieving available models:
|
|
714
717
|
```python
|
|
715
718
|
from mostlyai.sdk import MostlyAI
|
|
@@ -720,9 +723,6 @@ class MostlyAI(_MostlyBaseClient):
|
|
|
720
723
|
# 'LANGUAGE": ['MOSTLY_AI/LSTMFromScratch-3m', 'microsoft/phi-1_5', ..],
|
|
721
724
|
# }
|
|
722
725
|
```
|
|
723
|
-
|
|
724
|
-
Returns:
|
|
725
|
-
A dictionary with list of available models for each ModelType.
|
|
726
726
|
"""
|
|
727
727
|
return {model_type.value: self.request(verb=GET, path=["models", model_type.value]) for model_type in ModelType}
|
|
728
728
|
|
|
@@ -730,6 +730,9 @@ class MostlyAI(_MostlyBaseClient):
|
|
|
730
730
|
"""
|
|
731
731
|
Retrieve a list of available compute resources, that can be used for executing tasks.
|
|
732
732
|
|
|
733
|
+
Returns:
|
|
734
|
+
A list of available compute resources.
|
|
735
|
+
|
|
733
736
|
Example for retrieving available compute resources:
|
|
734
737
|
```python
|
|
735
738
|
from mostlyai.sdk import MostlyAI
|
|
@@ -737,8 +740,5 @@ class MostlyAI(_MostlyBaseClient):
|
|
|
737
740
|
mostly.computes()
|
|
738
741
|
# [{'id': '...', 'name': 'CPU Large',...]
|
|
739
742
|
```
|
|
740
|
-
|
|
741
|
-
Returns:
|
|
742
|
-
A list of available compute resources.
|
|
743
743
|
"""
|
|
744
744
|
return self.request(verb=GET, path=["computes"])
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
15
|
# generated by datamodel-codegen:
|
|
16
|
-
# timestamp: 2025-03-
|
|
16
|
+
# timestamp: 2025-03-14T08:42:51+00:00
|
|
17
17
|
|
|
18
18
|
from __future__ import annotations
|
|
19
19
|
|
|
@@ -667,12 +667,14 @@ class AssistantThreadSessionStatus(str, Enum):
|
|
|
667
667
|
class AssistantMessageRole(str, Enum):
|
|
668
668
|
"""
|
|
669
669
|
The role of the author of this message
|
|
670
|
+
user - message is written by assistant user
|
|
671
|
+
assistant - message is written by assistant
|
|
672
|
+
heartbeat - used to avoid connection timeouts in case of long responses ex. python code execution
|
|
673
|
+
|
|
670
674
|
"""
|
|
671
675
|
|
|
672
|
-
system = "system"
|
|
673
676
|
user = "user"
|
|
674
677
|
assistant = "assistant"
|
|
675
|
-
tool = "tool"
|
|
676
678
|
heartbeat = "heartbeat"
|
|
677
679
|
|
|
678
680
|
|
|
@@ -684,13 +686,11 @@ class AssistantMessageContentType(str, Enum):
|
|
|
684
686
|
text = "text"
|
|
685
687
|
python = "python"
|
|
686
688
|
console = "console"
|
|
687
|
-
|
|
689
|
+
files = "files"
|
|
688
690
|
|
|
689
691
|
|
|
690
|
-
class
|
|
691
|
-
|
|
692
|
-
length = "length"
|
|
693
|
-
tool_calls = "tool_calls"
|
|
692
|
+
class AssistantMessageFile(CustomBaseModel):
|
|
693
|
+
name: str | None = None
|
|
694
694
|
|
|
695
695
|
|
|
696
696
|
class AssistantMessage(CustomBaseModel):
|
|
@@ -702,7 +702,14 @@ class AssistantMessage(CustomBaseModel):
|
|
|
702
702
|
role: AssistantMessageRole | None = None
|
|
703
703
|
content_type: AssistantMessageContentType | None = Field(None, alias="contentType")
|
|
704
704
|
content: str | None = Field(None, description="The content of a message", min_length=0)
|
|
705
|
-
|
|
705
|
+
result: str | None = Field(
|
|
706
|
+
None,
|
|
707
|
+
description="result applies only to python content type and is a result of python execution - the same console content type when streaming deltas",
|
|
708
|
+
)
|
|
709
|
+
files: list[AssistantMessageFile] | None = Field(
|
|
710
|
+
None,
|
|
711
|
+
description="files apply only to files content type and is a list of filenames",
|
|
712
|
+
)
|
|
706
713
|
tokens_consumed: int | None = Field(
|
|
707
714
|
None,
|
|
708
715
|
alias="tokensConsumed",
|
|
@@ -719,7 +726,11 @@ class AssistantMessageDelta(CustomBaseModel):
|
|
|
719
726
|
role: AssistantMessageRole | None = None
|
|
720
727
|
content_type: AssistantMessageContentType | None = Field(None, alias="contentType")
|
|
721
728
|
delta: str | None = Field(None, description="The partial content of a message", min_length=0)
|
|
722
|
-
|
|
729
|
+
is_finished: bool | None = Field(
|
|
730
|
+
None,
|
|
731
|
+
alias="isFinished",
|
|
732
|
+
description="Whether the message as a whole is finished.",
|
|
733
|
+
)
|
|
723
734
|
tokens_consumed: int | None = Field(
|
|
724
735
|
None,
|
|
725
736
|
alias="tokensConsumed",
|
|
@@ -860,13 +871,15 @@ class Visibility(str, Enum):
|
|
|
860
871
|
"""
|
|
861
872
|
Indicates the visibility of the resource.
|
|
862
873
|
|
|
863
|
-
- `PUBLIC`
|
|
864
|
-
- `
|
|
874
|
+
- `PUBLIC` - Everyone can access the resource.
|
|
875
|
+
- `UNLISTED`- Anyone with the direct link can access the resource. No public listings.
|
|
876
|
+
- `PRIVATE` - Accessible only by the owner. For organizations, all members can access.
|
|
865
877
|
|
|
866
878
|
"""
|
|
867
879
|
|
|
868
880
|
public = "PUBLIC"
|
|
869
881
|
private = "PRIVATE"
|
|
882
|
+
unlisted = "UNLISTED"
|
|
870
883
|
|
|
871
884
|
|
|
872
885
|
class OrganizationInvite(CustomBaseModel):
|
|
@@ -1721,7 +1734,7 @@ class ModelConfiguration(CustomBaseModel):
|
|
|
1721
1734
|
enable_flexible_generation: bool | None = Field(
|
|
1722
1735
|
True,
|
|
1723
1736
|
alias="enableFlexibleGeneration",
|
|
1724
|
-
description="If true, then the trained generator can be used for rebalancing and
|
|
1737
|
+
description="If true, then the trained generator can be used for conditional generation, rebalancing, imputation and fairness.\nIf none of these will be needed, then one can gain extra accuracy by disabling this feature. This will then result in a fixed \ncolumn order being fed into the training process, rather than a column order, that is randomly permuted for every batch.\n",
|
|
1725
1738
|
)
|
|
1726
1739
|
value_protection: bool | None = Field(
|
|
1727
1740
|
True,
|
|
@@ -1970,7 +1983,7 @@ class AssistantThread(CustomBaseModel):
|
|
|
1970
1983
|
session_status: AssistantThreadSessionStatus | None = Field(None, alias="sessionStatus")
|
|
1971
1984
|
messages: list[AssistantMessage] | None = Field(
|
|
1972
1985
|
None,
|
|
1973
|
-
description="List of all existing messages, excluding any system message.\nExample:\n What's the square root of 9?
|
|
1986
|
+
description="List of all existing messages, excluding any system message.\nExample:\n What's the square root of 9? role: user type: text\n ok, I will write some python role: assistant type: text\n content: r = math.sqrt(9)\\nr; result=3 role: assistant type: python\n The answer is 3! role: assistant type: text\n Plot me a random barplot role: user type: text\n ... plt.savefig() ... role: assistant type: python\n Here is ![img]() ... role: assistant type: text\n Write me a random file role: user type: text\n ... .to_csv() ... role: assistant type: python\n Here is [file]() ... role: assistant type: text\n",
|
|
1974
1987
|
)
|
|
1975
1988
|
usage: AssistantThreadUsage | None = None
|
|
1976
1989
|
|
|
@@ -3086,13 +3099,15 @@ class _SyntheticTableConfigValidation(CustomBaseModel):
|
|
|
3086
3099
|
|
|
3087
3100
|
@model_validator(mode="after")
|
|
3088
3101
|
def validate_data_report_disabled_if_both_model_reports_disabled(cls, validation):
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3102
|
+
configs = [
|
|
3103
|
+
cfg
|
|
3104
|
+
for cfg in [
|
|
3105
|
+
validation.source_table.tabular_model_configuration,
|
|
3106
|
+
validation.source_table.language_model_configuration,
|
|
3107
|
+
]
|
|
3108
|
+
if cfg
|
|
3109
|
+
]
|
|
3110
|
+
if not all(cfg.enable_model_report for cfg in configs):
|
|
3096
3111
|
if validation.synthetic_table.configuration is not None:
|
|
3097
3112
|
validation.synthetic_table.configuration.enable_data_report = False
|
|
3098
3113
|
return validation
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "mostlyai"
|
|
3
|
-
version = "4.3.
|
|
3
|
+
version = "4.3.2"
|
|
4
4
|
description = "Synthetic Data SDK"
|
|
5
5
|
authors = [{ name = "MOSTLY AI", email = "dev@mostly.ai" }]
|
|
6
6
|
requires-python = ">=3.10,<3.14"
|
|
@@ -46,8 +46,8 @@ dependencies = [
|
|
|
46
46
|
[project.optional-dependencies]
|
|
47
47
|
local = [
|
|
48
48
|
# local
|
|
49
|
-
"mostlyai-engine==1.1.
|
|
50
|
-
"mostlyai-qa==1.5.
|
|
49
|
+
"mostlyai-engine==1.1.6",
|
|
50
|
+
"mostlyai-qa==1.5.6",
|
|
51
51
|
"fastapi>=0.115.6,<0.116",
|
|
52
52
|
"uvicorn>=0.34.0,<0.35",
|
|
53
53
|
"python-multipart>=0.0.20",
|
|
@@ -68,8 +68,8 @@ local = [
|
|
|
68
68
|
"adlfs>=2023.4.0",
|
|
69
69
|
]
|
|
70
70
|
local-gpu = [
|
|
71
|
-
"mostlyai-engine[gpu]==1.1.
|
|
72
|
-
"mostlyai-qa[gpu]==1.5.
|
|
71
|
+
"mostlyai-engine[gpu]==1.1.6",
|
|
72
|
+
"mostlyai-qa[gpu]==1.5.6",
|
|
73
73
|
"fastapi>=0.115.6,<0.116",
|
|
74
74
|
"uvicorn>=0.34.0,<0.35",
|
|
75
75
|
"python-multipart>=0.0.20",
|
|
@@ -90,8 +90,8 @@ local-gpu = [
|
|
|
90
90
|
"adlfs>=2023.4.0",
|
|
91
91
|
]
|
|
92
92
|
local-cpu = [
|
|
93
|
-
"mostlyai-engine[cpu]==1.1.
|
|
94
|
-
"mostlyai-qa[cpu]==1.5.
|
|
93
|
+
"mostlyai-engine[cpu]==1.1.6",
|
|
94
|
+
"mostlyai-qa[cpu]==1.5.6",
|
|
95
95
|
"fastapi>=0.115.6,<0.116",
|
|
96
96
|
"uvicorn>=0.34.0,<0.35",
|
|
97
97
|
"python-multipart>=0.0.20",
|
|
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
|
|
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
|
{mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_local/execution/step_analyze_training_data.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_local/execution/step_encode_training_data.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mostlyai-4.3.0 → mostlyai-4.3.2}/mostlyai/sdk/_local/execution/step_generate_model_report_data.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
|
|
@@ -85,6 +85,12 @@ class _MostlyConnectorsClient(_MostlyBaseClient):
|
|
|
85
85
|
"""
|
|
86
86
|
Retrieve a connector by its ID.
|
|
87
87
|
|
|
88
|
+
Args:
|
|
89
|
+
connector_id: The unique identifier of the connector.
|
|
90
|
+
|
|
91
|
+
Returns:
|
|
92
|
+
Connector: The retrieved connector object.
|
|
93
|
+
|
|
88
94
|
Example for retrieving a connector:
|
|
89
95
|
```python
|
|
90
96
|
from mostlyai.sdk import MostlyAI
|
|
@@ -92,12 +98,6 @@ class _MostlyConnectorsClient(_MostlyBaseClient):
|
|
|
92
98
|
c = mostly.connectors.get('INSERT_YOUR_CONNECTOR_ID')
|
|
93
99
|
c
|
|
94
100
|
```
|
|
95
|
-
|
|
96
|
-
Args:
|
|
97
|
-
connector_id: The unique identifier of the connector.
|
|
98
|
-
|
|
99
|
-
Returns:
|
|
100
|
-
Connector: The retrieved connector object.
|
|
101
101
|
"""
|
|
102
102
|
if not isinstance(connector_id, str) or len(connector_id) != 36:
|
|
103
103
|
raise ValueError("The provided connector_id must be a UUID string")
|
|
File without changes
|
|
@@ -58,6 +58,16 @@ class _MostlyGeneratorsClient(_MostlyBaseClient):
|
|
|
58
58
|
|
|
59
59
|
Paginate through all generators accessible by the user.
|
|
60
60
|
|
|
61
|
+
Args:
|
|
62
|
+
offset: Offset for the entities in the response.
|
|
63
|
+
limit: Limit for the number of entities in the response.
|
|
64
|
+
status: Filter by training status.
|
|
65
|
+
search_term: Filter by name or description.
|
|
66
|
+
owner_id: Filter by owner ID.
|
|
67
|
+
|
|
68
|
+
Returns:
|
|
69
|
+
Iterator[GeneratorListItem]: An iterator over generator list items.
|
|
70
|
+
|
|
61
71
|
Example for listing all generators:
|
|
62
72
|
```python
|
|
63
73
|
from mostlyai.sdk import MostlyAI
|
|
@@ -73,16 +83,6 @@ class _MostlyGeneratorsClient(_MostlyBaseClient):
|
|
|
73
83
|
generators = list(mostly.generators.list(search_term="census", status="DONE"))
|
|
74
84
|
print(f"Found {len(generators)} generators")
|
|
75
85
|
```
|
|
76
|
-
|
|
77
|
-
Args:
|
|
78
|
-
offset: Offset for the entities in the response.
|
|
79
|
-
limit: Limit for the number of entities in the response.
|
|
80
|
-
status: Filter by training status.
|
|
81
|
-
search_term: Filter by name or description.
|
|
82
|
-
owner_id: Filter by owner ID.
|
|
83
|
-
|
|
84
|
-
Returns:
|
|
85
|
-
Iterator[GeneratorListItem]: An iterator over generator list items.
|
|
86
86
|
"""
|
|
87
87
|
status = ",".join(status) if isinstance(status, list) else status
|
|
88
88
|
with Paginator(
|
|
@@ -103,6 +103,9 @@ class _MostlyGeneratorsClient(_MostlyBaseClient):
|
|
|
103
103
|
Args:
|
|
104
104
|
generator_id: The unique identifier of the generator.
|
|
105
105
|
|
|
106
|
+
Returns:
|
|
107
|
+
Generator: The retrieved generator object.
|
|
108
|
+
|
|
106
109
|
Example for retrieving a generator:
|
|
107
110
|
```python
|
|
108
111
|
from mostlyai.sdk import MostlyAI
|
|
@@ -110,9 +113,6 @@ class _MostlyGeneratorsClient(_MostlyBaseClient):
|
|
|
110
113
|
g = mostly.generators.get('INSERT_YOUR_GENERATOR_ID')
|
|
111
114
|
g
|
|
112
115
|
```
|
|
113
|
-
|
|
114
|
-
Returns:
|
|
115
|
-
Generator: The retrieved generator object.
|
|
116
116
|
"""
|
|
117
117
|
if not isinstance(generator_id, str) or len(generator_id) != 36:
|
|
118
118
|
raise ValueError("The provided generator_id must be a UUID string")
|
|
@@ -125,6 +125,12 @@ class _MostlyGeneratorsClient(_MostlyBaseClient):
|
|
|
125
125
|
|
|
126
126
|
See [`mostly.train`](api_client.md#mostlyai.sdk.client.api.MostlyAI.train) for more details.
|
|
127
127
|
|
|
128
|
+
Args:
|
|
129
|
+
config: Configuration for the generator.
|
|
130
|
+
|
|
131
|
+
Returns:
|
|
132
|
+
The created generator object.
|
|
133
|
+
|
|
128
134
|
Example for creating a generator:
|
|
129
135
|
```python
|
|
130
136
|
from mostlyai.sdk import MostlyAI
|
|
@@ -147,12 +153,6 @@ class _MostlyGeneratorsClient(_MostlyBaseClient):
|
|
|
147
153
|
print("status:", g.training_status)
|
|
148
154
|
# status: DONE
|
|
149
155
|
```
|
|
150
|
-
|
|
151
|
-
Args:
|
|
152
|
-
config: Configuration for the generator.
|
|
153
|
-
|
|
154
|
-
Returns:
|
|
155
|
-
The created generator object.
|
|
156
156
|
"""
|
|
157
157
|
if isinstance(config, dict) and config.get("tables"):
|
|
158
158
|
for table in config["tables"]:
|
|
@@ -189,6 +189,12 @@ class _MostlyGeneratorsClient(_MostlyBaseClient):
|
|
|
189
189
|
"""
|
|
190
190
|
Import a generator from a file.
|
|
191
191
|
|
|
192
|
+
Args:
|
|
193
|
+
file_path: Path to the file to import.
|
|
194
|
+
|
|
195
|
+
Returns:
|
|
196
|
+
The imported generator object.
|
|
197
|
+
|
|
192
198
|
Example for importing a generator from a file:
|
|
193
199
|
```python
|
|
194
200
|
from mostlyai.sdk import MostlyAI
|
|
@@ -196,12 +202,6 @@ class _MostlyGeneratorsClient(_MostlyBaseClient):
|
|
|
196
202
|
g = mostly.generators.import_from_file('path/to/generator')
|
|
197
203
|
g
|
|
198
204
|
```
|
|
199
|
-
|
|
200
|
-
Args:
|
|
201
|
-
file_path: Path to the file to import.
|
|
202
|
-
|
|
203
|
-
Returns:
|
|
204
|
-
The imported generator object.
|
|
205
205
|
"""
|
|
206
206
|
generator = self.request(
|
|
207
207
|
verb=POST,
|
|
@@ -61,6 +61,16 @@ class _MostlySyntheticDatasetsClient(_MostlyBaseClient):
|
|
|
61
61
|
|
|
62
62
|
Paginate through all synthetic datasets accessible by the user.
|
|
63
63
|
|
|
64
|
+
Args:
|
|
65
|
+
offset: Offset for the entities in the response.
|
|
66
|
+
limit: Limit for the number of entities in the response.
|
|
67
|
+
status: Filter by generation status.
|
|
68
|
+
search_term: Filter by name or description.
|
|
69
|
+
owner_id: Filter by owner ID.
|
|
70
|
+
|
|
71
|
+
Returns:
|
|
72
|
+
An iterator over synthetic datasets.
|
|
73
|
+
|
|
64
74
|
Example for listing all synthetic datasets:
|
|
65
75
|
```python
|
|
66
76
|
from mostlyai.sdk import MostlyAI
|
|
@@ -76,16 +86,6 @@ class _MostlySyntheticDatasetsClient(_MostlyBaseClient):
|
|
|
76
86
|
datasets = list(mostly.synthetic_datasets.list(search_term="census", status="DONE"))
|
|
77
87
|
print(f"Found {len(datasets)} synthetic datasets")
|
|
78
88
|
```
|
|
79
|
-
|
|
80
|
-
Args:
|
|
81
|
-
offset: Offset for the entities in the response.
|
|
82
|
-
limit: Limit for the number of entities in the response.
|
|
83
|
-
status: Filter by generation status.
|
|
84
|
-
search_term: Filter by name or description.
|
|
85
|
-
owner_id: Filter by owner ID.
|
|
86
|
-
|
|
87
|
-
Returns:
|
|
88
|
-
An iterator over synthetic datasets.
|
|
89
89
|
"""
|
|
90
90
|
status = ",".join(status) if isinstance(status, list) else status
|
|
91
91
|
with Paginator(
|
|
@@ -103,6 +103,12 @@ class _MostlySyntheticDatasetsClient(_MostlyBaseClient):
|
|
|
103
103
|
"""
|
|
104
104
|
Retrieve a synthetic dataset by its ID.
|
|
105
105
|
|
|
106
|
+
Args:
|
|
107
|
+
synthetic_dataset_id: The unique identifier of the synthetic dataset.
|
|
108
|
+
|
|
109
|
+
Returns:
|
|
110
|
+
SyntheticDataset: The retrieved synthetic dataset object.
|
|
111
|
+
|
|
106
112
|
Example for retrieving a synthetic dataset:
|
|
107
113
|
```python
|
|
108
114
|
from mostlyai.sdk import MostlyAI
|
|
@@ -110,12 +116,6 @@ class _MostlySyntheticDatasetsClient(_MostlyBaseClient):
|
|
|
110
116
|
sd = mostly.synthetic_datasets.get('INSERT_YOUR_SYNTHETIC_DATASET_ID')
|
|
111
117
|
sd
|
|
112
118
|
```
|
|
113
|
-
|
|
114
|
-
Args:
|
|
115
|
-
synthetic_dataset_id: The unique identifier of the synthetic dataset.
|
|
116
|
-
|
|
117
|
-
Returns:
|
|
118
|
-
SyntheticDataset: The retrieved synthetic dataset object.
|
|
119
119
|
"""
|
|
120
120
|
if not isinstance(synthetic_dataset_id, str) or len(synthetic_dataset_id) != 36:
|
|
121
121
|
raise ValueError("The provided synthetic_dataset_id must be a UUID string")
|
|
@@ -128,6 +128,12 @@ class _MostlySyntheticDatasetsClient(_MostlyBaseClient):
|
|
|
128
128
|
|
|
129
129
|
See [`mostly.generate`](api_client.md#mostlyai.sdk.client.api.MostlyAI.generate) for more details.
|
|
130
130
|
|
|
131
|
+
Args:
|
|
132
|
+
config: Configuration for the synthetic dataset.
|
|
133
|
+
|
|
134
|
+
Returns:
|
|
135
|
+
The created synthetic dataset object.
|
|
136
|
+
|
|
131
137
|
Example for creating a synthetic dataset:
|
|
132
138
|
```python
|
|
133
139
|
from mostlyai.sdk import MostlyAI
|
|
@@ -146,12 +152,6 @@ class _MostlySyntheticDatasetsClient(_MostlyBaseClient):
|
|
|
146
152
|
print("status:", sd.generation_status)
|
|
147
153
|
# status: DONE
|
|
148
154
|
```
|
|
149
|
-
|
|
150
|
-
Args:
|
|
151
|
-
config: Configuration for the synthetic dataset.
|
|
152
|
-
|
|
153
|
-
Returns:
|
|
154
|
-
The created synthetic dataset object.
|
|
155
155
|
"""
|
|
156
156
|
synthetic_dataset = self.request(
|
|
157
157
|
verb=POST,
|