mostlyai 5.2.4__tar.gz → 5.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.
Files changed (88) hide show
  1. {mostlyai-5.2.4 → mostlyai-5.2.6}/PKG-INFO +9 -9
  2. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/__init__.py +1 -1
  3. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_local/synthetic_datasets.py +8 -8
  4. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/client/_utils.py +0 -2
  5. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/client/artifacts.py +2 -2
  6. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/client/base.py +11 -8
  7. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/client/connectors.py +17 -17
  8. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/client/datasets.py +3 -1
  9. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/client/generators.py +7 -5
  10. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/client/synthetic_datasets.py +4 -1
  11. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/domain.py +41 -15
  12. {mostlyai-5.2.4 → mostlyai-5.2.6}/pyproject.toml +9 -9
  13. {mostlyai-5.2.4 → mostlyai-5.2.6}/.gitignore +0 -0
  14. {mostlyai-5.2.4 → mostlyai-5.2.6}/LICENSE +0 -0
  15. {mostlyai-5.2.4 → mostlyai-5.2.6}/README.md +0 -0
  16. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/__init__.py +0 -0
  17. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/auto_detect.py +0 -0
  18. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/base.py +0 -0
  19. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/context.py +0 -0
  20. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/conversions.py +0 -0
  21. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/db/__init__.py +0 -0
  22. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/db/base.py +0 -0
  23. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/db/bigquery.py +0 -0
  24. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/db/databricks.py +0 -0
  25. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/db/hive.py +0 -0
  26. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/db/mssql.py +0 -0
  27. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/db/mysql.py +0 -0
  28. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/db/oracle.py +0 -0
  29. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/db/postgresql.py +0 -0
  30. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/db/snowflake.py +0 -0
  31. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/db/sqlite.py +0 -0
  32. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/db/types_coercion.py +0 -0
  33. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/dtype.py +0 -0
  34. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/exceptions.py +0 -0
  35. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/file/__init__.py +0 -0
  36. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/file/base.py +0 -0
  37. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/file/container/__init__.py +0 -0
  38. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/file/container/aws.py +0 -0
  39. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/file/container/azure.py +0 -0
  40. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/file/container/bucket_based.py +0 -0
  41. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/file/container/gcs.py +0 -0
  42. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/file/container/minio.py +0 -0
  43. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/file/table/__init__.py +0 -0
  44. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/file/table/csv.py +0 -0
  45. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/file/table/feather.py +0 -0
  46. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/file/table/json.py +0 -0
  47. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/file/table/parquet.py +0 -0
  48. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/file/utils.py +0 -0
  49. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/language_model.py +0 -0
  50. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/metadata_objects.py +0 -0
  51. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/non_context.py +0 -0
  52. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/progress_callback.py +0 -0
  53. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/pull.py +0 -0
  54. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/pull_context.py +0 -0
  55. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/pull_utils.py +0 -0
  56. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/push.py +0 -0
  57. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/util/__init__.py +0 -0
  58. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/util/common.py +0 -0
  59. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_data/util/kerberos.py +0 -0
  60. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_local/__init__.py +0 -0
  61. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_local/cli.py +0 -0
  62. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_local/connectors.py +0 -0
  63. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_local/execution/__init__.py +0 -0
  64. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_local/execution/jobs.py +0 -0
  65. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_local/execution/migration.py +0 -0
  66. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_local/execution/plan.py +0 -0
  67. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_local/execution/step_analyze_training_data.py +0 -0
  68. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_local/execution/step_create_data_report.py +0 -0
  69. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_local/execution/step_create_model_report.py +0 -0
  70. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_local/execution/step_deliver_data.py +0 -0
  71. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_local/execution/step_encode_training_data.py +0 -0
  72. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_local/execution/step_finalize_generation.py +0 -0
  73. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_local/execution/step_finalize_training.py +0 -0
  74. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_local/execution/step_generate_data.py +0 -0
  75. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_local/execution/step_generate_model_report_data.py +0 -0
  76. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_local/execution/step_pull_training_data.py +0 -0
  77. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_local/execution/step_train_model.py +0 -0
  78. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_local/generators.py +0 -0
  79. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_local/progress.py +0 -0
  80. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_local/routes.py +0 -0
  81. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_local/server.py +0 -0
  82. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/_local/storage.py +0 -0
  83. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/client/__init__.py +0 -0
  84. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/client/_base_utils.py +0 -0
  85. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/client/_naming_conventions.py +0 -0
  86. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/client/api.py +0 -0
  87. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/client/exceptions.py +0 -0
  88. {mostlyai-5.2.4 → mostlyai-5.2.6}/mostlyai/sdk/py.typed +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mostlyai
