fleet-python 0.2.29__py3-none-any.whl → 0.2.34__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.
- examples/diff_example.py +30 -20
- examples/dsl_example.py +12 -7
- examples/example.py +4 -4
- examples/exampleResume.py +191 -0
- examples/example_account.py +8 -0
- examples/example_action_log.py +2 -2
- examples/example_client.py +2 -2
- examples/example_mcp_anthropic.py +8 -5
- examples/example_mcp_openai.py +2 -2
- examples/example_sync.py +4 -4
- examples/example_task.py +16 -6
- examples/example_tasks.py +3 -6
- examples/example_verifier.py +16 -3
- examples/gemini_example.py +6 -6
- examples/json_tasks_example.py +2 -2
- examples/nova_act_example.py +2 -2
- examples/openai_example.py +3 -3
- examples/openai_simple_example.py +3 -3
- examples/query_builder_example.py +11 -7
- examples/test_cdp_logging.py +80 -0
- fleet/__init__.py +60 -5
- fleet/_async/__init__.py +258 -1
- fleet/_async/base.py +2 -1
- fleet/_async/client.py +164 -144
- fleet/_async/env/client.py +2 -0
- fleet/_async/global_client.py +43 -0
- fleet/_async/instance/client.py +1 -1
- fleet/_async/models.py +172 -171
- fleet/_async/resources/base.py +1 -1
- fleet/_async/resources/mcp.py +55 -0
- fleet/_async/resources/sqlite.py +141 -130
- fleet/_async/tasks.py +69 -16
- fleet/_async/verifiers/__init__.py +2 -2
- fleet/_async/verifiers/bundler.py +18 -14
- fleet/_async/verifiers/verifier.py +77 -71
- fleet/base.py +2 -1
- fleet/client.py +162 -148
- fleet/config.py +3 -2
- fleet/env/__init__.py +9 -1
- fleet/env/client.py +4 -1
- fleet/global_client.py +43 -0
- fleet/instance/__init__.py +1 -1
- fleet/instance/client.py +1 -1
- fleet/models.py +172 -171
- fleet/resources/base.py +1 -1
- fleet/resources/mcp.py +11 -16
- fleet/resources/sqlite.py +141 -130
- fleet/tasks.py +86 -15
- fleet/types.py +1 -1
- fleet/verifiers/__init__.py +2 -2
- fleet/verifiers/bundler.py +18 -14
- fleet/verifiers/code.py +1 -1
- fleet/verifiers/decorator.py +25 -34
- fleet/verifiers/parse.py +98 -68
- fleet/verifiers/verifier.py +77 -71
- {fleet_python-0.2.29.dist-info → fleet_python-0.2.34.dist-info}/METADATA +9 -9
- fleet_python-0.2.34.dist-info/RECORD +76 -0
- scripts/fix_sync_imports.py +87 -59
- scripts/unasync.py +10 -9
- fleet_python-0.2.29.dist-info/RECORD +0 -70
- {fleet_python-0.2.29.dist-info → fleet_python-0.2.34.dist-info}/WHEEL +0 -0
- {fleet_python-0.2.29.dist-info → fleet_python-0.2.34.dist-info}/licenses/LICENSE +0 -0
- {fleet_python-0.2.29.dist-info → fleet_python-0.2.34.dist-info}/top_level.txt +0 -0
fleet/verifiers/verifier.py
CHANGED
|
@@ -19,7 +19,7 @@ from ..client import SyncEnv
|
|
|
19
19
|
|
|
20
20
|
logger = logging.getLogger(__name__)
|
|
21
21
|
|
|
22
|
-
F = TypeVar(
|
|
22
|
+
F = TypeVar("F", bound=Callable[..., Any])
|
|
23
23
|
|
|
24
24
|
# Global cache to track which bundle SHAs have been uploaded to S3
|
|
25
25
|
_uploaded_bundle_shas: Set[str] = set()
|
|
@@ -33,7 +33,7 @@ def _get_bundle_sha(bundle_data: bytes) -> str:
|
|
|
33
33
|
|
|
34
34
|
class SyncVerifierFunction:
|
|
35
35
|
"""Wrapper for a verified function that supports local execution with env-first pattern."""
|
|
36
|
-
|
|
36
|
+
|
|
37
37
|
def __init__(
|
|
38
38
|
self,
|
|
39
39
|
func: F,
|
|
@@ -41,7 +41,7 @@ class SyncVerifierFunction:
|
|
|
41
41
|
extra_requirements: Optional[List[str]] = None,
|
|
42
42
|
verifier_id: Optional[str] = None,
|
|
43
43
|
sha256: Optional[str] = None,
|
|
44
|
-
raw_code: Optional[str] = None
|
|
44
|
+
raw_code: Optional[str] = None,
|
|
45
45
|
):
|
|
46
46
|
self.func = func
|
|
47
47
|
self.key = key
|
|
@@ -52,10 +52,10 @@ class SyncVerifierFunction:
|
|
|
52
52
|
self._bundle_data: Optional[bytes] = None # Cached bundle data
|
|
53
53
|
self._raw_code: Optional[str] = raw_code # Store raw code if provided
|
|
54
54
|
self._is_async = inspect.iscoroutinefunction(func)
|
|
55
|
-
|
|
55
|
+
|
|
56
56
|
# Copy function metadata
|
|
57
57
|
functools.update_wrapper(self, func)
|
|
58
|
-
|
|
58
|
+
|
|
59
59
|
def _get_or_create_bundle(self) -> tuple[bytes, str]:
|
|
60
60
|
"""Get or create bundle data and return (bundle_data, sha)."""
|
|
61
61
|
if self._bundle_data is None or self._bundle_sha is None:
|
|
@@ -63,68 +63,72 @@ class SyncVerifierFunction:
|
|
|
63
63
|
if self._raw_code:
|
|
64
64
|
import io
|
|
65
65
|
import zipfile
|
|
66
|
-
|
|
66
|
+
|
|
67
67
|
# Create zip bundle directly (matching bundler format)
|
|
68
68
|
zip_buffer = io.BytesIO()
|
|
69
|
-
with zipfile.ZipFile(zip_buffer,
|
|
69
|
+
with zipfile.ZipFile(zip_buffer, "w", zipfile.ZIP_DEFLATED) as zf:
|
|
70
70
|
# Add requirements.txt
|
|
71
71
|
requirements = self.extra_requirements or []
|
|
72
72
|
if "fleet-python" not in requirements:
|
|
73
73
|
requirements.append("fleet-python")
|
|
74
74
|
req_content = "\n".join(requirements)
|
|
75
75
|
zf.writestr("requirements.txt", req_content)
|
|
76
|
-
|
|
76
|
+
|
|
77
77
|
# Add verifier.py with the raw code
|
|
78
78
|
zf.writestr("verifier.py", self._raw_code)
|
|
79
|
-
|
|
79
|
+
|
|
80
80
|
self._bundle_data = zip_buffer.getvalue()
|
|
81
81
|
self._bundle_sha = _get_bundle_sha(self._bundle_data)
|
|
82
|
-
logger.debug(
|
|
82
|
+
logger.debug(
|
|
83
|
+
f"Created bundle from raw code for {self.key} with SHA: {self._bundle_sha}"
|
|
84
|
+
)
|
|
83
85
|
else:
|
|
84
86
|
# Try to create bundle from function source
|
|
85
87
|
try:
|
|
86
88
|
self._bundle_data = self._bundler.create_bundle(
|
|
87
|
-
self.func,
|
|
88
|
-
self.extra_requirements,
|
|
89
|
-
self.verifier_id
|
|
89
|
+
self.func, self.extra_requirements, self.verifier_id
|
|
90
90
|
)
|
|
91
91
|
self._bundle_sha = _get_bundle_sha(self._bundle_data)
|
|
92
|
-
logger.debug(
|
|
92
|
+
logger.debug(
|
|
93
|
+
f"Created bundle for {self.key} with SHA: {self._bundle_sha}"
|
|
94
|
+
)
|
|
93
95
|
except OSError as e:
|
|
94
96
|
# Can't create bundle - no source and no raw code
|
|
95
97
|
raise OSError(f"Cannot create bundle for {self.key}: {e}")
|
|
96
|
-
|
|
98
|
+
|
|
97
99
|
return self._bundle_data, self._bundle_sha
|
|
98
|
-
|
|
100
|
+
|
|
99
101
|
def _check_bundle_status(self, env: SyncEnv) -> tuple[str, bool]:
|
|
100
102
|
"""Check if bundle needs to be uploaded and return (sha, needs_upload)."""
|
|
101
103
|
bundle_data, bundle_sha = self._get_or_create_bundle()
|
|
102
|
-
|
|
104
|
+
|
|
103
105
|
# If bundle_data is empty, we're using server-side bundle
|
|
104
106
|
if not bundle_data:
|
|
105
107
|
logger.debug(f"Using server-side bundle {bundle_sha[:8]}...")
|
|
106
108
|
return bundle_sha, False # No upload needed, server has it
|
|
107
|
-
|
|
109
|
+
|
|
108
110
|
# 1. Check local process cache first
|
|
109
111
|
if bundle_sha in _uploaded_bundle_shas:
|
|
110
112
|
logger.debug(f"Bundle {bundle_sha[:8]}... found in local cache")
|
|
111
113
|
return bundle_sha, False # Already uploaded, no upload needed
|
|
112
|
-
|
|
114
|
+
|
|
113
115
|
# 2. Check if bundle exists on server (pseudocode)
|
|
114
116
|
# TODO: Add endpoint to check if bundle SHA exists in S3
|
|
115
117
|
try:
|
|
116
118
|
exists = env.check_bundle_exists(bundle_sha)
|
|
117
119
|
if exists.success:
|
|
118
|
-
logger.info(
|
|
120
|
+
logger.info(
|
|
121
|
+
f"Bundle {bundle_sha[:8]}... found on server, updating cache"
|
|
122
|
+
)
|
|
119
123
|
_uploaded_bundle_shas.add(bundle_sha)
|
|
120
124
|
return bundle_sha, False # Found on server, no upload needed
|
|
121
125
|
except Exception as e:
|
|
122
126
|
logger.warning(f"Failed to check bundle existence: {e}")
|
|
123
|
-
|
|
127
|
+
|
|
124
128
|
# 3. Bundle not found locally or on server - upload needed
|
|
125
129
|
logger.info(f"Bundle {bundle_sha[:8]}... needs to be uploaded")
|
|
126
130
|
return bundle_sha, True # Upload needed
|
|
127
|
-
|
|
131
|
+
|
|
128
132
|
def __call__(self, env: SyncEnv, *args, **kwargs) -> float:
|
|
129
133
|
"""Local execution of the verifier function with env as first parameter."""
|
|
130
134
|
try:
|
|
@@ -134,7 +138,7 @@ class SyncVerifierFunction:
|
|
|
134
138
|
else:
|
|
135
139
|
# For sync functions, call directly
|
|
136
140
|
result = self.func(env, *args, **kwargs)
|
|
137
|
-
|
|
141
|
+
|
|
138
142
|
# Handle different return types
|
|
139
143
|
if isinstance(result, (int, float)):
|
|
140
144
|
# Direct score return
|
|
@@ -144,16 +148,18 @@ class SyncVerifierFunction:
|
|
|
144
148
|
return result
|
|
145
149
|
else:
|
|
146
150
|
# Try to extract score from object attributes
|
|
147
|
-
if hasattr(result,
|
|
151
|
+
if hasattr(result, "score"):
|
|
148
152
|
return float(result.score)
|
|
149
153
|
else:
|
|
150
|
-
raise ValueError(
|
|
151
|
-
|
|
154
|
+
raise ValueError(
|
|
155
|
+
f"Verifier function must return a score (number). Got {type(result)}"
|
|
156
|
+
)
|
|
157
|
+
|
|
152
158
|
except Exception as e:
|
|
153
159
|
logger.error(f"Error in verifier {self.key}: {e}")
|
|
154
160
|
# Return error score 0
|
|
155
161
|
return 0.0
|
|
156
|
-
|
|
162
|
+
|
|
157
163
|
def remote(self, env: SyncEnv, *args, **kwargs) -> float:
|
|
158
164
|
"""Remote execution of the verifier function with SHA-based bundle caching."""
|
|
159
165
|
# Async verifiers are now supported by the backend
|
|
@@ -163,20 +169,20 @@ class SyncVerifierFunction:
|
|
|
163
169
|
# "The remote execution environment only supports synchronous functions. "
|
|
164
170
|
# "Please provide a synchronous version of your verifier."
|
|
165
171
|
# )
|
|
166
|
-
|
|
172
|
+
|
|
167
173
|
args_array = list(args)
|
|
168
174
|
args_array.append({"env": env.instance_id})
|
|
169
175
|
args = tuple(args_array)
|
|
170
|
-
|
|
176
|
+
|
|
171
177
|
try:
|
|
172
178
|
# Check if bundle needs to be uploaded
|
|
173
179
|
bundle_sha, needs_upload = self._check_bundle_status(env)
|
|
174
|
-
|
|
180
|
+
|
|
175
181
|
if needs_upload:
|
|
176
182
|
# Need to upload bundle to S3
|
|
177
183
|
logger.info(f"Uploading bundle {bundle_sha[:8]}... for {self.key}")
|
|
178
184
|
bundle_data, _ = self._get_or_create_bundle()
|
|
179
|
-
|
|
185
|
+
|
|
180
186
|
response = env.execute_verifier_remote(
|
|
181
187
|
bundle_data=bundle_data,
|
|
182
188
|
bundle_sha=bundle_sha,
|
|
@@ -185,42 +191,46 @@ class SyncVerifierFunction:
|
|
|
185
191
|
args=args,
|
|
186
192
|
args_array=args_array,
|
|
187
193
|
kwargs=kwargs,
|
|
188
|
-
needs_upload=True
|
|
194
|
+
needs_upload=True,
|
|
189
195
|
)
|
|
190
|
-
|
|
196
|
+
|
|
191
197
|
# Mark as uploaded after successful execution
|
|
192
198
|
_uploaded_bundle_shas.add(bundle_sha)
|
|
193
199
|
logger.debug(f"Registered bundle {bundle_sha[:8]}... as uploaded")
|
|
194
|
-
|
|
200
|
+
|
|
195
201
|
else:
|
|
196
202
|
# Bundle already available - execute without upload
|
|
197
|
-
logger.info(
|
|
203
|
+
logger.info(
|
|
204
|
+
f"Executing cached bundle {bundle_sha[:8]}... for {self.key}"
|
|
205
|
+
)
|
|
198
206
|
bundle_data, _ = self._get_or_create_bundle()
|
|
199
|
-
|
|
207
|
+
|
|
200
208
|
response = env.execute_verifier_remote(
|
|
201
|
-
bundle_data=bundle_data or b
|
|
209
|
+
bundle_data=bundle_data or b"", # Empty if using server-side bundle
|
|
202
210
|
bundle_sha=bundle_sha,
|
|
203
211
|
key=self.key,
|
|
204
212
|
function_name=self.func.__name__,
|
|
205
213
|
args=args,
|
|
206
214
|
args_array=args_array,
|
|
207
215
|
kwargs=kwargs,
|
|
208
|
-
needs_upload=False # Don't upload, just execute
|
|
216
|
+
needs_upload=False, # Don't upload, just execute
|
|
209
217
|
)
|
|
210
|
-
|
|
218
|
+
|
|
211
219
|
# Handle response
|
|
220
|
+
if response.stdout:
|
|
221
|
+
print(response.stdout)
|
|
212
222
|
if response.success:
|
|
213
223
|
return self._process_result(response.result)
|
|
214
224
|
else:
|
|
215
225
|
self._raise_remote_error(response.error)
|
|
216
|
-
|
|
226
|
+
|
|
217
227
|
except Exception as e:
|
|
218
228
|
logger.error(f"Remote execution failed for {self.key}: {e}")
|
|
219
229
|
# If it's an HTTP error, try to get more details
|
|
220
|
-
if hasattr(e,
|
|
230
|
+
if hasattr(e, "response") and hasattr(e.response, "text"):
|
|
221
231
|
logger.error(f"Server response: {e.response.text}")
|
|
222
232
|
raise
|
|
223
|
-
|
|
233
|
+
|
|
224
234
|
def _process_result(self, result: Any) -> float:
|
|
225
235
|
"""Process remote execution result, handling different return types."""
|
|
226
236
|
# Handle different return types like local execution
|
|
@@ -230,7 +240,7 @@ class SyncVerifierFunction:
|
|
|
230
240
|
return float(result["score"])
|
|
231
241
|
else:
|
|
232
242
|
# Try to extract score from object attributes
|
|
233
|
-
if hasattr(result,
|
|
243
|
+
if hasattr(result, "score"):
|
|
234
244
|
return float(result.score)
|
|
235
245
|
else:
|
|
236
246
|
# Best effort conversion
|
|
@@ -239,13 +249,13 @@ class SyncVerifierFunction:
|
|
|
239
249
|
except (ValueError, TypeError):
|
|
240
250
|
logger.warning(f"Could not convert result to float: {result}")
|
|
241
251
|
return 0.0
|
|
242
|
-
|
|
252
|
+
|
|
243
253
|
def _raise_remote_error(self, error_info: Dict[str, Any]):
|
|
244
254
|
"""Reconstruct remote error as local exception."""
|
|
245
255
|
error_type = error_info.get("type", "RuntimeError")
|
|
246
256
|
message = error_info.get("message", "Remote execution failed")
|
|
247
257
|
traceback_str = error_info.get("traceback", "")
|
|
248
|
-
|
|
258
|
+
|
|
249
259
|
# Create a rich error message
|
|
250
260
|
full_message = f"""
|
|
251
261
|
Remote verifier execution failed:
|
|
@@ -254,32 +264,32 @@ Remote verifier execution failed:
|
|
|
254
264
|
Remote traceback:
|
|
255
265
|
{traceback_str}
|
|
256
266
|
""".strip()
|
|
257
|
-
|
|
267
|
+
|
|
258
268
|
# Try to raise the original exception type
|
|
259
269
|
try:
|
|
260
270
|
exception_class = getattr(__builtins__, error_type, RuntimeError)
|
|
261
271
|
raise exception_class(full_message)
|
|
262
272
|
except:
|
|
263
273
|
raise RuntimeError(full_message)
|
|
264
|
-
|
|
274
|
+
|
|
265
275
|
def _get_env_id(self, env: SyncEnv) -> str:
|
|
266
276
|
"""Generate a unique identifier for the environment."""
|
|
267
277
|
# Use instance base URL or similar unique identifier
|
|
268
|
-
if hasattr(env,
|
|
278
|
+
if hasattr(env, "instance") and hasattr(env.instance, "base_url"):
|
|
269
279
|
return f"{env.instance.base_url}"
|
|
270
280
|
else:
|
|
271
281
|
# Fallback to object id (less ideal but works)
|
|
272
282
|
return str(id(env))
|
|
273
|
-
|
|
283
|
+
|
|
274
284
|
def _is_bundle_not_found_error(self, error: Exception) -> bool:
|
|
275
285
|
"""Check if the error indicates the bundle was not found on the server."""
|
|
276
286
|
# Check for common "bundle not found" error patterns
|
|
277
287
|
error_msg = str(error).lower()
|
|
278
288
|
return (
|
|
279
|
-
"bundle not found" in error_msg
|
|
280
|
-
"verifier not found" in error_msg
|
|
281
|
-
"404" in error_msg
|
|
282
|
-
"not found" in error_msg
|
|
289
|
+
"bundle not found" in error_msg
|
|
290
|
+
or "verifier not found" in error_msg
|
|
291
|
+
or "404" in error_msg
|
|
292
|
+
or "not found" in error_msg
|
|
283
293
|
)
|
|
284
294
|
|
|
285
295
|
|
|
@@ -287,21 +297,21 @@ def verifier(
|
|
|
287
297
|
key: Optional[str] = None,
|
|
288
298
|
extra_requirements: Optional[List[str]] = None,
|
|
289
299
|
sha256: Optional[str] = None,
|
|
290
|
-
raw_code: Optional[str] = None
|
|
300
|
+
raw_code: Optional[str] = None,
|
|
291
301
|
) -> Callable[[F], SyncVerifierFunction]:
|
|
292
302
|
"""
|
|
293
303
|
Decorator to create a verifier function with env-first pattern.
|
|
294
|
-
|
|
304
|
+
|
|
295
305
|
The decorated function must take 'env' as its first parameter, making it explicit
|
|
296
306
|
that verifiers operate within an environment context. This makes verifiers reusable
|
|
297
307
|
across different environments.
|
|
298
|
-
|
|
308
|
+
|
|
299
309
|
Args:
|
|
300
310
|
key: Optional key for the verifier. Defaults to function name.
|
|
301
311
|
extra_requirements: Additional PyPI packages needed by the verifier.
|
|
302
312
|
sha256: Optional SHA256 hash of existing server-side bundle to use.
|
|
303
313
|
raw_code: Optional raw code to use as bundle (bypasses source extraction).
|
|
304
|
-
|
|
314
|
+
|
|
305
315
|
Example:
|
|
306
316
|
# Synchronous verifier (works locally and remotely)
|
|
307
317
|
@verifier(key="check_user_count")
|
|
@@ -310,7 +320,7 @@ def verifier(
|
|
|
310
320
|
result = db.query("SELECT COUNT(*) FROM users")
|
|
311
321
|
actual_count = result.rows[0][0]
|
|
312
322
|
return 1.0 if actual_count >= expected_count else 0.0
|
|
313
|
-
|
|
323
|
+
|
|
314
324
|
# Async verifier (only works locally)
|
|
315
325
|
@verifier(key="check_user_async")
|
|
316
326
|
async def check_user_async(env, expected_count: int) -> float:
|
|
@@ -318,29 +328,25 @@ def verifier(
|
|
|
318
328
|
result = await db.query("SELECT COUNT(*) FROM users")
|
|
319
329
|
actual_count = result.rows[0][0]
|
|
320
330
|
return 1.0 if actual_count >= expected_count else 0.0
|
|
321
|
-
|
|
331
|
+
|
|
322
332
|
# Usage
|
|
323
|
-
env = await
|
|
324
|
-
|
|
333
|
+
env = await fleet.env.make_async("fira")
|
|
334
|
+
|
|
325
335
|
# Local execution
|
|
326
336
|
result = await check_user_count(env, 5) # sync verifier
|
|
327
337
|
result = await check_user_async(env, 5) # async verifier
|
|
328
|
-
|
|
338
|
+
|
|
329
339
|
# Remote execution
|
|
330
340
|
result = await check_user_count.remote(env, 5) # sync verifier works
|
|
331
341
|
# await check_user_async.remote(env, 5) # raises NotImplementedError
|
|
332
342
|
"""
|
|
343
|
+
|
|
333
344
|
def decorator(func: F) -> SyncVerifierFunction:
|
|
334
345
|
verifier_key = key or func.__name__
|
|
335
346
|
verifier_uuid = str(uuid.uuid4())
|
|
336
|
-
|
|
347
|
+
|
|
337
348
|
return SyncVerifierFunction(
|
|
338
|
-
func,
|
|
339
|
-
verifier_key,
|
|
340
|
-
extra_requirements,
|
|
341
|
-
verifier_uuid,
|
|
342
|
-
sha256,
|
|
343
|
-
raw_code
|
|
349
|
+
func, verifier_key, extra_requirements, verifier_uuid, sha256, raw_code
|
|
344
350
|
)
|
|
345
|
-
|
|
346
|
-
return decorator
|
|
351
|
+
|
|
352
|
+
return decorator
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fleet-python
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.34
|
|
4
4
|
Summary: Python SDK for Fleet environments
|
|
5
5
|
Author-email: Fleet AI <nic@fleet.so>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -65,11 +65,11 @@ export FLEET_API_KEY="sk_your_key_here"
|
|
|
65
65
|
## Basic Usage
|
|
66
66
|
|
|
67
67
|
```python
|
|
68
|
-
import fleet
|
|
68
|
+
import fleet
|
|
69
69
|
import datetime
|
|
70
70
|
|
|
71
71
|
# Create environment by key
|
|
72
|
-
env =
|
|
72
|
+
env = fleet.env.make("fira")
|
|
73
73
|
|
|
74
74
|
# Reset environment with seed and options
|
|
75
75
|
env.reset(
|
|
@@ -91,10 +91,10 @@ env.close()
|
|
|
91
91
|
|
|
92
92
|
```python
|
|
93
93
|
# Create environment instance with explicit version
|
|
94
|
-
env =
|
|
94
|
+
env = fleet.env.make("fira:v1.2.5")
|
|
95
95
|
|
|
96
96
|
# Create environment instance with default (latest) version
|
|
97
|
-
env =
|
|
97
|
+
env = fleet.env.make("fira")
|
|
98
98
|
|
|
99
99
|
```
|
|
100
100
|
|
|
@@ -102,18 +102,18 @@ env = flt.env.make("fira")
|
|
|
102
102
|
|
|
103
103
|
```python
|
|
104
104
|
# Connect to a running instance
|
|
105
|
-
env =
|
|
105
|
+
env = fleet.env.get("env_instance_id")
|
|
106
106
|
|
|
107
107
|
# List all running instances
|
|
108
|
-
instances =
|
|
108
|
+
instances = fleet.env.list_instances()
|
|
109
109
|
for instance in instances:
|
|
110
110
|
print(f"Instance: {instance.instance_id}")
|
|
111
111
|
print(f"Type: {instance.environment_type}")
|
|
112
112
|
print(f"Status: {instance.status}")
|
|
113
113
|
|
|
114
114
|
# Filter instances by status (running, pending, stopped, error)
|
|
115
|
-
running_instances =
|
|
115
|
+
running_instances = fleet.env.list_instances(status_filter="running")
|
|
116
116
|
|
|
117
117
|
# List available environment types
|
|
118
|
-
available_envs =
|
|
118
|
+
available_envs = fleet.env.list_envs()
|
|
119
119
|
```
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
examples/diff_example.py,sha256=iLlpBW_NBjzXBqlvYwjx74uxYZkMGJfea6s3tJhvuNY,5684
|
|
2
|
+
examples/dsl_example.py,sha256=yFLgM-Was4-w575xJgPk9DIBmXa34hLJsIB4XwTADOE,7252
|
|
3
|
+
examples/example.py,sha256=yn9mqS2yJ6896s25btnJx9-_SLLbyS-Fu-SIcas6jok,1081
|
|
4
|
+
examples/exampleResume.py,sha256=hzdL9QfYtwlje5geWS2cgWgjcnLX4UtXSAd-92F66Lw,7044
|
|
5
|
+
examples/example_account.py,sha256=t5_Tnr7DcLYfNpEAbuBySQIqsqiQQGySuiItIghCjAM,225
|
|
6
|
+
examples/example_action_log.py,sha256=pwvLro_Fkrw4DII002bHGuWfoZ6QRvUMDD9BnMqJgLQ,622
|
|
7
|
+
examples/example_client.py,sha256=M9Mfi1FcD2LtSDVk89R_-tgG98swvDYy4qx2zVayJ-0,1025
|
|
8
|
+
examples/example_mcp_anthropic.py,sha256=2ouLWAojhdnxhJc6yxkgo8e3TnNjC48yz8zpaPQm3Jw,2597
|
|
9
|
+
examples/example_mcp_openai.py,sha256=xhqJd2-mnQs4-ZmydGrX7pPs7_X5i-YFqkO1cr3L-5g,480
|
|
10
|
+
examples/example_sync.py,sha256=EkuWmUzB1ZsBJQk6ZRflB793rKsuRHeSg5HJZHVhBB0,975
|
|
11
|
+
examples/example_task.py,sha256=dhG6STAkNsTdHs9cO1RFH9WfuvRmq5bRC211hTeFrk8,7088
|
|
12
|
+
examples/example_tasks.py,sha256=Af57KbxpDxWWAVnjVC6IC0Rbxr_Z6kTEQk-XcDe4vTo,747
|
|
13
|
+
examples/example_verifier.py,sha256=0vwNITIG3m4CkSPwIxNXcGx9TqrxEsCGqK2A8keKZMM,2392
|
|
14
|
+
examples/gemini_example.py,sha256=qj9WDazQTYNiRHNeUg9Tjkp33lJMwbx8gDfpFe1sDQo,16180
|
|
15
|
+
examples/json_tasks_example.py,sha256=CYPESGGtOo0fmsDdLidujTfsE4QlJHw7rOhyVqPJ_Ls,5329
|
|
16
|
+
examples/nova_act_example.py,sha256=rH23Lp74Okf0rn8ynMdWjK2aviEf5NLPH4k_53Pyxho,831
|
|
17
|
+
examples/openai_example.py,sha256=dEWERrTEP5xBiGkLkQjBQGd2NqoxX6gcW6XteBPsWFQ,8231
|
|
18
|
+
examples/openai_simple_example.py,sha256=HmiufucrAZne7tHq9uoEsDWlEhjNC265bQAyIGBRU2o,1745
|
|
19
|
+
examples/query_builder_example.py,sha256=-cOMfWGNifYfYEt_Ds73XpwATZvFDL6F4KTkVxdMjzg,3951
|
|
20
|
+
examples/quickstart.py,sha256=1VT39IRRhemsJgxi0O0gprdpcw7HB4pYO97GAYagIcg,3788
|
|
21
|
+
examples/test_cdp_logging.py,sha256=AkCwQCgOTQEI8w3v0knWK_4eXMph7L9x07wj9yIYM10,2836
|
|
22
|
+
fleet/__init__.py,sha256=LYJ8zS6Ldo5wLpRqsFMoiikkyosTmm7sRTUY4SnJAgE,3880
|
|
23
|
+
fleet/base.py,sha256=bc-340sTpq_DJs7yQ9d2pDWnmJFmA1SwDB9Lagvqtb4,9182
|
|
24
|
+
fleet/client.py,sha256=JG9soTIkGK_uRezHU79PFn7PBXeN1iNpun1D4JDFTyE,22310
|
|
25
|
+
fleet/config.py,sha256=uY02ZKxVoXqVDta-0IMWaYJeE1CTXF_fA9NI6QUutmU,319
|
|
26
|
+
fleet/exceptions.py,sha256=fUmPwWhnT8SR97lYsRq0kLHQHKtSh2eJS0VQ2caSzEI,5055
|
|
27
|
+
fleet/global_client.py,sha256=oSWhV1cggVKQ0ec0YDOGu6Zr0Tgdcx3oKMM6s2Y9fQw,1073
|
|
28
|
+
fleet/models.py,sha256=9tDjgcgKPMnf-R_MDh-Ocp_UMbyJ8tJyjb15XqU0N94,12454
|
|
29
|
+
fleet/tasks.py,sha256=1AlNhe0WRggj3pIwTeaxMhpmMqI0MGBVjEmODVu37YI,5648
|
|
30
|
+
fleet/types.py,sha256=L4Y82xICf1tzyCLqhLYUgEoaIIS5h9T05TyFNHSWs3s,652
|
|
31
|
+
fleet/_async/__init__.py,sha256=1X00u-0Zu4S-e8MGE9nJWbZEt3H-DHZA-gfwN-JuP2U,7415
|
|
32
|
+
fleet/_async/base.py,sha256=oisVTQsx0M_yTmyQJc3oij63uKZ97MHz-xYFsWXxQE8,9202
|
|
33
|
+
fleet/_async/client.py,sha256=cX5eFE4J1nfdXddarc2HcNQpBYzQejlVWwbM2n3URlg,22497
|
|
34
|
+
fleet/_async/exceptions.py,sha256=fUmPwWhnT8SR97lYsRq0kLHQHKtSh2eJS0VQ2caSzEI,5055
|
|
35
|
+
fleet/_async/global_client.py,sha256=4WskpLHbsDEgWW7hXMD09W-brkp4euy8w2ZJ88594rQ,1103
|
|
36
|
+
fleet/_async/models.py,sha256=9tDjgcgKPMnf-R_MDh-Ocp_UMbyJ8tJyjb15XqU0N94,12454
|
|
37
|
+
fleet/_async/tasks.py,sha256=jHGAvMkR3byayR429YSDiiIDV3W30y4UHZf9W6UhA8M,5721
|
|
38
|
+
fleet/_async/env/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
39
|
+
fleet/_async/env/client.py,sha256=Fx4jVEGlM4JB_pgk9lZutzPAOgp6Yi3vxt3waMPrMvM,971
|
|
40
|
+
fleet/_async/instance/__init__.py,sha256=PtmJq8J8bh0SOQ2V55QURz5GJfobozwtQoqhaOk3_tI,515
|
|
41
|
+
fleet/_async/instance/base.py,sha256=3qUBuUR8OVS36LzdP6KyZzngtwPKYO09HoY6Ekxp-KA,1625
|
|
42
|
+
fleet/_async/instance/client.py,sha256=z9q_-dIBwPc1X6VlQOi_aV2v6KOKueJGg8NMyP5iFQM,6082
|
|
43
|
+
fleet/_async/resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
44
|
+
fleet/_async/resources/base.py,sha256=UfrenxUqcpL8SgYGOo8o8HgRvv2-ZO5G2Cdo91ofEdg,664
|
|
45
|
+
fleet/_async/resources/browser.py,sha256=oldoSiymJ1lJkADhpUG81ViOBDNyppX1jSoEwe9-W94,1369
|
|
46
|
+
fleet/_async/resources/mcp.py,sha256=TLEsLiFhfVfZFs0Fu_uDPm-h4FPdvqgQblYqs-PTHhc,1720
|
|
47
|
+
fleet/_async/resources/sqlite.py,sha256=h6pX41j8_aJaeZ7UVs25QQGgMWbHMPlGpDnPGMIAF6w,26133
|
|
48
|
+
fleet/_async/verifiers/__init__.py,sha256=1WTlCNq4tIFbbXaQu5Bf2WppZq0A8suhtZbxMTSOwxI,465
|
|
49
|
+
fleet/_async/verifiers/bundler.py,sha256=Sq0KkqEhM5Ng2x8R6Z4puXvQ8FMlEO7D3-ldBLktPi4,26205
|
|
50
|
+
fleet/_async/verifiers/verifier.py,sha256=lwVIV5ZpWJhM87tXShtjwN5KP7n5XDcPq0XX7AjV6_E,14343
|
|
51
|
+
fleet/env/__init__.py,sha256=6-zgP705M61tCquiDKw29dBZGq1US9mtsB1gQngJ4FQ,664
|
|
52
|
+
fleet/env/client.py,sha256=I4pjnXGzifZSr7iZFdn0cTX6nLuGYo-sCt-qk4ez29Y,805
|
|
53
|
+
fleet/instance/__init__.py,sha256=CyWUkbGAK-DBPw4DC4AnCW-MqqheGhZMA5QSRVu-ws4,479
|
|
54
|
+
fleet/instance/base.py,sha256=OYqzBwZFfTX9wlBGSG5gljqj98NbiJeKIfFJ3uj5I4s,1587
|
|
55
|
+
fleet/instance/client.py,sha256=O6B0A2Z0b5SxOLs4TipZ9Ol8yG-b-LG15vVOKMmd6BQ,5908
|
|
56
|
+
fleet/instance/models.py,sha256=ZTiue0YOuhuwX8jYfJAoCzGfqjLqqXRLqK1LVFhq6rQ,4183
|
|
57
|
+
fleet/resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
58
|
+
fleet/resources/base.py,sha256=AXZzT0_yWHkT497q3yekfr0xsD4cPGMCC6y7C43TIkk,663
|
|
59
|
+
fleet/resources/browser.py,sha256=hRNM0YMsVQUAraZGNi_B-KXxLpuddy4ntoEDFSw7czU,1295
|
|
60
|
+
fleet/resources/mcp.py,sha256=c6O4vVJnXANuHMGMe4IPxgp4zBEbFaGm6_d9e6j8Myc,1695
|
|
61
|
+
fleet/resources/sqlite.py,sha256=rwpYmfyw8CjlA-HEsD4fCqYS8wFMxaTiX_tO3gJxDjg,25763
|
|
62
|
+
fleet/verifiers/__init__.py,sha256=IlImvlfgMRQ2V6f4_n7skXYBV8ZoUUjnWaFKnYQQsU8,459
|
|
63
|
+
fleet/verifiers/bundler.py,sha256=Sq0KkqEhM5Ng2x8R6Z4puXvQ8FMlEO7D3-ldBLktPi4,26205
|
|
64
|
+
fleet/verifiers/code.py,sha256=A1i_UabZspbyj1awzKVQ_HRxgMO3fU7NbkxYyTrp7So,48
|
|
65
|
+
fleet/verifiers/db.py,sha256=tssmvJjDHuBIy8qlL_P5-UdmEFUw2DZcqLsWZ8ot3Xw,27766
|
|
66
|
+
fleet/verifiers/decorator.py,sha256=nAP3O8szXu7md_kpwpz91hGSUNEVLYjwZQZTkQlV1DM,3260
|
|
67
|
+
fleet/verifiers/parse.py,sha256=0bAbj9VvT__yU4ZVREUK-Tn9dukh9LCpmfVsgj1DfP4,8508
|
|
68
|
+
fleet/verifiers/sql_differ.py,sha256=dmiGCFXVMEMbAX519OjhVqgA8ZvhnvdmC1BVpL7QCF0,6490
|
|
69
|
+
fleet/verifiers/verifier.py,sha256=53oBWAf0yy3bZmZx9eH9AWIf65H7OP2UUm0YwWCL6Mc,14286
|
|
70
|
+
fleet_python-0.2.34.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
71
|
+
scripts/fix_sync_imports.py,sha256=0XKTkAV7WdMxRfk8-x4Ts1LjSbUpyI0tPL0DcTQ_38w,7308
|
|
72
|
+
scripts/unasync.py,sha256=vWVQxRWX8SRZO5cmzEhpvnG_REhCWXpidIGIpWmEcvI,696
|
|
73
|
+
fleet_python-0.2.34.dist-info/METADATA,sha256=WmolSCZR49qXHttFTyPhRnEJxj6po_YbDeUhOnk4t9M,3354
|
|
74
|
+
fleet_python-0.2.34.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
75
|
+
fleet_python-0.2.34.dist-info/top_level.txt,sha256=_3DSmTohvSDf3AIP_BYfGzhwO1ECFwuzg83X-wHCx3Y,23
|
|
76
|
+
fleet_python-0.2.34.dist-info/RECORD,,
|