simile 0.4.8__tar.gz → 0.4.9__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.
Potentially problematic release.
This version of simile might be problematic. Click here for more details.
- {simile-0.4.8 → simile-0.4.9}/PKG-INFO +1 -1
- {simile-0.4.8 → simile-0.4.9}/pyproject.toml +1 -1
- {simile-0.4.8 → simile-0.4.9}/simile/client.py +25 -1
- {simile-0.4.8 → simile-0.4.9}/simile/models.py +15 -0
- {simile-0.4.8 → simile-0.4.9}/simile.egg-info/PKG-INFO +1 -1
- {simile-0.4.8 → simile-0.4.9}/LICENSE +0 -0
- {simile-0.4.8 → simile-0.4.9}/README.md +0 -0
- {simile-0.4.8 → simile-0.4.9}/setup.cfg +0 -0
- {simile-0.4.8 → simile-0.4.9}/setup.py +0 -0
- {simile-0.4.8 → simile-0.4.9}/simile/__init__.py +0 -0
- {simile-0.4.8 → simile-0.4.9}/simile/auth_client.py +0 -0
- {simile-0.4.8 → simile-0.4.9}/simile/exceptions.py +0 -0
- {simile-0.4.8 → simile-0.4.9}/simile/resources.py +0 -0
- {simile-0.4.8 → simile-0.4.9}/simile.egg-info/SOURCES.txt +0 -0
- {simile-0.4.8 → simile-0.4.9}/simile.egg-info/dependency_links.txt +0 -0
- {simile-0.4.8 → simile-0.4.9}/simile.egg-info/requires.txt +0 -0
- {simile-0.4.8 → simile-0.4.9}/simile.egg-info/top_level.txt +0 -0
|
@@ -8,6 +8,7 @@ from .models import (
|
|
|
8
8
|
Population,
|
|
9
9
|
PopulationInfo,
|
|
10
10
|
UpdatePopulationMetadataPayload,
|
|
11
|
+
UpdatePopulationInfoPayload,
|
|
11
12
|
Agent as AgentModel,
|
|
12
13
|
DataItem,
|
|
13
14
|
DeletionResponse,
|
|
@@ -186,7 +187,7 @@ class Simile:
|
|
|
186
187
|
response_data = await self._request(
|
|
187
188
|
"PATCH",
|
|
188
189
|
f"populations/{str(population_id)}/metadata",
|
|
189
|
-
json=payload,
|
|
190
|
+
json=payload.model_dump(mode="json", exclude_none=True),
|
|
190
191
|
response_model=Population,
|
|
191
192
|
)
|
|
192
193
|
return response_data
|
|
@@ -197,6 +198,29 @@ class Simile:
|
|
|
197
198
|
)
|
|
198
199
|
return response_data
|
|
199
200
|
|
|
201
|
+
async def update_population_info(
|
|
202
|
+
self,
|
|
203
|
+
population_id: Union[str, uuid.UUID],
|
|
204
|
+
name: Optional[str] = None,
|
|
205
|
+
description: Optional[str] = None,
|
|
206
|
+
metadata: Optional[Dict[str, Any]] = None,
|
|
207
|
+
) -> Population:
|
|
208
|
+
"""
|
|
209
|
+
Updates population information (name, description, metadata).
|
|
210
|
+
At least one of name, description, or metadata must be provided.
|
|
211
|
+
Requires write access to the population.
|
|
212
|
+
"""
|
|
213
|
+
payload = UpdatePopulationInfoPayload(
|
|
214
|
+
name=name, description=description, metadata=metadata
|
|
215
|
+
)
|
|
216
|
+
response_data = await self._request(
|
|
217
|
+
"PUT",
|
|
218
|
+
f"populations/update/{str(population_id)}",
|
|
219
|
+
json=payload.model_dump(mode="json", exclude_none=True),
|
|
220
|
+
response_model=Population,
|
|
221
|
+
)
|
|
222
|
+
return response_data
|
|
223
|
+
|
|
200
224
|
async def get_population_info(
|
|
201
225
|
self, population_id: Union[str, uuid.UUID]
|
|
202
226
|
) -> PopulationInfo:
|
|
@@ -53,6 +53,21 @@ class UpdatePopulationMetadataPayload(BaseModel):
|
|
|
53
53
|
mode: Optional[Literal["merge", "replace"]] = "merge"
|
|
54
54
|
|
|
55
55
|
|
|
56
|
+
class UpdatePopulationInfoPayload(BaseModel):
|
|
57
|
+
name: Optional[str] = None
|
|
58
|
+
description: Optional[str] = None
|
|
59
|
+
metadata: Optional[Dict[str, Any]] = None
|
|
60
|
+
|
|
61
|
+
@validator("name", "description", "metadata")
|
|
62
|
+
def validate_at_least_one_field(cls, v, values):
|
|
63
|
+
# Check if at least one field is provided
|
|
64
|
+
if not any(values.values()):
|
|
65
|
+
raise ValueError(
|
|
66
|
+
"At least one of 'name', 'description', or 'metadata' must be provided"
|
|
67
|
+
)
|
|
68
|
+
return v
|
|
69
|
+
|
|
70
|
+
|
|
56
71
|
class InitialDataItemPayload(BaseModel):
|
|
57
72
|
data_type: str
|
|
58
73
|
content: Any
|
|
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
|