3
- Version: 5.2.4
3
+ Version: 5.2.6
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
@@ -59,7 +59,7 @@ Requires-Dist: fastapi<0.116,>=0.115.6; extra == 'local'
59
59
  Requires-Dist: filelock>=3.16.1; extra == 'local'
60
60
  Requires-Dist: gcsfs>=2023.1.0; extra == 'local'
61
61
  Requires-Dist: joblib>=1.4.2; extra == 'local'
62
- Requires-Dist: mostlyai-engine==1.5.5; extra == 'local'
62
+ Requires-Dist: mostlyai-engine==1.5.7; extra == 'local'
63
63
  Requires-Dist: mostlyai-qa==1.9.8; extra == 'local'
64
64
  Requires-Dist: networkx<4,>=3.0; extra == 'local'
65
65
  Requires-Dist: openpyxl>=3.1.5; extra == 'local'
@@ -68,9 +68,9 @@ Requires-Dist: s3fs>=2023.1.0; extra == 'local'
68
68
  Requires-Dist: smart-open[azure,gcs,s3]>=6.3.0; extra == 'local'
69
69
  Requires-Dist: sqlalchemy>=2.0.0; extra == 'local'
70
70
  Requires-Dist: sshtunnel<0.5,>=0.4.0; extra == 'local'
71
- Requires-Dist: torch<2.7.1,>=2.7.0; extra == 'local'
72
- Requires-Dist: torchaudio<2.7.1,>=2.7.0; extra == 'local'
73
- Requires-Dist: torchvision<0.22.1,>=0.22.0; extra == 'local'
71
+ Requires-Dist: torch<2.8.1,>=2.8.0; extra == 'local'
72
+ Requires-Dist: torchaudio<2.8.1,>=2.8.0; extra == 'local'
73
+ Requires-Dist: torchvision<0.23.1,>=0.23.0; extra == 'local'
74
74
  Requires-Dist: uvicorn<0.35,>=0.34.0; extra == 'local'
75
75
  Requires-Dist: xlsxwriter<4,>=3.1.9; extra == 'local'
76
76
  Provides-Extra: local-gpu
@@ -81,7 +81,7 @@ Requires-Dist: fastapi<0.116,>=0.115.6; extra == 'local-gpu'
81
81
  Requires-Dist: filelock>=3.16.1; extra == 'local-gpu'
82
82
  Requires-Dist: gcsfs>=2023.1.0; extra == 'local-gpu'
83
83
  Requires-Dist: joblib>=1.4.2; extra == 'local-gpu'
84
- Requires-Dist: mostlyai-engine[gpu]==1.5.5; extra == 'local-gpu'
84
+ Requires-Dist: mostlyai-engine[gpu]==1.5.7; extra == 'local-gpu'
85
85
  Requires-Dist: mostlyai-qa==1.9.8; extra == 'local-gpu'
86
86
  Requires-Dist: networkx<4,>=3.0; extra == 'local-gpu'
87
87
  Requires-Dist: openpyxl>=3.1.5; extra == 'local-gpu'
@@ -90,9 +90,9 @@ Requires-Dist: s3fs>=2023.1.0; extra == 'local-gpu'
90
90
  Requires-Dist: smart-open[azure,gcs,s3]>=6.3.0; extra == 'local-gpu'
91
91
  Requires-Dist: sqlalchemy>=2.0.0; extra == 'local-gpu'
92
92
  Requires-Dist: sshtunnel<0.5,>=0.4.0; extra == 'local-gpu'
93
- Requires-Dist: torch<2.7.1,>=2.7.0; extra == 'local-gpu'
94
- Requires-Dist: torchaudio<2.7.1,>=2.7.0; extra == 'local-gpu'
95
- Requires-Dist: torchvision<0.22.1,>=0.22.0; extra == 'local-gpu'
93
+ Requires-Dist: torch<2.8.1,>=2.8.0; extra == 'local-gpu'
94
+ Requires-Dist: torchaudio<2.8.1,>=2.8.0; extra == 'local-gpu'
95
+ Requires-Dist: torchvision<0.23.1,>=0.23.0; extra == 'local-gpu'
96
96
  Requires-Dist: uvicorn<0.35,>=0.34.0; extra == 'local-gpu'
97
97
  Requires-Dist: xlsxwriter<4,>=3.1.9; extra == 'local-gpu'
98
98
  Provides-Extra: mssql
@@ -15,4 +15,4 @@
15
15
  from mostlyai.sdk.client.api import MostlyAI
16
16
 
17
17
  __all__ = ["MostlyAI"]
