fleet-python 0.2.49__tar.gz → 0.2.51__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 fleet-python might be problematic. Click here for more details.
- {fleet_python-0.2.49 → fleet_python-0.2.51}/PKG-INFO +1 -1
- {fleet_python-0.2.49 → fleet_python-0.2.51}/examples/example_mcp_anthropic.py +2 -0
- fleet_python-0.2.51/examples/example_tasks.py +24 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/_async/client.py +1 -9
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/_async/tasks.py +6 -1
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/client.py +1 -9
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/tasks.py +6 -1
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet_python.egg-info/PKG-INFO +1 -1
- {fleet_python-0.2.49 → fleet_python-0.2.51}/pyproject.toml +1 -1
- fleet_python-0.2.49/examples/example_tasks.py +0 -31
- {fleet_python-0.2.49 → fleet_python-0.2.51}/LICENSE +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/README.md +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/examples/diff_example.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/examples/dsl_example.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/examples/example.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/examples/exampleResume.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/examples/example_account.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/examples/example_action_log.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/examples/example_client.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/examples/example_mcp_openai.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/examples/example_sync.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/examples/example_task.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/examples/example_verifier.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/examples/gemini_example.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/examples/json_tasks_example.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/examples/nova_act_example.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/examples/openai_example.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/examples/openai_simple_example.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/examples/query_builder_example.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/examples/quickstart.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/examples/test_cdp_logging.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/__init__.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/_async/__init__.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/_async/base.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/_async/env/__init__.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/_async/env/client.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/_async/exceptions.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/_async/global_client.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/_async/instance/__init__.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/_async/instance/base.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/_async/instance/client.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/_async/models.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/_async/resources/__init__.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/_async/resources/base.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/_async/resources/browser.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/_async/resources/mcp.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/_async/resources/sqlite.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/_async/verifiers/__init__.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/_async/verifiers/bundler.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/_async/verifiers/verifier.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/base.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/config.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/env/__init__.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/env/client.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/exceptions.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/global_client.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/instance/__init__.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/instance/base.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/instance/client.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/instance/models.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/models.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/resources/__init__.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/resources/base.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/resources/browser.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/resources/mcp.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/resources/sqlite.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/types.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/verifiers/__init__.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/verifiers/bundler.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/verifiers/code.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/verifiers/db.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/verifiers/decorator.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/verifiers/parse.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/verifiers/sql_differ.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet/verifiers/verifier.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet_python.egg-info/SOURCES.txt +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet_python.egg-info/dependency_links.txt +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet_python.egg-info/requires.txt +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/fleet_python.egg-info/top_level.txt +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/scripts/fix_sync_imports.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/scripts/unasync.py +0 -0
- {fleet_python-0.2.49 → fleet_python-0.2.51}/setup.cfg +0 -0
|
@@ -15,6 +15,8 @@ async def main():
|
|
|
15
15
|
print("Created environment:", env.urls.app)
|
|
16
16
|
print("MCP URL:", env.mcp.url)
|
|
17
17
|
|
|
18
|
+
asyncio.sleep(5)
|
|
19
|
+
|
|
18
20
|
async with streamablehttp_client(url=env.mcp.url) as streams:
|
|
19
21
|
async with ClientSession(
|
|
20
22
|
read_stream=streams[0], write_stream=streams[1]
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import fleet
|
|
2
|
+
from dotenv import load_dotenv
|
|
3
|
+
|
|
4
|
+
load_dotenv()
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def main():
|
|
8
|
+
account = fleet.env.account()
|
|
9
|
+
print(account)
|
|
10
|
+
|
|
11
|
+
tasks = fleet.load_tasks(team_id="5ca40f9f-9899-4bee-b194-6974138a4f12")
|
|
12
|
+
print(f"Loaded {len(tasks)} tasks")
|
|
13
|
+
|
|
14
|
+
# Save tasks to JSON file
|
|
15
|
+
import json
|
|
16
|
+
|
|
17
|
+
with open(f"{account.team_id}.json", "w") as f:
|
|
18
|
+
json.dump([task.model_dump() for task in tasks], f, indent=2)
|
|
19
|
+
|
|
20
|
+
print(f"Saved {len(tasks)} tasks to saved_tasks.json")
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
if __name__ == "__main__":
|
|
24
|
+
main()
|
|
@@ -579,17 +579,9 @@ class AsyncFleet:
|
|
|
579
579
|
tasks.append(task)
|
|
580
580
|
|
|
581
581
|
for task in tasks:
|
|
582
|
-
payload = TaskRequest(
|
|
583
|
-
key=task.key,
|
|
584
|
-
prompt=task.prompt,
|
|
585
|
-
environment_id=task.env_id,
|
|
586
|
-
verifier_func=task.verifier_func,
|
|
587
|
-
version=task.version or None,
|
|
588
|
-
env_variables=task.env_variables or {},
|
|
589
|
-
)
|
|
590
582
|
try:
|
|
591
583
|
response = await self.client.request(
|
|
592
|
-
"POST", "/v1/tasks", json=
|
|
584
|
+
"POST", "/v1/tasks", json=task.model_dump()
|
|
593
585
|
)
|
|
594
586
|
except Exception as e:
|
|
595
587
|
logger.error(f"Failed to import task {task.key}: {e}")
|
|
@@ -5,7 +5,7 @@ from __future__ import annotations
|
|
|
5
5
|
from datetime import datetime
|
|
6
6
|
from typing import Any, Dict, Optional, List, TYPE_CHECKING
|
|
7
7
|
|
|
8
|
-
from pydantic import BaseModel, Field, validator
|
|
8
|
+
from pydantic import BaseModel, Field, validator, field_serializer
|
|
9
9
|
|
|
10
10
|
# Import the shared VerifierFunction type that works for both async and sync
|
|
11
11
|
from fleet.types import VerifierFunction
|
|
@@ -46,6 +46,11 @@ class Task(BaseModel):
|
|
|
46
46
|
"""Set created_at to current time if not provided."""
|
|
47
47
|
return v or datetime.now()
|
|
48
48
|
|
|
49
|
+
@field_serializer("created_at")
|
|
50
|
+
def serialize_created_at(self, dt: Optional[datetime], _info):
|
|
51
|
+
"""Serialize datetime to ISO format string."""
|
|
52
|
+
return dt.isoformat() if dt else None
|
|
53
|
+
|
|
49
54
|
@property
|
|
50
55
|
def env_key(self) -> str:
|
|
51
56
|
"""Get the environment key combining env_id and version."""
|
|
@@ -587,17 +587,9 @@ class Fleet:
|
|
|
587
587
|
responses = []
|
|
588
588
|
|
|
589
589
|
for task in tasks:
|
|
590
|
-
payload = TaskRequest(
|
|
591
|
-
key=task.key,
|
|
592
|
-
prompt=task.prompt,
|
|
593
|
-
environment_id=task.env_id,
|
|
594
|
-
verifier_func=task.verifier_func,
|
|
595
|
-
version=task.version or None,
|
|
596
|
-
env_variables=task.env_variables or {},
|
|
597
|
-
)
|
|
598
590
|
try:
|
|
599
591
|
response = self.client.request(
|
|
600
|
-
"POST", "/v1/tasks", json=
|
|
592
|
+
"POST", "/v1/tasks", json=task.model_dump()
|
|
601
593
|
)
|
|
602
594
|
responses.append(response)
|
|
603
595
|
except Exception as e:
|
|
@@ -6,7 +6,7 @@ import asyncio
|
|
|
6
6
|
from datetime import datetime
|
|
7
7
|
from typing import Any, Dict, Optional, List, TYPE_CHECKING
|
|
8
8
|
|
|
9
|
-
from pydantic import BaseModel, Field, validator
|
|
9
|
+
from pydantic import BaseModel, Field, validator, field_serializer
|
|
10
10
|
|
|
11
11
|
# Import the shared VerifierFunction type that works for both async and sync
|
|
12
12
|
from fleet.types import VerifierFunction
|
|
@@ -47,6 +47,11 @@ class Task(BaseModel):
|
|
|
47
47
|
"""Set created_at to current time if not provided."""
|
|
48
48
|
return v or datetime.now()
|
|
49
49
|
|
|
50
|
+
@field_serializer("created_at")
|
|
51
|
+
def serialize_created_at(self, dt: Optional[datetime], _info):
|
|
52
|
+
"""Serialize datetime to ISO format string."""
|
|
53
|
+
return dt.isoformat() if dt else None
|
|
54
|
+
|
|
50
55
|
@property
|
|
51
56
|
def env_key(self) -> str:
|
|
52
57
|
"""Get the environment key combining env_id and version."""
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import fleet
|
|
2
|
-
from dotenv import load_dotenv
|
|
3
|
-
|
|
4
|
-
load_dotenv()
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
def main():
|
|
8
|
-
env = fleet.env.make("fira")
|
|
9
|
-
|
|
10
|
-
tasks = fleet.load_tasks(env_key="fira")
|
|
11
|
-
print(f"Loaded {len(tasks)} tasks")
|
|
12
|
-
|
|
13
|
-
for i, task in enumerate(tasks):
|
|
14
|
-
print(f"\nTask {i + 1}:")
|
|
15
|
-
print(f" Key: {task.key}")
|
|
16
|
-
print(f" Prompt: {task.prompt[:80]}...")
|
|
17
|
-
print(f" Verifier: {task.verifier_func[:80]}...")
|
|
18
|
-
|
|
19
|
-
print(f" Verifier: {task.verifier.key}")
|
|
20
|
-
print(" Running verifier...")
|
|
21
|
-
try:
|
|
22
|
-
score = task.verify(env)
|
|
23
|
-
print(f" ✓ Score: {score}")
|
|
24
|
-
except Exception as e:
|
|
25
|
-
print(f" ✗ Error: {type(e).__name__}: {e}")
|
|
26
|
-
|
|
27
|
-
print("-" * 60)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if __name__ == "__main__":
|
|
31
|
-
main()
|
|
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
|
|
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
|