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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: simile
3
- Version: 0.4.8
3
+ Version: 0.4.9
4
4
  Summary: Package for interfacing with Simile AI agents for simulation
5
5
  Author-email: Simile AI <cqz@simile.ai>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "simile"
7
- version = "0.4.8"
7
+ version = "0.4.9"
8
8
  authors = [
9
9
  { name="Simile AI", email="cqz@simile.ai" },
10
10
  ]
@@ -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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: simile
3
- Version: 0.4.8
3
+ Version: 0.4.9
4
4
  Summary: Package for interfacing with Simile AI agents for simulation
5
5
  Author-email: Simile AI <cqz@simile.ai>
6
6
  License: MIT
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes