aiqtoolkit 1.2.0a20250523__py3-none-any.whl → 1.2.0a20250525__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 aiqtoolkit might be problematic. Click here for more details.

@@ -16,25 +16,66 @@
16
16
  import logging
17
17
  import typing
18
18
  from datetime import datetime
19
+ from pathlib import Path
19
20
 
20
21
  from pydantic import BaseModel
21
22
  from pydantic import Field
23
+ from pydantic import field_validator
22
24
 
23
25
  from aiq.data_models.front_end import FrontEndBaseConfig
24
26
  from aiq.data_models.step_adaptor import StepAdaptorConfig
25
27
 
26
28
  logger = logging.getLogger(__name__)
27
29
 
30
+ YAML_EXTENSIONS = (".yaml", ".yml")
31
+
28
32
 
29
33
  class AIQEvaluateRequest(BaseModel):
30
34
  """Request model for the evaluate endpoint."""
31
35
  config_file: str = Field(description="Path to the configuration file for evaluation")
32
36
  job_id: str | None = Field(default=None, description="Unique identifier for the evaluation job")
33
- reps: int = Field(default=1, description="Number of repetitions for the evaluation, defaults to 1")
37
+ reps: int = Field(default=1, gt=0, description="Number of repetitions for the evaluation, defaults to 1")
34
38
  expiry_seconds: int = Field(
35
39
  default=3600,
40
+ gt=0,
36
41
  description="Optional time (in seconds) before the job expires. Clamped between 600 (10 min) and 86400 (24h).")
37
42
 
43
+ @field_validator('job_id', mode='after')
44
+ @classmethod
45
+ def validate_job_id(cls, job_id: str):
46
+ job_id = job_id.strip()
47
+ job_id_path = Path(job_id)
48
+ if len(job_id_path.parts) > 1 or job_id_path.resolve().name != job_id:
49
+ raise ValueError(
50
+ f"Job ID '{job_id}' contains invalid characters. Only alphanumeric characters and underscores are"
51
+ " allowed.")
52
+
53
+ if job_id_path.is_reserved():
54
+ # reserved names is Windows specific
55
+ raise ValueError(f"Job ID '{job_id}' is a reserved name. Please choose a different name.")
56
+
57
+ return job_id
58
+
59
+ @field_validator('config_file', mode='after')
60
+ @classmethod
61
+ def validate_config_file(cls, config_file: str):
62
+ config_file = config_file.strip()
63
+ config_file_path = Path(config_file).resolve()
64
+
65
+ # Ensure the config file is a YAML file
66
+ if config_file_path.suffix.lower() not in YAML_EXTENSIONS:
67
+ raise ValueError(f"Config file '{config_file}' must be a YAML file with one of the following extensions: "
68
+ f"{', '.join(YAML_EXTENSIONS)}")
69
+
70
+ if config_file_path.is_reserved():
71
+ # reserved names is Windows specific
72
+ raise ValueError(f"Config file '{config_file}' is a reserved name. Please choose a different name.")
73
+
74
+ if not config_file_path.exists():
75
+ raise ValueError(f"Config file '{config_file}' does not exist. Please provide a valid path.")
76
+
77
+ return config_file
78
+
38
79
 
39
80
  class AIQEvaluateResponse(BaseModel):
