fleet-python 0.2.70__tar.gz → 0.2.71__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.70/fleet_python.egg-info → fleet_python-0.2.71}/PKG-INFO +1 -1
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/__init__.py +1 -1
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/_async/__init__.py +1 -1
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/_async/base.py +1 -1
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/_async/tasks.py +41 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/base.py +1 -1
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/tasks.py +41 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71/fleet_python.egg-info}/PKG-INFO +1 -1
- {fleet_python-0.2.70 → fleet_python-0.2.71}/pyproject.toml +1 -1
- {fleet_python-0.2.70 → fleet_python-0.2.71}/LICENSE +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/README.md +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/examples/diff_example.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/examples/dsl_example.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/examples/example.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/examples/exampleResume.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/examples/example_account.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/examples/example_action_log.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/examples/example_client.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/examples/example_mcp_anthropic.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/examples/example_mcp_openai.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/examples/example_sync.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/examples/example_task.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/examples/example_tasks.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/examples/example_verifier.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/examples/export_tasks.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/examples/gemini_example.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/examples/import_tasks.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/examples/json_tasks_example.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/examples/nova_act_example.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/examples/openai_example.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/examples/openai_simple_example.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/examples/query_builder_example.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/examples/quickstart.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/examples/test_cdp_logging.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/_async/client.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/_async/env/__init__.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/_async/env/client.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/_async/exceptions.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/_async/global_client.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/_async/instance/__init__.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/_async/instance/base.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/_async/instance/client.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/_async/models.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/_async/resources/__init__.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/_async/resources/base.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/_async/resources/browser.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/_async/resources/mcp.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/_async/resources/sqlite.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/_async/verifiers/__init__.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/_async/verifiers/bundler.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/_async/verifiers/verifier.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/client.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/config.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/env/__init__.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/env/client.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/exceptions.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/global_client.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/instance/__init__.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/instance/base.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/instance/client.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/instance/models.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/models.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/resources/__init__.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/resources/base.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/resources/browser.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/resources/mcp.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/resources/sqlite.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/types.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/verifiers/__init__.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/verifiers/bundler.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/verifiers/code.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/verifiers/db.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/verifiers/decorator.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/verifiers/parse.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/verifiers/sql_differ.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet/verifiers/verifier.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet_python.egg-info/SOURCES.txt +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet_python.egg-info/dependency_links.txt +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet_python.egg-info/requires.txt +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/fleet_python.egg-info/top_level.txt +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/scripts/fix_sync_imports.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/scripts/unasync.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/setup.cfg +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/tests/__init__.py +0 -0
- {fleet_python-0.2.70 → fleet_python-0.2.71}/tests/test_verifier_from_string.py +0 -0
|
@@ -296,6 +296,8 @@ def verifier_from_string(
|
|
|
296
296
|
try:
|
|
297
297
|
import inspect
|
|
298
298
|
import re
|
|
299
|
+
import json
|
|
300
|
+
import string
|
|
299
301
|
from .verifiers.verifier import AsyncVerifierFunction
|
|
300
302
|
from fleet.verifiers.code import TASK_SUCCESSFUL_SCORE, TASK_FAILED_SCORE
|
|
301
303
|
from fleet.verifiers.db import IgnoreConfig
|
|
@@ -307,12 +309,51 @@ def verifier_from_string(
|
|
|
307
309
|
cleaned_code = re.sub(r"from fleet import.*verifier.*\n", "", cleaned_code)
|
|
308
310
|
cleaned_code = re.sub(r"import.*verifier.*\n", "", cleaned_code)
|
|
309
311
|
|
|
312
|
+
# Define helper functions for verifier execution
|
|
313
|
+
_TRANSLATOR = str.maketrans(string.punctuation, " " * len(string.punctuation))
|
|
314
|
+
|
|
315
|
+
def _normalize_text(value: str) -> str:
|
|
316
|
+
text = value.lower().translate(_TRANSLATOR)
|
|
317
|
+
return "".join(text.split())
|
|
318
|
+
|
|
319
|
+
def _stringify_content(content: Any) -> str:
|
|
320
|
+
if isinstance(content, (dict, list)):
|
|
321
|
+
return json.dumps(content, sort_keys=True)
|
|
322
|
+
return str(content)
|
|
323
|
+
|
|
324
|
+
def normalized_contains(target: str, blob: Any) -> bool:
|
|
325
|
+
normalized_target = _normalize_text(target)
|
|
326
|
+
normalized_blob = _normalize_text(_stringify_content(blob))
|
|
327
|
+
return normalized_target in normalized_blob
|
|
328
|
+
|
|
329
|
+
def extract_numbers(text: str) -> list:
|
|
330
|
+
cleaned_text = text.replace(',', '')
|
|
331
|
+
pattern = r'-?\d+\.?\d*'
|
|
332
|
+
matches = re.findall(pattern, cleaned_text)
|
|
333
|
+
return [float(num) for num in matches]
|
|
334
|
+
|
|
335
|
+
def contains_number(text: str, target_number) -> bool:
|
|
336
|
+
numbers = extract_numbers(text)
|
|
337
|
+
try:
|
|
338
|
+
if isinstance(target_number, str):
|
|
339
|
+
target_number = target_number.replace(',', '')
|
|
340
|
+
target = float(target_number)
|
|
341
|
+
except (ValueError, AttributeError):
|
|
342
|
+
return False
|
|
343
|
+
return target in numbers
|
|
344
|
+
|
|
310
345
|
# Create a local namespace for executing the code
|
|
311
346
|
local_namespace = {
|
|
312
347
|
"TASK_SUCCESSFUL_SCORE": TASK_SUCCESSFUL_SCORE,
|
|
313
348
|
"TASK_FAILED_SCORE": TASK_FAILED_SCORE,
|
|
314
349
|
"IgnoreConfig": IgnoreConfig,
|
|
315
350
|
"Environment": object, # Add Environment type if needed
|
|
351
|
+
"normalized_contains": normalized_contains,
|
|
352
|
+
"extract_numbers": extract_numbers,
|
|
353
|
+
"contains_number": contains_number,
|
|
354
|
+
"json": json,
|
|
355
|
+
"re": re,
|
|
356
|
+
"string": string,
|
|
316
357
|
}
|
|
317
358
|
|
|
318
359
|
# Execute the cleaned verifier code in the namespace
|
|
@@ -289,6 +289,8 @@ def verifier_from_string(
|
|
|
289
289
|
try:
|
|
290
290
|
import inspect
|
|
291
291
|
import re
|
|
292
|
+
import json
|
|
293
|
+
import string
|
|
292
294
|
from .verifiers import SyncVerifierFunction
|
|
293
295
|
from .verifiers.code import TASK_SUCCESSFUL_SCORE, TASK_FAILED_SCORE
|
|
294
296
|
from .verifiers.db import IgnoreConfig
|
|
@@ -300,6 +302,39 @@ def verifier_from_string(
|
|
|
300
302
|
cleaned_code = re.sub(r"from fleet import.*verifier.*\n", "", cleaned_code)
|
|
301
303
|
cleaned_code = re.sub(r"import.*verifier.*\n", "", cleaned_code)
|
|
302
304
|
|
|
305
|
+
# Define helper functions for verifier execution
|
|
306
|
+
_TRANSLATOR = str.maketrans(string.punctuation, " " * len(string.punctuation))
|
|
307
|
+
|
|
308
|
+
def _normalize_text(value: str) -> str:
|
|
309
|
+
text = value.lower().translate(_TRANSLATOR)
|
|
310
|
+
return "".join(text.split())
|
|
311
|
+
|
|
312
|
+
def _stringify_content(content: Any) -> str:
|
|
313
|
+
if isinstance(content, (dict, list)):
|
|
314
|
+
return json.dumps(content, sort_keys=True)
|
|
315
|
+
return str(content)
|
|
316
|
+
|
|
317
|
+
def normalized_contains(target: str, blob: Any) -> bool:
|
|
318
|
+
normalized_target = _normalize_text(target)
|
|
319
|
+
normalized_blob = _normalize_text(_stringify_content(blob))
|
|
320
|
+
return normalized_target in normalized_blob
|
|
321
|
+
|
|
322
|
+
def extract_numbers(text: str) -> list:
|
|
323
|
+
cleaned_text = text.replace(',', '')
|
|
324
|
+
pattern = r'-?\d+\.?\d*'
|
|
325
|
+
matches = re.findall(pattern, cleaned_text)
|
|
326
|
+
return [float(num) for num in matches]
|
|
327
|
+
|
|
328
|
+
def contains_number(text: str, target_number) -> bool:
|
|
329
|
+
numbers = extract_numbers(text)
|
|
330
|
+
try:
|
|
331
|
+
if isinstance(target_number, str):
|
|
332
|
+
target_number = target_number.replace(',', '')
|
|
333
|
+
target = float(target_number)
|
|
334
|
+
except (ValueError, AttributeError):
|
|
335
|
+
return False
|
|
336
|
+
return target in numbers
|
|
337
|
+
|
|
303
338
|
# Create a globals namespace with all required imports
|
|
304
339
|
exec_globals = globals().copy()
|
|
305
340
|
exec_globals.update(
|
|
@@ -308,6 +343,12 @@ def verifier_from_string(
|
|
|
308
343
|
"TASK_FAILED_SCORE": TASK_FAILED_SCORE,
|
|
309
344
|
"IgnoreConfig": IgnoreConfig,
|
|
310
345
|
"Environment": object, # Add Environment type if needed
|
|
346
|
+
"normalized_contains": normalized_contains,
|
|
347
|
+
"extract_numbers": extract_numbers,
|
|
348
|
+
"contains_number": contains_number,
|
|
349
|
+
"json": json,
|
|
350
|
+
"re": re,
|
|
351
|
+
"string": string,
|
|
311
352
|
}
|
|
312
353
|
)
|
|
313
354
|
|
|
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
|