18
- __version__ = "5.2.4" # Do not set this manually. Use poetry version [params].
18
+ __version__ = "5.2.6" # Do not set this manually. Use poetry version [params].
@@ -97,14 +97,14 @@ def create_synthetic_dataset(
97
97
  sd_tables.append(sd_table)
98
98
 
99
99
  # create synthetic dataset
100
- synthetic_dataset = SyntheticDataset(
101
- **{
102
- **config.model_dump(),
103
- "generation_status": ProgressStatus.new,
104
- "tables": sd_tables,
105
- }
106
- )
107
- synthetic_dataset.name = synthetic_dataset.name or generator.name
100
+ full_config = {
101
+ **config.model_dump(),
102
+ "generation_status": ProgressStatus.new,
103
+ "tables": sd_tables,
104
+ }
105
+ if full_config.get("name") is None:
106
+ full_config["name"] = generator.name
107
+ synthetic_dataset = SyntheticDataset(**full_config)
108
108
  synthetic_dataset.description = synthetic_dataset.description or generator.description
109
109
  synthetic_dataset_dir = home_dir / "synthetic-datasets" / synthetic_dataset.id
110
110
  write_synthetic_dataset_to_json(synthetic_dataset_dir, synthetic_dataset)
@@ -35,7 +35,6 @@ from rich.style import Style
35
35
  from rich.table import Table
36
36
  from rich.text import Text
37
37
 
38
- from mostlyai.sdk.client._naming_conventions import map_camel_to_snake_case
39
38
  from mostlyai.sdk.client.exceptions import APIError
40
39
  from mostlyai.sdk.domain import (
41
40
  Generator,
@@ -332,7 +331,6 @@ def harmonize_sd_config(
332
331
  if config is None:
333
332
  config = config_type()
334
333
  elif isinstance(config, dict):
335
- config = map_camel_to_snake_case(config)
336
334
  config = config_type(**config)
337
335
 
338
336
  size = size if size is not None else {}
@@ -12,7 +12,6 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- from typing import Any
16
15
 
17
16
  from mostlyai.sdk.client.base import (
18
17
  GET,
@@ -53,12 +52,13 @@ class _MostlyArtifactsClient(_MostlyBaseClient):
53
52
  def _update(
54
53
  self,
55
54
  artifact_id: str,
56
- config: ArtifactPatchConfig | dict[str, Any],
55
+ config: ArtifactPatchConfig,
57
56
  ) -> Artifact:
58
57
  response = self.request(
59
58
  verb=PATCH,
60
59
  path=[artifact_id],
61
60
  json=config,
61
+ exclude_none_in_json=True,
62
62
  response_type=Artifact,
63
63
  )
64
64
  return response
@@ -95,8 +95,8 @@ class _MostlyBaseClient:
95
95
  response_type: type = dict,
96
96
  raw_response: bool = False,
97
97
  is_api_call: bool = True,
98
- do_json_camel_case: bool = True,
99
98
  do_response_dict_snake_case: bool = True,
99
+ exclude_none_in_json: bool = False,
100
100
  do_include_client: bool = True,
101
101
  extra_key_values: dict | None = None,
102
102
  **kwargs,
@@ -110,7 +110,7 @@ class _MostlyBaseClient:
110
110
  response_type (type | None): Type to cast the response into. Defaults to dict.
111
111
  raw_response (bool): Whether to return the raw response object. Defaults to False.
112
112
  is_api_call (bool): If False, skips prefixing API_SECTION and SECTION. Defaults to True.
113
- do_json_camel_case (bool): Convert the provided JSON to camelCase. Defaults to True.
113
+ exclude_none_in_json (bool): Whether to exclude fields with value None when dumping the json. Defaults to False.
114
114
  do_response_dict_snake_case (bool): Convert the response dictionary to snake_case. Defaults to True.
115
115
  do_include_client (bool): Include the client property in the returned object. Defaults to True.
116
116
  extra_key_values (dict | None): Additional key-value pairs to include in the response object.
@@ -133,13 +133,16 @@ class _MostlyBaseClient:
133
133
  if (request_size := _get_total_size(kwargs)) > MAX_REQUEST_SIZE:
134
134
  warnings.warn(f"The overall {request_size=} exceeds {MAX_REQUEST_SIZE}.", UserWarning)
135
135
 
136
- if "json" in kwargs and do_json_camel_case:
136
+ if "json" in kwargs:
137
137
  if isinstance(kwargs["json"], BaseModel):
138
- kwargs["json"] = kwargs["json"].model_dump()
139
- kwargs["json"] = map_snake_to_camel_case(kwargs["json"])
140
- if "params" in kwargs and do_json_camel_case:
141
- if isinstance(kwargs["params"], BaseModel):
142
- kwargs["params"] = kwargs["params"].model_dump()
138
+ kwargs["json"] = kwargs["json"].model_dump(
139
+ mode="json", by_alias=True, exclude_none=exclude_none_in_json
140
+ )
141
+ else:
142
+ raise ValueError("argument `json` must have been converted to a pydantic model")
143
+ if "params" in kwargs:
144
+ # params should have been a dict with camelCase keys
145
+ # but just in case, we do a best effort conversion
143
146
  kwargs["params"] = map_snake_to_camel_case(kwargs["params"])
144
147
 
145
148
  try:
@@ -32,8 +32,12 @@ from mostlyai.sdk.client.base import (
32
32
  from mostlyai.sdk.domain import (
33
33
  Connector,
34
34
  ConnectorConfig,
35
+ ConnectorDeleteDataConfig,
35
36
  ConnectorListItem,
36
37
  ConnectorPatchConfig,
38
+ ConnectorQueryConfig,
39
+ ConnectorReadDataConfig,
40
+ ConnectorWriteDataConfig,
37
41
  IfExists,
38
42
  )
39
43
 
@@ -137,11 +141,12 @@ class _MostlyConnectorsClient(_MostlyBaseClient):
137
141
  Returns:
138
142
  The created connector object.
139
143
  """
144
+ config = ConnectorConfig.model_validate(config)
140
145
  connector = self.request(
141
146
  verb=POST,
142
147
  path=[],
143
148
  json=config,
144
- params={"test_connection": test_connection},
149
+ params={"testConnection": test_connection},
145
150
  response_type=Connector,
146
151
  )
147
152
  cid = connector.id
@@ -156,14 +161,15 @@ class _MostlyConnectorsClient(_MostlyBaseClient):
156
161
  def _update(
157
162
  self,
158
163
  connector_id: str,
159
- config: ConnectorPatchConfig | dict[str, Any],
164
+ config: ConnectorPatchConfig,
160
165
  test_connection: bool | None = True,
161
166
  ) -> Connector:
162
167
  response = self.request(
163
168
  verb=PATCH,
164
169
  path=[connector_id],
165
170
  json=config,
166
- params={"test_connection": test_connection},
171
+ params={"testConnection": test_connection},
172
+ exclude_none_in_json=True,
167
173
  response_type=Connector,
168
174
  )
169
175
  return response
@@ -189,7 +195,7 @@ class _MostlyConnectorsClient(_MostlyBaseClient):
189
195
  response = self.request(
190
196
  verb=POST,
191
197
  path=[connector_id, "read-data"],
192
- json={"location": location, "limit": limit, "shuffle": shuffle},
198
+ json=ConnectorReadDataConfig(location=location, limit=limit, shuffle=shuffle),
193
199
  headers={
194
200
  "Content-Type": "application/json",
195
201
  "Accept": "application/octet-stream, application/json",
@@ -211,35 +217,29 @@ class _MostlyConnectorsClient(_MostlyBaseClient):
211
217
  files = {
212
218
  "file": ("data.parquet", buffer, "application/octet-stream"),
213
219
  }
214
-
215
- config_data = {
216
- "location": location,
217
- "ifExists": if_exists.upper(),
218
- }
219
-
220
+ non_file_config = ConnectorWriteDataConfig(file=b"", location=location, if_exists=if_exists).model_dump(
221
+ mode="json", by_alias=True
222
+ )
223
+ non_file_config.pop("file")
220
224
  self.request(
221
225
  verb="POST",
222
226
  path=[connector_id, "write-data"],
223
227
  files=files,
224
- data=config_data,
228
+ data=non_file_config,
225
229
  )
226
230
 
227
231
  def _delete_data(self, connector_id: str, location: str) -> None:
228
- config_data = {
229
- "location": location,
230
- }
231
-
232
232
  self.request(
233
233
  verb="POST",
234
234
  path=[connector_id, "delete-data"],
235
- json=config_data,
235
+ json=ConnectorDeleteDataConfig(location=location),
236
236
  )
237
237
 
238
238
  def _query(self, connector_id: str, sql: str) -> pd.DataFrame:
239
239
  response = self.request(
240
240
  verb=POST,
241
241
  path=[connector_id, "query"],
242
- json={"sql": sql},
242
+ json=ConnectorQueryConfig(sql=sql),
243
243
  headers={
244
244
  "Content-Type": "application/json",
245
245
  "Accept": "application/octet-stream, application/json",
@@ -162,6 +162,7 @@ class _MostlyDatasetsClient(_MostlyBaseClient):
162
162
  ds.upload_file("path/to/file_2.txt")
163
163
  ```
164
164
  """
165
+ config = DatasetConfig.model_validate(config)
165
166
  dataset = self.request(
166
167
  verb=POST,
167
168
  path=[],
@@ -178,12 +179,13 @@ class _MostlyDatasetsClient(_MostlyBaseClient):
178
179
  def _update(
179
180
  self,
180
181
  dataset_id: str,
181
- config: DatasetPatchConfig | dict[str, Any],
182
+ config: DatasetPatchConfig,
182
183
  ) -> Dataset:
183
184
  response = self.request(
184
185
  verb=PATCH,
185
186
  path=[dataset_id],
186
187
  json=config,
188
+ exclude_none_in_json=True,
187
189
  response_type=Dataset,
188
190
  )
189
191
  return response
@@ -17,7 +17,6 @@ import re
17
17
  import tempfile
18
18
  from collections.abc import Iterator
19
19
  from pathlib import Path
20
- from typing import Any
21
20
  from urllib.parse import urlparse
22
21
 
23
22
  import pandas as pd
@@ -36,6 +35,7 @@ from mostlyai.sdk.client.base import (
36
35
  )
37
36
  from mostlyai.sdk.domain import (
38
37
  Generator,
38
+ GeneratorCloneConfig,
39
39
  GeneratorConfig,
40
40
  GeneratorListItem,
41
41
  GeneratorPatchConfig,
@@ -170,8 +170,8 @@ class _MostlyGeneratorsClient(_MostlyBaseClient):
170
170
  # status: DONE
171
171
  ```
172
172
  """
173
- if isinstance(config, dict) and config.get("tables"):
174
- for table in config["tables"]:
173
+ if isinstance(config, dict):
174
+ for table in config.get("tables", []):
175
175
  # convert `data` to base64-encoded Parquet files
176
176
  if table.get("data") is not None:
177
177
  if isinstance(table["data"], (str, Path)):
@@ -190,6 +190,7 @@ class _MostlyGeneratorsClient(_MostlyBaseClient):
190
190
  if table.get("columns"):
191
191
  # convert `columns` to list[dict], if provided as list[str]
192
192
  table["columns"] = [{"name": col} if isinstance(col, str) else col for col in table["columns"]]
193
+ config = GeneratorConfig.model_validate(config)
193
194
  generator = self.request(verb=POST, path=[], json=config, response_type=Generator)
194
195
  gid = generator.id
195
196
  if self.local:
@@ -286,11 +287,12 @@ class _MostlyGeneratorsClient(_MostlyBaseClient):
286
287
  filename = f"generator-{generator_id[:8]}.zip"
287
288
  return content_bytes, filename
288
289
 
289
- def _update(self, generator_id: str, config: GeneratorPatchConfig | dict[str, Any]) -> Generator:
290
+ def _update(self, generator_id: str, config: GeneratorPatchConfig) -> Generator:
290
291
  response = self.request(
291
292
  verb=PATCH,
292
293
  path=[generator_id],
293
294
  json=config,
295
+ exclude_none_in_json=True,
294
296
  response_type=Generator,
295
297
  )
296
298
  return response
@@ -303,7 +305,7 @@ class _MostlyGeneratorsClient(_MostlyBaseClient):
303
305
  response = self.request(
304
306
  verb=POST,
305
307
  path=[generator_id, "clone"],
306
- json={"trainingStatus": training_status.upper()},
308
+ json=GeneratorCloneConfig(training_status=training_status.upper()),
307
309
  response_type=Generator,
308
310
  )
309
311
  return response
@@ -165,6 +165,7 @@ class _MostlySyntheticDatasetsClient(_MostlyBaseClient):
165
165
  # status: DONE
166
166
  ```
167
167
  """
168
+ config = SyntheticDatasetConfig.model_validate(config)
168
169
  synthetic_dataset = self.request(
169
170
  verb=POST,
170
171
  path=[],
@@ -186,12 +187,13 @@ class _MostlySyntheticDatasetsClient(_MostlyBaseClient):
186
187
  def _update(
187
188
  self,
188
189
  synthetic_dataset_id: str,
189
- config: SyntheticDatasetPatchConfig | dict[str, Any],
190
+ config: SyntheticDatasetPatchConfig,
190
191
  ) -> SyntheticDataset:
191
192
  response = self.request(
192
193
  verb=PATCH,
193
194
  path=[synthetic_dataset_id],
194
195
  json=config,
196
+ exclude_none_in_json=True,
195
197
  response_type=SyntheticDataset,
196
198
  )
197
199
  return response
@@ -335,6 +337,7 @@ class _MostlySyntheticProbesClient(_MostlyBaseClient):
335
337
  Returns:
336
338
  A dictionary mapping probe names to pandas DataFrames.
337
339
  """
340
+ config = SyntheticProbeConfig.model_validate(config)
338
341
  dicts = self.request(
339
342
  verb=POST,
340
343
  path=[],
@@ -13,7 +13,7 @@
13
13
  # limitations under the License.
14
14
 
15
15
  # generated by datamodel-codegen:
16
- # timestamp: 2025-09-12T09:16:21+00:00
16
+ # timestamp: 2025-09-23T08:04:50+00:00
17
17
 
18
18
  from __future__ import annotations
19
19
 
@@ -631,7 +631,7 @@ class SourceForeignKey(CustomBaseModel):
631
631
  return values
632
632
 
633
633
 
634
- class GeneratorCloneTrainingStatus(Enum):
634
+ class GeneratorCloneTrainingStatus(str, Enum):
635
635
  """
636
636
  The training status of the new generator. The available options are:
637
637
 
@@ -697,6 +697,11 @@ class SourceForeignKeyPatchConfig(CustomBaseModel):
697
697
  )
698
698
 
699
699
 
700
+ class AssistantThreadSortField(str, Enum):
701
+ recency = "RECENCY"
702
+ last_message_at = "LAST_MESSAGE_AT"
703
+
704
+
700
705
  class GeneratorSortField(str, Enum):
701
706
  recency = "RECENCY"
702
707
  no_of_likes = "NO_OF_LIKES"
@@ -1419,6 +1424,7 @@ class Price(CustomBaseModel):
1419
1424
  The price information for a plan.
1420
1425
  """
1421
1426
 
1427
+ id: str | None = Field(None, description="The unique identifier of the price.")
1422
1428
  value: float = Field(..., description="The price value.")
1423
1429
  currency: str = Field(..., description="The currency code for the price.", examples=["USD"])
1424
1430
  metadata: dict[str, str] = Field(..., description="The metadata of the price.")
@@ -1433,12 +1439,19 @@ class Plan(CustomBaseModel):
1433
1439
  name: str = Field(..., description="The name of the plan.")
1434
1440
  billing_interval: BillingInterval | None = Field(None, alias="billingInterval")
1435
1441
  price: Price
1436
- payment_url: AnyUrl | None = Field(None, alias="paymentUrl", description="The URL for purchasing this plan.")
1437
1442
  description: str | None = Field(None, description="The description of the plan.")
1438
1443
  features: list[str] | None = None
1439
1444
  metadata: dict[str, str] | None = Field(None, description="The metadata of the plan.")
1440
1445
 
1441
1446
 
1447
+ class PaymentUrl(CustomBaseModel):
1448
+ """
1449
+ The URL for purchasing a plan.
1450
+ """
1451
+
1452
+ value: AnyUrl | None = None
1453
+
1454
+
1442
1455
  class PlanUpdateConfig(CustomBaseModel):
1443
1456
  """
1444
1457
  Request to upgrade or downgrade the user's plan.
@@ -2026,7 +2039,7 @@ class Dataset(CustomBaseModel):
2026
2039
  """
2027
2040
 
2028
2041
  id: str = Field(..., description="The unique identifier of a dataset.")
2029
- name: str | None = Field(None, description="The name of a dataset.")
2042
+ name: str = Field(..., description="The name of a dataset.")
2030
2043
  description: str | None = Field(None, description="The description of / instructions for a dataset.")
2031
2044
  connectors: list[DatasetConnector] | None = None
2032
2045
  files: list[str] | None = None
@@ -2040,6 +2053,8 @@ class Dataset(CustomBaseModel):
2040
2053
  if isinstance(values, dict):
2041
2054
  if "id" not in values:
2042
2055
  values["id"] = str(uuid.uuid4())
2056
+ if values.get("name") is None:
2057
+ values["name"] = "New dataset"
2043
2058
  return values
2044
2059
 
2045
2060
  @field_validator("files", mode="after")
@@ -2128,7 +2143,7 @@ class DatasetListItem(CustomBaseModel):
2128
2143
  """
2129
2144
 
2130
2145
  id: str = Field(..., description="The unique identifier of a dataset.")
2131
- name: str | None = Field(None, description="The name of a dataset.")
2146
+ name: str = Field(..., description="The name of a dataset.")
2132
2147
  usage: DatasetUsage | None = None
2133
2148
  metadata: Metadata | None = None
2134
2149
 
@@ -2210,6 +2225,8 @@ class Connector(CustomBaseModel):
2210
2225
  if isinstance(values, dict):
2211
2226
  if "id" not in values:
2212
2227
  values["id"] = str(uuid.uuid4())
2228
+ if values.get("name") is None:
2229
+ values["name"] = "New connector"
2213
2230
  return values
2214
2231
 
2215
2232
  def update(
@@ -2244,7 +2261,7 @@ class Connector(CustomBaseModel):
2244
2261
  )
2245
2262
  self.client._update(
2246
2263
  connector_id=self.id,
2247
- config=patch_config.model_dump(exclude_none=True),
2264
+ config=patch_config,
2248
2265
  test_connection=test_connection,
2249
2266
  )
2250
2267
  self.reload()
@@ -2358,7 +2375,12 @@ class Connector(CustomBaseModel):
2358
2375
  c.write_data(df, 's3://my_bucket/path/to/file.csv') # write data to 'file.csv' in 'my_bucket' for a S3 storage connector
2359
2376
  ```
2360
2377
  """
2361
- self.client._write_data(connector_id=self.id, data=data, location=location, if_exists=if_exists)
2378
+ self.client._write_data(
2379
+ connector_id=self.id,
2380
+ data=data,
2381
+ location=location,
2382
+ if_exists=if_exists.upper(),
2383
+ )
2362
2384
 
2363
2385
  def delete_data(self, location: str) -> None:
2364
2386
  """
@@ -2406,7 +2428,7 @@ class GeneratorListItem(CustomBaseModel):
2406
2428
  """
2407
2429
 
2408
2430
  id: str = Field(..., description="The unique identifier of a generator.")
2409
- name: str | None = Field(None, description="The name of a generator.")
2431
+ name: str = Field(..., description="The name of a generator.")
2410
2432
  description: str | None = Field(None, description="The description of a generator.")
2411
2433
  training_status: ProgressStatus = Field(..., alias="trainingStatus")
2412
2434
  training_time: AwareDatetime | None = Field(
@@ -2663,7 +2685,7 @@ class SyntheticDatasetListItem(CustomBaseModel):
2663
2685
 
2664
2686
  id: str = Field(..., description="The unique identifier of a synthetic dataset.")
2665
2687
  metadata: Metadata | None = None
2666
- name: str | None = Field(None, description="The name of a synthetic dataset.")
2688
+ name: str = Field(..., description="The name of a synthetic dataset.")
2667
2689
  description: str | None = Field(None, description="The description of a synthetic dataset.")
2668
2690
  generation_status: ProgressStatus = Field(..., alias="generationStatus")
2669
2691
  generation_time: AwareDatetime | None = Field(
@@ -2825,7 +2847,7 @@ class AssistantThreadListItem(CustomBaseModel):
2825
2847
 
2826
2848
  id: str = Field(..., description="The unique identifier of a assistant thread.")
2827
2849
  metadata: Metadata | None = None
2828
- name: str | None = Field(None, description="The name of a assistant thread.")
2850
+ name: str = Field(..., description="The name of a assistant thread.")
2829
2851
  usage: AssistantThreadUsage | None = None
2830
2852
 
2831
2853
 
@@ -2836,7 +2858,7 @@ class AssistantThread(CustomBaseModel):
2836
2858
 
2837
2859
  id: str = Field(..., description="The unique identifier of a assistant thread.")
2838
2860
  metadata: Metadata | None = None
2839
- name: str | None = Field(None, description="The name of a assistant thread.")
2861
+ name: str = Field(..., description="The name of a assistant thread.")
2840
2862
  session_status: AssistantThreadSessionStatus | None = Field(None, alias="sessionStatus")
2841
2863
  messages: list[AssistantMessage] | None = Field(
2842
2864
  None,
@@ -3427,7 +3449,7 @@ class Generator(CustomBaseModel):
3427
3449
  """
3428
3450
 
3429
3451
  id: str = Field(..., description="The unique identifier of a generator.")
3430
- name: str | None = Field(None, description="The name of a generator.")
3452
+ name: str = Field(..., description="The name of a generator.")
3431
3453
  description: str | None = Field(None, description="The description of a generator.")
3432
3454
  training_status: ProgressStatus = Field(..., alias="trainingStatus")
3433
3455
  training_time: AwareDatetime | None = Field(
@@ -3456,6 +3478,8 @@ class Generator(CustomBaseModel):
3456
3478
  if isinstance(values, dict):
3457
3479
  if "id" not in values:
3458
3480
  values["id"] = str(uuid.uuid4())
3481
+ if values.get("name") is None:
3482
+ values["name"] = "New generator"
3459
3483
  if "training_status" not in values:
3460
3484
  values["training_status"] = ProgressStatus.new
3461
3485
  return values
@@ -3480,7 +3504,7 @@ class Generator(CustomBaseModel):
3480
3504
  name=name,
3481
3505
  description=description,
3482
3506
  )
3483
- self.client._update(generator_id=self.id, config=patch_config.model_dump(exclude_none=True))
3507
+ self.client._update(generator_id=self.id, config=patch_config)
3484
3508
  self.reload()
3485
3509
 
3486
3510
  def delete(self) -> None:
@@ -3736,7 +3760,7 @@ class SyntheticDataset(CustomBaseModel):
3736
3760
  id: str = Field(..., description="The unique identifier of a synthetic dataset.")
3737
3761
  generator_id: str | None = Field(None, alias="generatorId", description="The unique identifier of a generator.")
3738
3762
  metadata: Metadata | None = None
3739
- name: str | None = Field(None, description="The name of a synthetic dataset.")
3763
+ name: str = Field(..., description="The name of a synthetic dataset.")
3740
3764
  description: str | None = Field(None, description="The description of a synthetic dataset.")
3741
3765
  generation_status: ProgressStatus = Field(..., alias="generationStatus")
3742
3766
  generation_time: AwareDatetime | None = Field(
@@ -3769,6 +3793,8 @@ class SyntheticDataset(CustomBaseModel):
3769
3793
  if isinstance(values, dict):
3770
3794
  if "id" not in values:
3771
3795
  values["id"] = str(uuid.uuid4())
3796
+ if values.get("name") is None:
3797
+ values["name"] = "New synthetic dataset"
3772
3798
  if "generation_status" not in values:
3773
3799
  values["generation_status"] = ProgressStatus.new
3774
3800
  return values
@@ -3798,7 +3824,7 @@ class SyntheticDataset(CustomBaseModel):
3798
3824
  )
3799
3825
  self.client._update(
3800
3826
  synthetic_dataset_id=self.id,
3801
- config=patch_config.model_dump(exclude_none=True),
3827
+ config=patch_config,
3802
3828
  )
3803
3829
  self.reload()
3804
3830
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "mostlyai"
3
- version = "5.2.4"
3
+ version = "5.2.6"
4
4
  description = "Synthetic Data SDK"
5
5
  authors = [{ name = "MOSTLY AI", email = "dev@mostly.ai" }]
6
6
  requires-python = ">=3.10,<3.14"
@@ -49,14 +49,14 @@ dependencies = [
49
49
  local = [
50
50
  # "mostlyai-engine @ git+https://github.com/mostly-ai/mostlyai-engine.git@main", # for development
51
51
  # "mostlyai-qa @ git+https://github.com/mostly-ai/mostlyai-qa.git@main", # for development
52
- "mostlyai-engine==1.5.5", # for release
52
+ "mostlyai-engine==1.5.7", # for release
53
53
  "mostlyai-qa==1.9.8", # for release
54
54
  "fastapi>=0.115.6,<0.116",
55
55
  "uvicorn>=0.34.0,<0.35",
56
56
  "python-multipart>=0.0.20",
57
- "torch>=2.7.0,<2.7.1",
58
- "torchaudio>=2.7.0,<2.7.1",
59
- "torchvision>=0.22.0,<0.22.1",
57
+ "torch>=2.8.0,<2.8.1",
58
+ "torchaudio>=2.8.0,<2.8.1",
59
+ "torchvision>=0.23.0,<0.23.1",
60
60
  "joblib>=1.4.2",
61
61
  "sqlalchemy>=2.0.0",
62
62
  "sshtunnel>=0.4.0,<0.5",
@@ -75,14 +75,14 @@ local = [
75
75
  local-gpu = [
76
76
  # "mostlyai-engine[gpu] @ git+https://github.com/mostly-ai/mostlyai-engine.git@main", # for development
77
77
  # "mostlyai-qa @ git+https://github.com/mostly-ai/mostlyai-qa.git@main", # for development
78
- "mostlyai-engine[gpu]==1.5.5", # for release
78
+ "mostlyai-engine[gpu]==1.5.7", # for release
79
79
  "mostlyai-qa==1.9.8", # for release
80
80
  "fastapi>=0.115.6,<0.116",
81
81
  "uvicorn>=0.34.0,<0.35",
82
82
  "python-multipart>=0.0.20",
83
- "torch>=2.7.0,<2.7.1",
84
- "torchaudio>=2.7.0,<2.7.1",
85
- "torchvision>=0.22.0,<0.22.1",
83
+ "torch>=2.8.0,<2.8.1",
84
+ "torchaudio>=2.8.0,<2.8.1",
85
+ "torchvision>=0.23.0,<0.23.1",
86
86
  "joblib>=1.4.2",
87
87
  "sqlalchemy>=2.0.0",
88
88
  "sshtunnel>=0.4.0,<0.5",
File without changes
File without changes
File without changes
File without changes