fleet-python 0.2.81__tar.gz → 0.2.83__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.
- {fleet_python-0.2.81/fleet_python.egg-info → fleet_python-0.2.83}/PKG-INFO +5 -1
- {fleet_python-0.2.81 → fleet_python-0.2.83}/README.md +4 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/__init__.py +126 -4
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/_async/__init__.py +2 -2
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/_async/base.py +1 -1
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/_async/client.py +549 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/agent/gemini_cua/agent.py +80 -42
- fleet_python-0.2.83/fleet/agent/gemini_cua/mcp_server.py +242 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/agent/orchestrator.py +82 -8
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/agent/types.py +1 -1
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/base.py +11 -1
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/cli.py +107 -32
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/client.py +518 -0
- fleet_python-0.2.83/fleet/eval/__init__.py +15 -0
- fleet_python-0.2.83/fleet/eval/uploader.py +231 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/exceptions.py +8 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/models.py +117 -0
- fleet_python-0.2.83/fleet/proxy/__init__.py +25 -0
- fleet_python-0.2.83/fleet/proxy/proxy.py +453 -0
- fleet_python-0.2.83/fleet/proxy/whitelist.py +244 -0
- fleet_python-0.2.83/fleet/utils/__init__.py +7 -0
- fleet_python-0.2.83/fleet/utils/http_logging.py +178 -0
- fleet_python-0.2.83/fleet/utils/logging.py +13 -0
- fleet_python-0.2.81/fleet/agent/gemini_cua/mcp_server.py → fleet_python-0.2.83/fleet/utils/playwright.py +189 -269
- {fleet_python-0.2.81 → fleet_python-0.2.83/fleet_python.egg-info}/PKG-INFO +5 -1
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet_python.egg-info/SOURCES.txt +9 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/pyproject.toml +1 -1
- {fleet_python-0.2.81 → fleet_python-0.2.83}/LICENSE +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/examples/diff_example.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/examples/dsl_example.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/examples/example.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/examples/exampleResume.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/examples/example_account.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/examples/example_action_log.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/examples/example_client.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/examples/example_mcp_anthropic.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/examples/example_mcp_openai.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/examples/example_sync.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/examples/example_task.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/examples/example_tasks.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/examples/example_verifier.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/examples/export_tasks.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/examples/fetch_tasks.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/examples/gemini_example.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/examples/import_tasks.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/examples/iterate_verifiers.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/examples/json_tasks_example.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/examples/nova_act_example.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/examples/openai_example.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/examples/openai_simple_example.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/examples/query_builder_example.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/examples/quickstart.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/examples/test_cdp_logging.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/_async/env/__init__.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/_async/env/client.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/_async/exceptions.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/_async/global_client.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/_async/instance/__init__.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/_async/instance/base.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/_async/instance/client.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/_async/models.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/_async/resources/__init__.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/_async/resources/base.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/_async/resources/browser.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/_async/resources/mcp.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/_async/resources/sqlite.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/_async/tasks.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/_async/verifiers/__init__.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/_async/verifiers/bundler.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/_async/verifiers/verifier.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/agent/__init__.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/agent/gemini_cua/__init__.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/agent/utils.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/config.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/env/__init__.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/env/client.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/global_client.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/instance/__init__.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/instance/base.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/instance/client.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/instance/models.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/resources/__init__.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/resources/base.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/resources/browser.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/resources/mcp.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/resources/sqlite.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/tasks.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/types.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/verifiers/__init__.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/verifiers/bundler.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/verifiers/code.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/verifiers/db.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/verifiers/decorator.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/verifiers/parse.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/verifiers/sql_differ.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet/verifiers/verifier.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet_python.egg-info/dependency_links.txt +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet_python.egg-info/entry_points.txt +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet_python.egg-info/requires.txt +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/fleet_python.egg-info/top_level.txt +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/scripts/fix_sync_imports.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/scripts/unasync.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/setup.cfg +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/tests/__init__.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/tests/test_app_method.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/tests/test_expect_only.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/tests/test_instance_dispatch.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/tests/test_sqlite_resource_dual_mode.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/tests/test_sqlite_shared_memory_behavior.py +0 -0
- {fleet_python-0.2.81 → fleet_python-0.2.83}/tests/test_verifier_from_string.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fleet-python
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.83
|
|
4
4
|
Summary: Python SDK for Fleet environments
|
|
5
5
|
Author-email: Fleet AI <nic@fleet.so>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -49,6 +49,10 @@ Dynamic: license-file
|
|
|
49
49
|
|
|
50
50
|
# Fleet SDK
|
|
51
51
|
|
|
52
|
+
[](https://pypi.org/project/fleet-python/)
|
|
53
|
+
[](https://pypi.org/project/fleet-python/)
|
|
54
|
+
[](https://pypi.org/project/fleet-python/)
|
|
55
|
+
|
|
52
56
|
The Fleet Python SDK provides programmatic access to Fleet's environment infrastructure.
|
|
53
57
|
|
|
54
58
|
## Installation
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Fleet SDK
|
|
2
2
|
|
|
3
|
+
[](https://pypi.org/project/fleet-python/)
|
|
4
|
+
[](https://pypi.org/project/fleet-python/)
|
|
5
|
+
[](https://pypi.org/project/fleet-python/)
|
|
6
|
+
|
|
3
7
|
The Fleet Python SDK provides programmatic access to Fleet's environment infrastructure.
|
|
4
8
|
|
|
5
9
|
## Installation
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
"""Fleet Python SDK - Environment-based AI agent interactions."""
|
|
16
16
|
|
|
17
|
-
from typing import Optional, List
|
|
17
|
+
from typing import Any, Optional, List
|
|
18
18
|
|
|
19
19
|
from .exceptions import (
|
|
20
20
|
FleetError,
|
|
@@ -24,8 +24,8 @@ from .exceptions import (
|
|
|
24
24
|
FleetInstanceLimitError,
|
|
25
25
|
FleetConfigurationError,
|
|
26
26
|
)
|
|
27
|
-
from .client import Fleet, SyncEnv
|
|
28
|
-
from ._async.client import AsyncFleet, AsyncEnv
|
|
27
|
+
from .client import Fleet, SyncEnv, Session
|
|
28
|
+
from ._async.client import AsyncFleet, AsyncEnv, AsyncSession
|
|
29
29
|
from .models import InstanceResponse, Environment, Run
|
|
30
30
|
from .instance.models import Resource, ResetResponse
|
|
31
31
|
|
|
@@ -73,7 +73,7 @@ from . import env
|
|
|
73
73
|
from . import global_client as _global_client
|
|
74
74
|
from ._async import global_client as _async_global_client
|
|
75
75
|
|
|
76
|
-
__version__ = "0.2.
|
|
76
|
+
__version__ = "0.2.83"
|
|
77
77
|
|
|
78
78
|
__all__ = [
|
|
79
79
|
# Core classes
|
|
@@ -122,6 +122,14 @@ __all__ = [
|
|
|
122
122
|
"import_tasks_async",
|
|
123
123
|
"get_task",
|
|
124
124
|
"get_task_async",
|
|
125
|
+
# Session helpers
|
|
126
|
+
"session",
|
|
127
|
+
"session_async",
|
|
128
|
+
"Session",
|
|
129
|
+
"AsyncSession",
|
|
130
|
+
# Job helpers
|
|
131
|
+
"job",
|
|
132
|
+
"job_async",
|
|
125
133
|
# Version
|
|
126
134
|
"__version__",
|
|
127
135
|
]
|
|
@@ -162,3 +170,117 @@ def reset_client():
|
|
|
162
170
|
"""Reset both sync and async global clients."""
|
|
163
171
|
_global_client.reset_client()
|
|
164
172
|
_async_global_client.reset_client()
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
def session(
|
|
176
|
+
session_id: Optional[str] = None,
|
|
177
|
+
job_id: Optional[str] = None,
|
|
178
|
+
config: Optional[Any] = None,
|
|
179
|
+
model: Optional[str] = None,
|
|
180
|
+
task_key: Optional[str] = None,
|
|
181
|
+
instance_id: Optional[str] = None,
|
|
182
|
+
) -> Session:
|
|
183
|
+
"""Start a new session for logging agent interactions (sync).
|
|
184
|
+
|
|
185
|
+
This returns a Session object. The session is created on the backend
|
|
186
|
+
when you call log() for the first time.
|
|
187
|
+
|
|
188
|
+
Args:
|
|
189
|
+
session_id: Optional existing session ID to resume
|
|
190
|
+
job_id: Optional job ID to associate with the session
|
|
191
|
+
config: Optional config object (e.g., GenerateContentConfig) to log
|
|
192
|
+
model: Optional model name to log
|
|
193
|
+
task_key: Optional Fleet task key
|
|
194
|
+
instance_id: Optional Fleet instance ID
|
|
195
|
+
|
|
196
|
+
Returns:
|
|
197
|
+
Session object with log(), complete(), and fail() methods
|
|
198
|
+
|
|
199
|
+
Example:
|
|
200
|
+
session = fleet.session(config=config, model="gpt-4", task_key="task_123")
|
|
201
|
+
session.log(history, response)
|
|
202
|
+
session.complete()
|
|
203
|
+
"""
|
|
204
|
+
client = _global_client.get_client()
|
|
205
|
+
return client.start_session(
|
|
206
|
+
session_id=session_id,
|
|
207
|
+
job_id=job_id,
|
|
208
|
+
config=config,
|
|
209
|
+
model=model,
|
|
210
|
+
task_key=task_key,
|
|
211
|
+
instance_id=instance_id,
|
|
212
|
+
)
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
def session_async(
|
|
216
|
+
session_id: Optional[str] = None,
|
|
217
|
+
job_id: Optional[str] = None,
|
|
218
|
+
config: Optional[Any] = None,
|
|
219
|
+
model: Optional[str] = None,
|
|
220
|
+
task_key: Optional[str] = None,
|
|
221
|
+
instance_id: Optional[str] = None,
|
|
222
|
+
) -> AsyncSession:
|
|
223
|
+
"""Start a new session for logging agent interactions (async).
|
|
224
|
+
|
|
225
|
+
This returns an AsyncSession object. The session is created on the backend
|
|
226
|
+
when you call log() for the first time.
|
|
227
|
+
|
|
228
|
+
Args:
|
|
229
|
+
session_id: Optional existing session ID to resume
|
|
230
|
+
job_id: Optional job ID to associate with the session
|
|
231
|
+
config: Optional config object (e.g., GenerateContentConfig) to log
|
|
232
|
+
model: Optional model name to log
|
|
233
|
+
task_key: Optional Fleet task key
|
|
234
|
+
instance_id: Optional Fleet instance ID
|
|
235
|
+
|
|
236
|
+
Returns:
|
|
237
|
+
AsyncSession object with log(), complete(), and fail() methods
|
|
238
|
+
|
|
239
|
+
Example:
|
|
240
|
+
session = fleet.session_async(config=config, model="gpt-4", task_key="task_123")
|
|
241
|
+
await session.log(history, response)
|
|
242
|
+
await session.complete()
|
|
243
|
+
"""
|
|
244
|
+
client = _async_global_client.get_client()
|
|
245
|
+
return client.start_session(
|
|
246
|
+
session_id=session_id,
|
|
247
|
+
job_id=job_id,
|
|
248
|
+
config=config,
|
|
249
|
+
model=model,
|
|
250
|
+
task_key=task_key,
|
|
251
|
+
instance_id=instance_id,
|
|
252
|
+
)
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
def job(name: str) -> str:
|
|
256
|
+
"""Create a new trace job (sync).
|
|
257
|
+
|
|
258
|
+
Args:
|
|
259
|
+
name: Name of the job
|
|
260
|
+
|
|
261
|
+
Returns:
|
|
262
|
+
The job_id string
|
|
263
|
+
|
|
264
|
+
Example:
|
|
265
|
+
job_id = fleet.job("my-agent-run")
|
|
266
|
+
session = fleet.session(job_id=job_id, ...)
|
|
267
|
+
"""
|
|
268
|
+
client = _global_client.get_client()
|
|
269
|
+
return client.trace_job(name=name)
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
async def job_async(name: str) -> str:
|
|
273
|
+
"""Create a new trace job (async).
|
|
274
|
+
|
|
275
|
+
Args:
|
|
276
|
+
name: Name of the job
|
|
277
|
+
|
|
278
|
+
Returns:
|
|
279
|
+
The job_id string
|
|
280
|
+
|
|
281
|
+
Example:
|
|
282
|
+
job_id = await fleet.job_async("my-agent-run")
|
|
283
|
+
session = await fleet.session_async(job_id=job_id, ...)
|
|
284
|
+
"""
|
|
285
|
+
client = _async_global_client.get_client()
|
|
286
|
+
return await client.trace_job(name=name)
|
|
@@ -24,7 +24,7 @@ from ..exceptions import (
|
|
|
24
24
|
FleetInstanceLimitError,
|
|
25
25
|
FleetConfigurationError,
|
|
26
26
|
)
|
|
27
|
-
from .client import AsyncFleet, AsyncEnv
|
|
27
|
+
from .client import AsyncFleet, AsyncEnv, AsyncSession
|
|
28
28
|
from ..models import InstanceResponse, Environment, AccountResponse, Run
|
|
29
29
|
from ..instance.models import Resource, ResetResponse
|
|
30
30
|
|
|
@@ -44,7 +44,7 @@ from ..types import VerifierFunction
|
|
|
44
44
|
from .. import env
|
|
45
45
|
from . import global_client as _async_global_client
|
|
46
46
|
|
|
47
|
-
__version__ = "0.2.
|
|
47
|
+
__version__ = "0.2.83"
|
|
48
48
|
|
|
49
49
|
__all__ = [
|
|
50
50
|
# Core classes
|