40
81
  """Response model for the evaluate endpoint."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aiqtoolkit
3
- Version: 1.2.0a20250523
3
+ Version: 1.2.0a20250525
4
4
  Summary: NVIDIA Agent Intelligence toolkit
5
5
  Author: NVIDIA Corporation
6
6
  Maintainer: NVIDIA Corporation
@@ -141,7 +141,7 @@ aiq/front_ends/console/console_front_end_plugin.py,sha256=CzadUoHmzrHC_MWn2Fkgh_
141
141
  aiq/front_ends/console/register.py,sha256=a84M0jWUFTgOQVyrUiS7UJcxx84i1zhCb1yRkjhapiQ,1159
142
142
  aiq/front_ends/cron/__init__.py,sha256=Xs1JQ16L9btwreh4pdGKwskffAw1YFO48jKrU4ib_7c,685
143
143
  aiq/front_ends/fastapi/__init__.py,sha256=Xs1JQ16L9btwreh4pdGKwskffAw1YFO48jKrU4ib_7c,685
144
- aiq/front_ends/fastapi/fastapi_front_end_config.py,sha256=Ni0u9T1SkDZWRyn1EEYTePaCxhx9FYQpMeNnefZN014,7085
144
+ aiq/front_ends/fastapi/fastapi_front_end_config.py,sha256=TaRppa8h7_noLq_TvLbOOO60vE8ccab90jELD-nVLDE,8742
145
145
  aiq/front_ends/fastapi/fastapi_front_end_plugin.py,sha256=NdE5c4pS5sMYopI3PUaE397K8HF-GuZoOmpAi1ReDRk,4002
146
146
  aiq/front_ends/fastapi/fastapi_front_end_plugin_worker.py,sha256=UJ4u8d-auPF8Dn-0w6UEExEGe5E8kkIkmTcD9yYzj9Q,27333
147
147
  aiq/front_ends/fastapi/intermediate_steps_subscriber.py,sha256=2Y3ZXfiu8d85qJRWbT3-ex6iFDuXO6TnNtjQ6Cjl-tc,3131
@@ -307,10 +307,10 @@ aiq/utils/reactive/base/observer_base.py,sha256=UAlyAY_ky4q2t0P81RVFo2Bs_R7z5Nde
307
307
  aiq/utils/reactive/base/subject_base.py,sha256=Ed-AC6P7cT3qkW1EXjzbd5M9WpVoeN_9KCe3OM3FLU4,2521
308
308
  aiq/utils/settings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
309
309
  aiq/utils/settings/global_settings.py,sha256=U9TCLdoZsKq5qOVGjREipGVv9e-FlStzqy5zv82_VYk,7454
310
- aiqtoolkit-1.2.0a20250523.dist-info/licenses/LICENSE-3rd-party.txt,sha256=8o7aySJa9CBvFshPcsRdJbczzdNyDGJ8b0J67WRUQ2k,183936
311
- aiqtoolkit-1.2.0a20250523.dist-info/licenses/LICENSE.md,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
312
- aiqtoolkit-1.2.0a20250523.dist-info/METADATA,sha256=PnYexmTipPV8DjDEDnEl47OFfd5gZSXmzdGhIRBARMQ,20174
313
- aiqtoolkit-1.2.0a20250523.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
314
- aiqtoolkit-1.2.0a20250523.dist-info/entry_points.txt,sha256=gRlPfR5g21t328WNEQ4CcEz80S1sJNS8A7rMDYnzl4A,452
315
- aiqtoolkit-1.2.0a20250523.dist-info/top_level.txt,sha256=fo7AzYcNhZ_tRWrhGumtxwnxMew4xrT1iwouDy_f0Kc,4
316
- aiqtoolkit-1.2.0a20250523.dist-info/RECORD,,
310
+ aiqtoolkit-1.2.0a20250525.dist-info/licenses/LICENSE-3rd-party.txt,sha256=8o7aySJa9CBvFshPcsRdJbczzdNyDGJ8b0J67WRUQ2k,183936
311
+ aiqtoolkit-1.2.0a20250525.dist-info/licenses/LICENSE.md,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
312
+ aiqtoolkit-1.2.0a20250525.dist-info/METADATA,sha256=VtrrrJKL0ZyCGxF6LN-DCjzOMOUl1YcmDH0WtWGgzMc,20174
313
+ aiqtoolkit-1.2.0a20250525.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
314
+ aiqtoolkit-1.2.0a20250525.dist-info/entry_points.txt,sha256=gRlPfR5g21t328WNEQ4CcEz80S1sJNS8A7rMDYnzl4A,452
315
+ aiqtoolkit-1.2.0a20250525.dist-info/top_level.txt,sha256=fo7AzYcNhZ_tRWrhGumtxwnxMew4xrT1iwouDy_f0Kc,4
316
+ aiqtoolkit-1.2.0a20250525.dist-info/RECORD,,