fleet-python 0.2.41__py3-none-any.whl → 0.2.42__py3-none-any.whl
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 fleet-python might be problematic. Click here for more details.
- fleet/_async/client.py +27 -0
- fleet/_async/models.py +5 -0
- fleet/_async/tasks.py +33 -3
- fleet/client.py +27 -0
- fleet/models.py +5 -0
- fleet/tasks.py +33 -3
- {fleet_python-0.2.41.dist-info → fleet_python-0.2.42.dist-info}/METADATA +1 -1
- {fleet_python-0.2.41.dist-info → fleet_python-0.2.42.dist-info}/RECORD +11 -11
- {fleet_python-0.2.41.dist-info → fleet_python-0.2.42.dist-info}/WHEEL +0 -0
- {fleet_python-0.2.41.dist-info → fleet_python-0.2.42.dist-info}/licenses/LICENSE +0 -0
- {fleet_python-0.2.41.dist-info → fleet_python-0.2.42.dist-info}/top_level.txt +0 -0
fleet/_async/client.py
CHANGED
|
@@ -32,6 +32,8 @@ from ..models import (
|
|
|
32
32
|
TaskListResponse,
|
|
33
33
|
AccountResponse,
|
|
34
34
|
TaskRequest,
|
|
35
|
+
TaskResponse,
|
|
36
|
+
TaskUpdateRequest,
|
|
35
37
|
)
|
|
36
38
|
from .tasks import Task
|
|
37
39
|
|
|
@@ -501,6 +503,31 @@ class AsyncFleet:
|
|
|
501
503
|
response = await self.client.request("GET", "/v1/account")
|
|
502
504
|
return AccountResponse(**response.json())
|
|
503
505
|
|
|
506
|
+
async def update_task(
|
|
507
|
+
self,
|
|
508
|
+
task_key: str,
|
|
509
|
+
prompt: Optional[str] = None,
|
|
510
|
+
verifier_code: Optional[str] = None
|
|
511
|
+
) -> TaskResponse:
|
|
512
|
+
"""Update an existing task.
|
|
513
|
+
|
|
514
|
+
Args:
|
|
515
|
+
task_key: The key of the task to update
|
|
516
|
+
prompt: New prompt text for the task (optional)
|
|
517
|
+
verifier_code: Python code for task verification (optional)
|
|
518
|
+
|
|
519
|
+
Returns:
|
|
520
|
+
TaskResponse containing the updated task details
|
|
521
|
+
"""
|
|
522
|
+
payload = TaskUpdateRequest(
|
|
523
|
+
prompt=prompt,
|
|
524
|
+
verifier_code=verifier_code
|
|
525
|
+
)
|
|
526
|
+
response = await self.client.request(
|
|
527
|
+
"PUT", f"/v1/tasks/{task_key}", json=payload.model_dump(exclude_none=True)
|
|
528
|
+
)
|
|
529
|
+
return TaskResponse(**response.json())
|
|
530
|
+
|
|
504
531
|
async def _create_verifier_from_data(
|
|
505
532
|
self, verifier_id: str, verifier_key: str, verifier_code: str, verifier_sha: str
|
|
506
533
|
) -> "AsyncVerifierFunction":
|
fleet/_async/models.py
CHANGED
|
@@ -156,6 +156,11 @@ class TaskRequest(BaseModel):
|
|
|
156
156
|
env_variables: Optional[Dict[str, Any]] = Field(None, title="Env Variables")
|
|
157
157
|
|
|
158
158
|
|
|
159
|
+
class TaskUpdateRequest(BaseModel):
|
|
160
|
+
prompt: Optional[str] = Field(None, title="Prompt")
|
|
161
|
+
verifier_code: Optional[str] = Field(None, title="Verifier Code")
|
|
162
|
+
|
|
163
|
+
|
|
159
164
|
class VerifierData(BaseModel):
|
|
160
165
|
verifier_id: str = Field(..., title="Verifier Id")
|
|
161
166
|
key: str = Field(..., title="Key")
|
fleet/_async/tasks.py
CHANGED
|
@@ -201,8 +201,38 @@ async def load_tasks(
|
|
|
201
201
|
|
|
202
202
|
client = get_client()
|
|
203
203
|
return await client.load_tasks(
|
|
204
|
-
env_key=env_key,
|
|
205
|
-
keys=keys,
|
|
206
|
-
version=version,
|
|
204
|
+
env_key=env_key,
|
|
205
|
+
keys=keys,
|
|
206
|
+
version=version,
|
|
207
207
|
team_id=team_id
|
|
208
208
|
)
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
async def update_task(
|
|
212
|
+
task_key: str,
|
|
213
|
+
prompt: Optional[str] = None,
|
|
214
|
+
verifier_code: Optional[str] = None
|
|
215
|
+
):
|
|
216
|
+
"""Convenience function to update an existing task.
|
|
217
|
+
|
|
218
|
+
Args:
|
|
219
|
+
task_key: The key of the task to update
|
|
220
|
+
prompt: New prompt text for the task (optional)
|
|
221
|
+
verifier_code: Python code for task verification (optional)
|
|
222
|
+
|
|
223
|
+
Returns:
|
|
224
|
+
TaskResponse containing the updated task details
|
|
225
|
+
|
|
226
|
+
Examples:
|
|
227
|
+
response = await fleet.update_task("my-task", prompt="New prompt text")
|
|
228
|
+
response = await fleet.update_task("my-task", verifier_code="def verify(env): return True")
|
|
229
|
+
"""
|
|
230
|
+
from .global_client import get_client
|
|
231
|
+
from ..models import TaskResponse
|
|
232
|
+
|
|
233
|
+
client = get_client()
|
|
234
|
+
return await client.update_task(
|
|
235
|
+
task_key=task_key,
|
|
236
|
+
prompt=prompt,
|
|
237
|
+
verifier_code=verifier_code
|
|
238
|
+
)
|
fleet/client.py
CHANGED
|
@@ -32,6 +32,8 @@ from .models import (
|
|
|
32
32
|
TaskListResponse,
|
|
33
33
|
AccountResponse,
|
|
34
34
|
TaskRequest,
|
|
35
|
+
TaskResponse,
|
|
36
|
+
TaskUpdateRequest,
|
|
35
37
|
)
|
|
36
38
|
from .tasks import Task
|
|
37
39
|
|
|
@@ -497,6 +499,31 @@ class Fleet:
|
|
|
497
499
|
response = self.client.request("GET", "/v1/account")
|
|
498
500
|
return AccountResponse(**response.json())
|
|
499
501
|
|
|
502
|
+
def update_task(
|
|
503
|
+
self,
|
|
504
|
+
task_key: str,
|
|
505
|
+
prompt: Optional[str] = None,
|
|
506
|
+
verifier_code: Optional[str] = None
|
|
507
|
+
) -> TaskResponse:
|
|
508
|
+
"""Update an existing task.
|
|
509
|
+
|
|
510
|
+
Args:
|
|
511
|
+
task_key: The key of the task to update
|
|
512
|
+
prompt: New prompt text for the task (optional)
|
|
513
|
+
verifier_code: Python code for task verification (optional)
|
|
514
|
+
|
|
515
|
+
Returns:
|
|
516
|
+
TaskResponse containing the updated task details
|
|
517
|
+
"""
|
|
518
|
+
payload = TaskUpdateRequest(
|
|
519
|
+
prompt=prompt,
|
|
520
|
+
verifier_code=verifier_code
|
|
521
|
+
)
|
|
522
|
+
response = self.client.request(
|
|
523
|
+
"PUT", f"/v1/tasks/{task_key}", json=payload.model_dump(exclude_none=True)
|
|
524
|
+
)
|
|
525
|
+
return TaskResponse(**response.json())
|
|
526
|
+
|
|
500
527
|
def _create_verifier_from_data(
|
|
501
528
|
self, verifier_id: str, verifier_key: str, verifier_code: str, verifier_sha: str
|
|
502
529
|
) -> "SyncVerifierFunction":
|
fleet/models.py
CHANGED
|
@@ -156,6 +156,11 @@ class TaskRequest(BaseModel):
|
|
|
156
156
|
env_variables: Optional[Dict[str, Any]] = Field(None, title="Env Variables")
|
|
157
157
|
|
|
158
158
|
|
|
159
|
+
class TaskUpdateRequest(BaseModel):
|
|
160
|
+
prompt: Optional[str] = Field(None, title="Prompt")
|
|
161
|
+
verifier_code: Optional[str] = Field(None, title="Verifier Code")
|
|
162
|
+
|
|
163
|
+
|
|
159
164
|
class VerifierData(BaseModel):
|
|
160
165
|
verifier_id: str = Field(..., title="Verifier Id")
|
|
161
166
|
key: str = Field(..., title="Key")
|
fleet/tasks.py
CHANGED
|
@@ -232,8 +232,38 @@ def load_tasks(
|
|
|
232
232
|
|
|
233
233
|
client = get_client()
|
|
234
234
|
return client.load_tasks(
|
|
235
|
-
env_key=env_key,
|
|
236
|
-
keys=keys,
|
|
237
|
-
version=version,
|
|
235
|
+
env_key=env_key,
|
|
236
|
+
keys=keys,
|
|
237
|
+
version=version,
|
|
238
238
|
team_id=team_id
|
|
239
239
|
)
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
def update_task(
|
|
243
|
+
task_key: str,
|
|
244
|
+
prompt: Optional[str] = None,
|
|
245
|
+
verifier_code: Optional[str] = None
|
|
246
|
+
):
|
|
247
|
+
"""Convenience function to update an existing task.
|
|
248
|
+
|
|
249
|
+
Args:
|
|
250
|
+
task_key: The key of the task to update
|
|
251
|
+
prompt: New prompt text for the task (optional)
|
|
252
|
+
verifier_code: Python code for task verification (optional)
|
|
253
|
+
|
|
254
|
+
Returns:
|
|
255
|
+
TaskResponse containing the updated task details
|
|
256
|
+
|
|
257
|
+
Examples:
|
|
258
|
+
response = fleet.update_task("my-task", prompt="New prompt text")
|
|
259
|
+
response = fleet.update_task("my-task", verifier_code="def verify(env): return True")
|
|
260
|
+
"""
|
|
261
|
+
from .global_client import get_client
|
|
262
|
+
from .models import TaskResponse
|
|
263
|
+
|
|
264
|
+
client = get_client()
|
|
265
|
+
return client.update_task(
|
|
266
|
+
task_key=task_key,
|
|
267
|
+
prompt=prompt,
|
|
268
|
+
verifier_code=verifier_code
|
|
269
|
+
)
|
|
@@ -21,20 +21,20 @@ examples/quickstart.py,sha256=1VT39IRRhemsJgxi0O0gprdpcw7HB4pYO97GAYagIcg,3788
|
|
|
21
21
|
examples/test_cdp_logging.py,sha256=AkCwQCgOTQEI8w3v0knWK_4eXMph7L9x07wj9yIYM10,2836
|
|
22
22
|
fleet/__init__.py,sha256=oxI2XvaiRMn15AZpoDHOvX26WlXALHXvqSRP0KkBpAY,3751
|
|
23
23
|
fleet/base.py,sha256=bc-340sTpq_DJs7yQ9d2pDWnmJFmA1SwDB9Lagvqtb4,9182
|
|
24
|
-
fleet/client.py,sha256=
|
|
24
|
+
fleet/client.py,sha256=T9Tvhq4aTEs1MjTJw26TkvSMFtQSYEi2hCVu0mdRGxc,22931
|
|
25
25
|
fleet/config.py,sha256=uY02ZKxVoXqVDta-0IMWaYJeE1CTXF_fA9NI6QUutmU,319
|
|
26
26
|
fleet/exceptions.py,sha256=fUmPwWhnT8SR97lYsRq0kLHQHKtSh2eJS0VQ2caSzEI,5055
|
|
27
27
|
fleet/global_client.py,sha256=frrDAFNM2ywN0JHLtlm9qbE1dQpnQJsavJpb7xSR_bU,1072
|
|
28
|
-
fleet/models.py,sha256=
|
|
29
|
-
fleet/tasks.py,sha256=
|
|
28
|
+
fleet/models.py,sha256=li5Cii7ASUHCFMFeJIMklyicYczqPez768RxO0Q0F2o,12618
|
|
29
|
+
fleet/tasks.py,sha256=TuPmCdgMnqBjJhqxLUL2CKgR0w-P5zNAPukHT_fQTyU,9575
|
|
30
30
|
fleet/types.py,sha256=L4Y82xICf1tzyCLqhLYUgEoaIIS5h9T05TyFNHSWs3s,652
|
|
31
31
|
fleet/_async/__init__.py,sha256=lrnDD6N9p0Oqpi_djxTnxh8I5F7nA7KNn0khciGmgpg,6747
|
|
32
32
|
fleet/_async/base.py,sha256=oisVTQsx0M_yTmyQJc3oij63uKZ97MHz-xYFsWXxQE8,9202
|
|
33
|
-
fleet/_async/client.py,sha256=
|
|
33
|
+
fleet/_async/client.py,sha256=Etpho0Vvovv8l7Y4HFE2KGBb64rdE-LefFXux9QcWeI,23438
|
|
34
34
|
fleet/_async/exceptions.py,sha256=fUmPwWhnT8SR97lYsRq0kLHQHKtSh2eJS0VQ2caSzEI,5055
|
|
35
35
|
fleet/_async/global_client.py,sha256=4WskpLHbsDEgWW7hXMD09W-brkp4euy8w2ZJ88594rQ,1103
|
|
36
|
-
fleet/_async/models.py,sha256=
|
|
37
|
-
fleet/_async/tasks.py,sha256=
|
|
36
|
+
fleet/_async/models.py,sha256=li5Cii7ASUHCFMFeJIMklyicYczqPez768RxO0Q0F2o,12618
|
|
37
|
+
fleet/_async/tasks.py,sha256=8r1jg_r-YpHCezsqlXKoT5RxBelyqax85iwG0kublPc,8317
|
|
38
38
|
fleet/_async/env/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
39
39
|
fleet/_async/env/client.py,sha256=9GOSkEWNncwTtiZNaJ2vNGrFCPutyan9lBNhD87dAzQ,1059
|
|
40
40
|
fleet/_async/instance/__init__.py,sha256=PtmJq8J8bh0SOQ2V55QURz5GJfobozwtQoqhaOk3_tI,515
|
|
@@ -67,10 +67,10 @@ fleet/verifiers/decorator.py,sha256=nAP3O8szXu7md_kpwpz91hGSUNEVLYjwZQZTkQlV1DM,
|
|
|
67
67
|
fleet/verifiers/parse.py,sha256=0bAbj9VvT__yU4ZVREUK-Tn9dukh9LCpmfVsgj1DfP4,8508
|
|
68
68
|
fleet/verifiers/sql_differ.py,sha256=dmiGCFXVMEMbAX519OjhVqgA8ZvhnvdmC1BVpL7QCF0,6490
|
|
69
69
|
fleet/verifiers/verifier.py,sha256=53oBWAf0yy3bZmZx9eH9AWIf65H7OP2UUm0YwWCL6Mc,14286
|
|
70
|
-
fleet_python-0.2.
|
|
70
|
+
fleet_python-0.2.42.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
71
71
|
scripts/fix_sync_imports.py,sha256=X9fWLTpiPGkSHsjyQUDepOJkxOqw1DPj7nd8wFlFqLQ,8368
|
|
72
72
|
scripts/unasync.py,sha256=vWVQxRWX8SRZO5cmzEhpvnG_REhCWXpidIGIpWmEcvI,696
|
|
73
|
-
fleet_python-0.2.
|
|
74
|
-
fleet_python-0.2.
|
|
75
|
-
fleet_python-0.2.
|
|
76
|
-
fleet_python-0.2.
|
|
73
|
+
fleet_python-0.2.42.dist-info/METADATA,sha256=DW1jtGvGk6pKaOmWaBNBPMG0-BxpSUnGLg8DWOIMkqU,3304
|
|
74
|
+
fleet_python-0.2.42.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
75
|
+
fleet_python-0.2.42.dist-info/top_level.txt,sha256=_3DSmTohvSDf3AIP_BYfGzhwO1ECFwuzg83X-wHCx3Y,23
|
|
76
|
+
fleet_python-0.2.42.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|