fleet-python 0.2.112__tar.gz → 0.2.113__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.112/fleet_python.egg-info → fleet_python-0.2.113}/PKG-INFO +1 -1
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/__init__.py +1 -1
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/_async/__init__.py +1 -1
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/_async/base.py +1 -1
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/_async/judge.py +26 -1
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/base.py +1 -1
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/judge.py +82 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113/fleet_python.egg-info}/PKG-INFO +1 -1
- {fleet_python-0.2.112 → fleet_python-0.2.113}/pyproject.toml +1 -1
- {fleet_python-0.2.112 → fleet_python-0.2.113}/LICENSE +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/README.md +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/examples/diff_example.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/examples/dsl_example.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/examples/example.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/examples/exampleResume.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/examples/example_account.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/examples/example_action_log.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/examples/example_client.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/examples/example_mcp_anthropic.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/examples/example_mcp_openai.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/examples/example_sync.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/examples/example_task.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/examples/example_tasks.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/examples/example_verifier.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/examples/export_tasks.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/examples/export_tasks_filtered.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/examples/fetch_tasks.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/examples/gemini_example.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/examples/import_tasks.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/examples/iterate_verifiers.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/examples/json_tasks_example.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/examples/nova_act_example.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/examples/openai_example.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/examples/openai_simple_example.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/examples/query_builder_example.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/examples/quickstart.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/examples/test_cdp_logging.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/_async/client.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/_async/env/__init__.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/_async/env/client.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/_async/exceptions.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/_async/global_client.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/_async/instance/__init__.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/_async/instance/base.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/_async/instance/client.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/_async/models.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/_async/resources/__init__.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/_async/resources/api.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/_async/resources/base.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/_async/resources/browser.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/_async/resources/filesystem.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/_async/resources/mcp.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/_async/resources/sqlite.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/_async/tasks.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/_async/verifiers/__init__.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/_async/verifiers/bundler.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/_async/verifiers/verifier.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/agent/__init__.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/agent/gemini_cua/Dockerfile +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/agent/gemini_cua/__init__.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/agent/gemini_cua/agent.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/agent/gemini_cua/mcp/main.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/agent/gemini_cua/mcp_server/__init__.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/agent/gemini_cua/mcp_server/main.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/agent/gemini_cua/mcp_server/tools.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/agent/gemini_cua/requirements.txt +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/agent/gemini_cua/start.sh +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/agent/orchestrator.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/agent/types.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/agent/utils.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/cli.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/client.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/config.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/env/__init__.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/env/client.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/eval/__init__.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/eval/uploader.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/exceptions.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/global_client.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/instance/__init__.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/instance/base.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/instance/client.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/instance/models.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/models.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/proxy/__init__.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/proxy/proxy.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/proxy/whitelist.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/resources/__init__.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/resources/api.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/resources/base.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/resources/browser.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/resources/filesystem.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/resources/mcp.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/resources/sqlite.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/tasks.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/types.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/utils/__init__.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/utils/http_logging.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/utils/logging.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/utils/playwright.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/verifiers/__init__.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/verifiers/bundler.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/verifiers/code.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/verifiers/db.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/verifiers/decorator.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/verifiers/parse.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/verifiers/sql_differ.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet/verifiers/verifier.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet_python.egg-info/SOURCES.txt +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet_python.egg-info/dependency_links.txt +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet_python.egg-info/entry_points.txt +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet_python.egg-info/requires.txt +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/fleet_python.egg-info/top_level.txt +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/scripts/fix_sync_imports.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/scripts/unasync.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/setup.cfg +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/tests/__init__.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/tests/test_app_method.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/tests/test_expect_exactly.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/tests/test_expect_only.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/tests/test_instance_dispatch.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/tests/test_sqlite_resource_dual_mode.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/tests/test_sqlite_shared_memory_behavior.py +0 -0
- {fleet_python-0.2.112 → fleet_python-0.2.113}/tests/test_verifier_from_string.py +0 -0
|
@@ -12,6 +12,8 @@ from ..judge import (
|
|
|
12
12
|
JudgeResult,
|
|
13
13
|
Rubric,
|
|
14
14
|
_build_grade_request,
|
|
15
|
+
_collect_image_from_env_async,
|
|
16
|
+
_guess_media_type,
|
|
15
17
|
_parse_grade_response,
|
|
16
18
|
)
|
|
17
19
|
|
|
@@ -75,6 +77,29 @@ class AsyncJudge:
|
|
|
75
77
|
collect: File patterns for orchestrator to collect (agentic mode).
|
|
76
78
|
task_id: Optional task ID for tracking.
|
|
77
79
|
"""
|
|
80
|
+
# Resolve Image.from_env images asynchronously before building request
|
|
81
|
+
resolved_images = images
|
|
82
|
+
if images and not agentic:
|
|
83
|
+
resolved_images = {}
|
|
84
|
+
for label, img in images.items():
|
|
85
|
+
if img.source == "env" and img._env is not None:
|
|
86
|
+
b64 = await _collect_image_from_env_async(img._env, img.filename)
|
|
87
|
+
if b64 is not None:
|
|
88
|
+
resolved_images[label] = Image.from_base64(
|
|
89
|
+
b64,
|
|
90
|
+
img.filename or "image.png",
|
|
91
|
+
_guess_media_type(img.filename or "image.png"),
|
|
92
|
+
)
|
|
93
|
+
else:
|
|
94
|
+
# Async collection failed — use collect source directly
|
|
95
|
+
# (don't keep the env image or serialize() will retry sync)
|
|
96
|
+
resolved_images[label] = Image(
|
|
97
|
+
source="collect",
|
|
98
|
+
filename=img.filename,
|
|
99
|
+
)
|
|
100
|
+
else:
|
|
101
|
+
resolved_images[label] = img
|
|
102
|
+
|
|
78
103
|
body = _build_grade_request(
|
|
79
104
|
self._instance_id,
|
|
80
105
|
rubric,
|
|
@@ -84,7 +109,7 @@ class AsyncJudge:
|
|
|
84
109
|
context=context,
|
|
85
110
|
reference_claims=reference_claims,
|
|
86
111
|
conversation=conversation,
|
|
87
|
-
images=
|
|
112
|
+
images=resolved_images,
|
|
88
113
|
model=model,
|
|
89
114
|
provider=provider,
|
|
90
115
|
agentic=agentic,
|
|
@@ -176,6 +176,8 @@ class Image:
|
|
|
176
176
|
"data": self.data,
|
|
177
177
|
"media_type": self.media_type or _guess_media_type(self.filename or "image.png"),
|
|
178
178
|
}
|
|
179
|
+
elif self.source == "collect":
|
|
180
|
+
d = {"source": "collect", "selector": self.filename}
|
|
179
181
|
elif self.source == "env":
|
|
180
182
|
if agentic:
|
|
181
183
|
d = {"source": "collect", "selector": self.filename}
|
|
@@ -330,6 +332,86 @@ def _collect_image_from_env(env: Any, filename: str) -> Optional[str]:
|
|
|
330
332
|
return None
|
|
331
333
|
|
|
332
334
|
|
|
335
|
+
async def _collect_image_from_env_async(env: Any, filename: str) -> Optional[str]:
|
|
336
|
+
"""Async version of _collect_image_from_env.
|
|
337
|
+
|
|
338
|
+
Collects an image from an AsyncEnv using DB -> notebook -> filesystem strategies.
|
|
339
|
+
Returns base64-encoded image data, or None if not found.
|
|
340
|
+
"""
|
|
341
|
+
# Strategy 1: DB files table
|
|
342
|
+
try:
|
|
343
|
+
current = env.db("current")
|
|
344
|
+
where = f"path = '{filename}' OR path LIKE '%/{filename}'"
|
|
345
|
+
rows = _extract_query_rows(
|
|
346
|
+
await current.query(f"SELECT path, hex(content) AS content_hex FROM files WHERE {where}")
|
|
347
|
+
)
|
|
348
|
+
candidates = {}
|
|
349
|
+
for row in rows:
|
|
350
|
+
path, chex = row.get("path", ""), row.get("content_hex", "")
|
|
351
|
+
if path and chex:
|
|
352
|
+
try:
|
|
353
|
+
candidates[path] = bytes.fromhex(chex)
|
|
354
|
+
except Exception:
|
|
355
|
+
pass
|
|
356
|
+
# Prefer non-dataroom paths
|
|
357
|
+
non_dr = [p for p in candidates if not p.startswith("dataroom/")]
|
|
358
|
+
best = sorted(non_dr or list(candidates.keys()), key=len)
|
|
359
|
+
if best:
|
|
360
|
+
logger.debug("Loaded image from DB (async): %s", best[0])
|
|
361
|
+
return base64.b64encode(candidates[best[0]]).decode()
|
|
362
|
+
except Exception as e:
|
|
363
|
+
logger.debug("DB image query failed (async): %s", e)
|
|
364
|
+
|
|
365
|
+
# Strategy 2: Notebook cell outputs
|
|
366
|
+
try:
|
|
367
|
+
current = env.db("current")
|
|
368
|
+
nb_rows = _extract_query_rows(
|
|
369
|
+
await current.query(
|
|
370
|
+
"SELECT path, hex(content) AS content_hex FROM files "
|
|
371
|
+
"WHERE path LIKE 'notebooks/%.ipynb'"
|
|
372
|
+
)
|
|
373
|
+
)
|
|
374
|
+
for nb_row in nb_rows:
|
|
375
|
+
chex = nb_row.get("content_hex", "")
|
|
376
|
+
if not chex:
|
|
377
|
+
continue
|
|
378
|
+
try:
|
|
379
|
+
nb_bytes = bytes.fromhex(chex)
|
|
380
|
+
nb = json.loads(nb_bytes.decode("utf-8"))
|
|
381
|
+
for cell in reversed(nb.get("cells", [])):
|
|
382
|
+
for output in cell.get("outputs", []):
|
|
383
|
+
if output.get("output_type") in ("display_data", "execute_result"):
|
|
384
|
+
img_data = output.get("data", {}).get("image/png")
|
|
385
|
+
if img_data:
|
|
386
|
+
if isinstance(img_data, list):
|
|
387
|
+
img_data = "".join(img_data)
|
|
388
|
+
img_data = img_data.strip()
|
|
389
|
+
if img_data:
|
|
390
|
+
logger.debug("Loaded image from notebook (async): %s", nb_row.get("path"))
|
|
391
|
+
return img_data
|
|
392
|
+
except Exception:
|
|
393
|
+
pass
|
|
394
|
+
except Exception as e:
|
|
395
|
+
logger.debug("Notebook image query failed (async): %s", e)
|
|
396
|
+
|
|
397
|
+
# Strategy 3: Filesystem fallback
|
|
398
|
+
search_paths = [
|
|
399
|
+
filename,
|
|
400
|
+
f"/app/workspace/{filename}",
|
|
401
|
+
f"/workspace/{filename}",
|
|
402
|
+
]
|
|
403
|
+
for fp in search_paths:
|
|
404
|
+
try:
|
|
405
|
+
if os.path.exists(fp):
|
|
406
|
+
with open(fp, "rb") as f:
|
|
407
|
+
logger.debug("Loaded image from filesystem (async): %s", fp)
|
|
408
|
+
return base64.b64encode(f.read()).decode()
|
|
409
|
+
except Exception:
|
|
410
|
+
pass
|
|
411
|
+
|
|
412
|
+
return None
|
|
413
|
+
|
|
414
|
+
|
|
333
415
|
# ---------------------------------------------------------------------------
|
|
334
416
|
# Accumulator printing (verifier protocol)
|
|
335
417
|
# ---------------------------------------------------------------------------
|
|
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
|
|
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
|