fleet-python 0.2.81__tar.gz → 0.2.82__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.
Files changed (110) hide show
  1. {fleet_python-0.2.81/fleet_python.egg-info → fleet_python-0.2.82}/PKG-INFO +5 -1
  2. {fleet_python-0.2.81 → fleet_python-0.2.82}/README.md +4 -0
  3. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/__init__.py +126 -4
  4. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/_async/__init__.py +2 -2
  5. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/_async/base.py +1 -1
  6. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/_async/client.py +549 -0
  7. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/agent/gemini_cua/agent.py +80 -42
  8. fleet_python-0.2.82/fleet/agent/gemini_cua/mcp_server.py +242 -0
  9. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/agent/orchestrator.py +82 -8
  10. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/agent/types.py +1 -1
  11. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/base.py +11 -1
  12. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/cli.py +107 -32
  13. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/client.py +518 -0
  14. fleet_python-0.2.82/fleet/eval/__init__.py +15 -0
  15. fleet_python-0.2.82/fleet/eval/uploader.py +231 -0
  16. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/exceptions.py +8 -0
  17. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/models.py +117 -0
  18. fleet_python-0.2.82/fleet/proxy/__init__.py +25 -0
  19. fleet_python-0.2.82/fleet/proxy/proxy.py +453 -0
  20. fleet_python-0.2.82/fleet/proxy/whitelist.py +244 -0
  21. fleet_python-0.2.82/fleet/utils/__init__.py +7 -0
  22. fleet_python-0.2.82/fleet/utils/http_logging.py +178 -0
  23. fleet_python-0.2.82/fleet/utils/logging.py +13 -0
  24. fleet_python-0.2.81/fleet/agent/gemini_cua/mcp_server.py → fleet_python-0.2.82/fleet/utils/playwright.py +189 -269
  25. {fleet_python-0.2.81 → fleet_python-0.2.82/fleet_python.egg-info}/PKG-INFO +5 -1
  26. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet_python.egg-info/SOURCES.txt +9 -0
  27. {fleet_python-0.2.81 → fleet_python-0.2.82}/pyproject.toml +1 -1
  28. {fleet_python-0.2.81 → fleet_python-0.2.82}/LICENSE +0 -0
  29. {fleet_python-0.2.81 → fleet_python-0.2.82}/examples/diff_example.py +0 -0
  30. {fleet_python-0.2.81 → fleet_python-0.2.82}/examples/dsl_example.py +0 -0
  31. {fleet_python-0.2.81 → fleet_python-0.2.82}/examples/example.py +0 -0
  32. {fleet_python-0.2.81 → fleet_python-0.2.82}/examples/exampleResume.py +0 -0
  33. {fleet_python-0.2.81 → fleet_python-0.2.82}/examples/example_account.py +0 -0
  34. {fleet_python-0.2.81 → fleet_python-0.2.82}/examples/example_action_log.py +0 -0
  35. {fleet_python-0.2.81 → fleet_python-0.2.82}/examples/example_client.py +0 -0
  36. {fleet_python-0.2.81 → fleet_python-0.2.82}/examples/example_mcp_anthropic.py +0 -0
  37. {fleet_python-0.2.81 → fleet_python-0.2.82}/examples/example_mcp_openai.py +0 -0
  38. {fleet_python-0.2.81 → fleet_python-0.2.82}/examples/example_sync.py +0 -0
  39. {fleet_python-0.2.81 → fleet_python-0.2.82}/examples/example_task.py +0 -0
  40. {fleet_python-0.2.81 → fleet_python-0.2.82}/examples/example_tasks.py +0 -0
  41. {fleet_python-0.2.81 → fleet_python-0.2.82}/examples/example_verifier.py +0 -0
  42. {fleet_python-0.2.81 → fleet_python-0.2.82}/examples/export_tasks.py +0 -0
  43. {fleet_python-0.2.81 → fleet_python-0.2.82}/examples/fetch_tasks.py +0 -0
  44. {fleet_python-0.2.81 → fleet_python-0.2.82}/examples/gemini_example.py +0 -0
  45. {fleet_python-0.2.81 → fleet_python-0.2.82}/examples/import_tasks.py +0 -0
  46. {fleet_python-0.2.81 → fleet_python-0.2.82}/examples/iterate_verifiers.py +0 -0
  47. {fleet_python-0.2.81 → fleet_python-0.2.82}/examples/json_tasks_example.py +0 -0
  48. {fleet_python-0.2.81 → fleet_python-0.2.82}/examples/nova_act_example.py +0 -0
  49. {fleet_python-0.2.81 → fleet_python-0.2.82}/examples/openai_example.py +0 -0
  50. {fleet_python-0.2.81 → fleet_python-0.2.82}/examples/openai_simple_example.py +0 -0
  51. {fleet_python-0.2.81 → fleet_python-0.2.82}/examples/query_builder_example.py +0 -0
  52. {fleet_python-0.2.81 → fleet_python-0.2.82}/examples/quickstart.py +0 -0
  53. {fleet_python-0.2.81 → fleet_python-0.2.82}/examples/test_cdp_logging.py +0 -0
  54. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/_async/env/__init__.py +0 -0
  55. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/_async/env/client.py +0 -0
  56. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/_async/exceptions.py +0 -0
  57. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/_async/global_client.py +0 -0
  58. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/_async/instance/__init__.py +0 -0
  59. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/_async/instance/base.py +0 -0
  60. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/_async/instance/client.py +0 -0
  61. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/_async/models.py +0 -0
  62. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/_async/resources/__init__.py +0 -0
  63. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/_async/resources/base.py +0 -0
  64. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/_async/resources/browser.py +0 -0
  65. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/_async/resources/mcp.py +0 -0
  66. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/_async/resources/sqlite.py +0 -0
  67. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/_async/tasks.py +0 -0
  68. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/_async/verifiers/__init__.py +0 -0
  69. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/_async/verifiers/bundler.py +0 -0
  70. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/_async/verifiers/verifier.py +0 -0
  71. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/agent/__init__.py +0 -0
  72. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/agent/gemini_cua/__init__.py +0 -0
  73. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/agent/utils.py +0 -0
  74. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/config.py +0 -0
  75. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/env/__init__.py +0 -0
  76. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/env/client.py +0 -0
  77. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/global_client.py +0 -0
  78. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/instance/__init__.py +0 -0
  79. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/instance/base.py +0 -0
  80. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/instance/client.py +0 -0
  81. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/instance/models.py +0 -0
  82. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/resources/__init__.py +0 -0
  83. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/resources/base.py +0 -0
  84. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/resources/browser.py +0 -0
  85. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/resources/mcp.py +0 -0
  86. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/resources/sqlite.py +0 -0
  87. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/tasks.py +0 -0
  88. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/types.py +0 -0
  89. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/verifiers/__init__.py +0 -0
  90. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/verifiers/bundler.py +0 -0
  91. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/verifiers/code.py +0 -0
  92. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/verifiers/db.py +0 -0
  93. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/verifiers/decorator.py +0 -0
  94. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/verifiers/parse.py +0 -0
  95. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/verifiers/sql_differ.py +0 -0
  96. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet/verifiers/verifier.py +0 -0
  97. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet_python.egg-info/dependency_links.txt +0 -0
  98. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet_python.egg-info/entry_points.txt +0 -0
  99. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet_python.egg-info/requires.txt +0 -0
  100. {fleet_python-0.2.81 → fleet_python-0.2.82}/fleet_python.egg-info/top_level.txt +0 -0
  101. {fleet_python-0.2.81 → fleet_python-0.2.82}/scripts/fix_sync_imports.py +0 -0
  102. {fleet_python-0.2.81 → fleet_python-0.2.82}/scripts/unasync.py +0 -0
  103. {fleet_python-0.2.81 → fleet_python-0.2.82}/setup.cfg +0 -0
  104. {fleet_python-0.2.81 → fleet_python-0.2.82}/tests/__init__.py +0 -0
  105. {fleet_python-0.2.81 → fleet_python-0.2.82}/tests/test_app_method.py +0 -0
  106. {fleet_python-0.2.81 → fleet_python-0.2.82}/tests/test_expect_only.py +0 -0
  107. {fleet_python-0.2.81 → fleet_python-0.2.82}/tests/test_instance_dispatch.py +0 -0
  108. {fleet_python-0.2.81 → fleet_python-0.2.82}/tests/test_sqlite_resource_dual_mode.py +0 -0
  109. {fleet_python-0.2.81 → fleet_python-0.2.82}/tests/test_sqlite_shared_memory_behavior.py +0 -0
  110. {fleet_python-0.2.81 → fleet_python-0.2.82}/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.81
3
+ Version: 0.2.82
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
+ [![PyPI version](https://img.shields.io/pypi/v/fleet-python.svg)](https://pypi.org/project/fleet-python/)
53
+ [![Python versions](https://img.shields.io/pypi/pyversions/fleet-python.svg)](https://pypi.org/project/fleet-python/)
54
+ [![License](https://img.shields.io/pypi/l/fleet-python.svg)](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
+ [![PyPI version](https://img.shields.io/pypi/v/fleet-python.svg)](https://pypi.org/project/fleet-python/)
4
+ [![Python versions](https://img.shields.io/pypi/pyversions/fleet-python.svg)](https://pypi.org/project/fleet-python/)
5
+ [![License](https://img.shields.io/pypi/l/fleet-python.svg)](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.80"
76
+ __version__ = "0.2.82"
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.79"
47
+ __version__ = "0.2.82"
48
48
 
49
49
  __all__ = [
50
50
  # Core classes
@@ -26,7 +26,7 @@ from .exceptions import (
26
26
  try:
27
27
  from .. import __version__
28
28
  except ImportError:
29
- __version__ = "0.2.79"
29
+ __version__ = "0.2.82"
30
30
 
31
31
  logger = logging.getLogger(__name__)
32
32