aiqtoolkit 1.2.0a20250707__py3-none-any.whl → 1.2.0a20250730__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.

Files changed (197) hide show
  1. aiq/agent/base.py +171 -8
  2. aiq/agent/dual_node.py +1 -1
  3. aiq/agent/react_agent/agent.py +113 -113
  4. aiq/agent/react_agent/register.py +31 -14
  5. aiq/agent/rewoo_agent/agent.py +36 -35
  6. aiq/agent/rewoo_agent/register.py +2 -2
  7. aiq/agent/tool_calling_agent/agent.py +3 -7
  8. aiq/authentication/__init__.py +14 -0
  9. aiq/authentication/api_key/__init__.py +14 -0
  10. aiq/authentication/api_key/api_key_auth_provider.py +92 -0
  11. aiq/authentication/api_key/api_key_auth_provider_config.py +124 -0
  12. aiq/authentication/api_key/register.py +26 -0
  13. aiq/authentication/exceptions/__init__.py +14 -0
  14. aiq/authentication/exceptions/api_key_exceptions.py +38 -0
  15. aiq/authentication/exceptions/auth_code_grant_exceptions.py +86 -0
  16. aiq/authentication/exceptions/call_back_exceptions.py +38 -0
  17. aiq/authentication/exceptions/request_exceptions.py +54 -0
  18. aiq/authentication/http_basic_auth/__init__.py +0 -0
  19. aiq/authentication/http_basic_auth/http_basic_auth_provider.py +81 -0
  20. aiq/authentication/http_basic_auth/register.py +30 -0
  21. aiq/authentication/interfaces.py +93 -0
  22. aiq/authentication/oauth2/__init__.py +14 -0
  23. aiq/authentication/oauth2/oauth2_auth_code_flow_provider.py +107 -0
  24. aiq/authentication/oauth2/oauth2_auth_code_flow_provider_config.py +39 -0
  25. aiq/authentication/oauth2/register.py +25 -0
  26. aiq/authentication/register.py +21 -0
  27. aiq/builder/builder.py +64 -2
  28. aiq/builder/component_utils.py +16 -3
  29. aiq/builder/context.py +26 -0
  30. aiq/builder/eval_builder.py +43 -2
  31. aiq/builder/function.py +32 -4
  32. aiq/builder/function_base.py +1 -1
  33. aiq/builder/intermediate_step_manager.py +6 -8
  34. aiq/builder/user_interaction_manager.py +3 -0
  35. aiq/builder/workflow.py +23 -18
  36. aiq/builder/workflow_builder.py +420 -73
  37. aiq/cli/commands/info/list_mcp.py +103 -16
  38. aiq/cli/commands/sizing/__init__.py +14 -0
  39. aiq/cli/commands/sizing/calc.py +294 -0
  40. aiq/cli/commands/sizing/sizing.py +27 -0
  41. aiq/cli/commands/start.py +1 -0
  42. aiq/cli/entrypoint.py +2 -0
  43. aiq/cli/register_workflow.py +80 -0
  44. aiq/cli/type_registry.py +151 -30
  45. aiq/data_models/api_server.py +117 -11
  46. aiq/data_models/authentication.py +231 -0
  47. aiq/data_models/common.py +35 -7
  48. aiq/data_models/component.py +17 -9
  49. aiq/data_models/component_ref.py +33 -0
  50. aiq/data_models/config.py +60 -3
  51. aiq/data_models/embedder.py +1 -0
  52. aiq/data_models/function_dependencies.py +8 -0
  53. aiq/data_models/interactive.py +10 -1
  54. aiq/data_models/intermediate_step.py +15 -5
  55. aiq/data_models/its_strategy.py +30 -0
  56. aiq/data_models/llm.py +1 -0
  57. aiq/data_models/memory.py +1 -0
  58. aiq/data_models/object_store.py +44 -0
  59. aiq/data_models/retry_mixin.py +35 -0
  60. aiq/data_models/span.py +187 -0
  61. aiq/data_models/telemetry_exporter.py +2 -2
  62. aiq/embedder/nim_embedder.py +2 -1
  63. aiq/embedder/openai_embedder.py +2 -1
  64. aiq/eval/config.py +19 -1
  65. aiq/eval/dataset_handler/dataset_handler.py +75 -1
  66. aiq/eval/evaluate.py +53 -10
  67. aiq/eval/rag_evaluator/evaluate.py +23 -12
  68. aiq/eval/remote_workflow.py +7 -2
  69. aiq/eval/runners/__init__.py +14 -0
  70. aiq/eval/runners/config.py +39 -0
  71. aiq/eval/runners/multi_eval_runner.py +54 -0
  72. aiq/eval/usage_stats.py +6 -0
  73. aiq/eval/utils/weave_eval.py +5 -1
  74. aiq/experimental/__init__.py +0 -0
  75. aiq/experimental/decorators/__init__.py +0 -0
  76. aiq/experimental/decorators/experimental_warning_decorator.py +130 -0
  77. aiq/experimental/inference_time_scaling/__init__.py +0 -0
  78. aiq/experimental/inference_time_scaling/editing/__init__.py +0 -0
  79. aiq/experimental/inference_time_scaling/editing/iterative_plan_refinement_editor.py +147 -0
  80. aiq/experimental/inference_time_scaling/editing/llm_as_a_judge_editor.py +204 -0
  81. aiq/experimental/inference_time_scaling/editing/motivation_aware_summarization.py +107 -0
  82. aiq/experimental/inference_time_scaling/functions/__init__.py +0 -0
  83. aiq/experimental/inference_time_scaling/functions/execute_score_select_function.py +105 -0
  84. aiq/experimental/inference_time_scaling/functions/its_tool_orchestration_function.py +205 -0
  85. aiq/experimental/inference_time_scaling/functions/its_tool_wrapper_function.py +146 -0
  86. aiq/experimental/inference_time_scaling/functions/plan_select_execute_function.py +224 -0
  87. aiq/experimental/inference_time_scaling/models/__init__.py +0 -0
  88. aiq/experimental/inference_time_scaling/models/editor_config.py +132 -0
  89. aiq/experimental/inference_time_scaling/models/its_item.py +48 -0
  90. aiq/experimental/inference_time_scaling/models/scoring_config.py +112 -0
  91. aiq/experimental/inference_time_scaling/models/search_config.py +120 -0
  92. aiq/experimental/inference_time_scaling/models/selection_config.py +154 -0
  93. aiq/experimental/inference_time_scaling/models/stage_enums.py +43 -0
  94. aiq/experimental/inference_time_scaling/models/strategy_base.py +66 -0
  95. aiq/experimental/inference_time_scaling/models/tool_use_config.py +41 -0
  96. aiq/experimental/inference_time_scaling/register.py +36 -0
  97. aiq/experimental/inference_time_scaling/scoring/__init__.py +0 -0
  98. aiq/experimental/inference_time_scaling/scoring/llm_based_agent_scorer.py +168 -0
  99. aiq/experimental/inference_time_scaling/scoring/llm_based_plan_scorer.py +168 -0
  100. aiq/experimental/inference_time_scaling/scoring/motivation_aware_scorer.py +111 -0
  101. aiq/experimental/inference_time_scaling/search/__init__.py +0 -0
  102. aiq/experimental/inference_time_scaling/search/multi_llm_planner.py +128 -0
  103. aiq/experimental/inference_time_scaling/search/multi_query_retrieval_search.py +122 -0
  104. aiq/experimental/inference_time_scaling/search/single_shot_multi_plan_planner.py +128 -0
  105. aiq/experimental/inference_time_scaling/selection/__init__.py +0 -0
  106. aiq/experimental/inference_time_scaling/selection/best_of_n_selector.py +63 -0
  107. aiq/experimental/inference_time_scaling/selection/llm_based_agent_output_selector.py +131 -0
  108. aiq/experimental/inference_time_scaling/selection/llm_based_output_merging_selector.py +159 -0
  109. aiq/experimental/inference_time_scaling/selection/llm_based_plan_selector.py +128 -0
  110. aiq/experimental/inference_time_scaling/selection/threshold_selector.py +58 -0
  111. aiq/front_ends/console/authentication_flow_handler.py +233 -0
  112. aiq/front_ends/console/console_front_end_plugin.py +11 -2
  113. aiq/front_ends/fastapi/auth_flow_handlers/__init__.py +0 -0
  114. aiq/front_ends/fastapi/auth_flow_handlers/http_flow_handler.py +27 -0
  115. aiq/front_ends/fastapi/auth_flow_handlers/websocket_flow_handler.py +107 -0
  116. aiq/front_ends/fastapi/fastapi_front_end_config.py +20 -0
  117. aiq/front_ends/fastapi/fastapi_front_end_controller.py +68 -0
  118. aiq/front_ends/fastapi/fastapi_front_end_plugin.py +14 -1
  119. aiq/front_ends/fastapi/fastapi_front_end_plugin_worker.py +353 -31
  120. aiq/front_ends/fastapi/html_snippets/__init__.py +14 -0
  121. aiq/front_ends/fastapi/html_snippets/auth_code_grant_success.py +35 -0
  122. aiq/front_ends/fastapi/main.py +2 -0
  123. aiq/front_ends/fastapi/message_handler.py +102 -84
  124. aiq/front_ends/fastapi/step_adaptor.py +2 -1
  125. aiq/llm/aws_bedrock_llm.py +2 -1
  126. aiq/llm/nim_llm.py +2 -1
  127. aiq/llm/openai_llm.py +2 -1
  128. aiq/object_store/__init__.py +20 -0
  129. aiq/object_store/in_memory_object_store.py +74 -0
  130. aiq/object_store/interfaces.py +84 -0
  131. aiq/object_store/models.py +36 -0
  132. aiq/object_store/register.py +20 -0
  133. aiq/observability/__init__.py +14 -0
  134. aiq/observability/exporter/__init__.py +14 -0
  135. aiq/observability/exporter/base_exporter.py +449 -0
  136. aiq/observability/exporter/exporter.py +78 -0
  137. aiq/observability/exporter/file_exporter.py +33 -0
  138. aiq/observability/exporter/processing_exporter.py +269 -0
  139. aiq/observability/exporter/raw_exporter.py +52 -0
  140. aiq/observability/exporter/span_exporter.py +264 -0
  141. aiq/observability/exporter_manager.py +335 -0
  142. aiq/observability/mixin/__init__.py +14 -0
  143. aiq/observability/mixin/batch_config_mixin.py +26 -0
  144. aiq/observability/mixin/collector_config_mixin.py +23 -0
  145. aiq/observability/mixin/file_mixin.py +288 -0
  146. aiq/observability/mixin/file_mode.py +23 -0
  147. aiq/observability/mixin/resource_conflict_mixin.py +134 -0
  148. aiq/observability/mixin/serialize_mixin.py +61 -0
  149. aiq/observability/mixin/type_introspection_mixin.py +183 -0
  150. aiq/observability/processor/__init__.py +14 -0
  151. aiq/observability/processor/batching_processor.py +316 -0
  152. aiq/observability/processor/intermediate_step_serializer.py +28 -0
  153. aiq/observability/processor/processor.py +68 -0
  154. aiq/observability/register.py +32 -116
  155. aiq/observability/utils/__init__.py +14 -0
  156. aiq/observability/utils/dict_utils.py +236 -0
  157. aiq/observability/utils/time_utils.py +31 -0
  158. aiq/profiler/calc/__init__.py +14 -0
  159. aiq/profiler/calc/calc_runner.py +623 -0
  160. aiq/profiler/calc/calculations.py +288 -0
  161. aiq/profiler/calc/data_models.py +176 -0
  162. aiq/profiler/calc/plot.py +345 -0
  163. aiq/profiler/data_models.py +2 -0
  164. aiq/profiler/profile_runner.py +16 -13
  165. aiq/runtime/loader.py +8 -2
  166. aiq/runtime/runner.py +23 -9
  167. aiq/runtime/session.py +16 -5
  168. aiq/tool/chat_completion.py +74 -0
  169. aiq/tool/code_execution/README.md +152 -0
  170. aiq/tool/code_execution/code_sandbox.py +151 -72
  171. aiq/tool/code_execution/local_sandbox/.gitignore +1 -0
  172. aiq/tool/code_execution/local_sandbox/local_sandbox_server.py +139 -24
  173. aiq/tool/code_execution/local_sandbox/sandbox.requirements.txt +3 -1
  174. aiq/tool/code_execution/local_sandbox/start_local_sandbox.sh +27 -2
  175. aiq/tool/code_execution/register.py +7 -3
  176. aiq/tool/code_execution/test_code_execution_sandbox.py +414 -0
  177. aiq/tool/mcp/exceptions.py +142 -0
  178. aiq/tool/mcp/mcp_client.py +17 -3
  179. aiq/tool/mcp/mcp_tool.py +1 -1
  180. aiq/tool/register.py +1 -0
  181. aiq/tool/server_tools.py +2 -2
  182. aiq/utils/exception_handlers/automatic_retries.py +289 -0
  183. aiq/utils/exception_handlers/mcp.py +211 -0
  184. aiq/utils/io/model_processing.py +28 -0
  185. aiq/utils/log_utils.py +37 -0
  186. aiq/utils/string_utils.py +38 -0
  187. aiq/utils/type_converter.py +18 -2
  188. aiq/utils/type_utils.py +87 -0
  189. {aiqtoolkit-1.2.0a20250707.dist-info → aiqtoolkit-1.2.0a20250730.dist-info}/METADATA +37 -9
  190. {aiqtoolkit-1.2.0a20250707.dist-info → aiqtoolkit-1.2.0a20250730.dist-info}/RECORD +195 -80
  191. {aiqtoolkit-1.2.0a20250707.dist-info → aiqtoolkit-1.2.0a20250730.dist-info}/entry_points.txt +3 -0
  192. aiq/front_ends/fastapi/websocket.py +0 -153
  193. aiq/observability/async_otel_listener.py +0 -470
  194. {aiqtoolkit-1.2.0a20250707.dist-info → aiqtoolkit-1.2.0a20250730.dist-info}/WHEEL +0 -0
  195. {aiqtoolkit-1.2.0a20250707.dist-info → aiqtoolkit-1.2.0a20250730.dist-info}/licenses/LICENSE-3rd-party.txt +0 -0
  196. {aiqtoolkit-1.2.0a20250707.dist-info → aiqtoolkit-1.2.0a20250730.dist-info}/licenses/LICENSE.md +0 -0
  197. {aiqtoolkit-1.2.0a20250707.dist-info → aiqtoolkit-1.2.0a20250730.dist-info}/top_level.txt +0 -0
aiq/utils/type_utils.py CHANGED
@@ -395,3 +395,90 @@ class DecomposedType:
395
395
  converters.append(_convert_to_schema)
396
396
 
397
397
  return schema
398
+
399
+ @staticmethod
400
+ def extract_generic_parameters_from_class(target_class: type,
401
+ expected_param_count: int | None = None) -> tuple[type, ...]:
402
+ """
403
+ Extract generic type parameters from a class's inheritance chain.
404
+
405
+ This method searches through __orig_bases__ to find generic parameters,
406
+ which is useful for classes that inherit from generic base classes.
407
+
408
+ Parameters
409
+ ----------
410
+ target_class : type
411
+ The class to extract parameters from
412
+ expected_param_count : int | None, optional
413
+ Expected number of parameters. If specified, only matches with this count are considered.
414
+
415
+ Returns
416
+ -------
417
+ tuple[type, ...]
418
+ Tuple of generic type parameters found
419
+
420
+ Raises
421
+ ------
422
+ ValueError
423
+ If no generic parameters matching the expected count are found
424
+
425
+ Examples
426
+ --------
427
+ >>> class MyClass(SomeGeneric[int, str, bool]):
428
+ ... pass
429
+ >>> DecomposedType.extract_generic_parameters_from_class(MyClass, 3)
430
+ (int, str, bool)
431
+ """
432
+ for base_cls in getattr(target_class, '__orig_bases__', []):
433
+ base_cls_args = typing.get_args(base_cls)
434
+
435
+ if expected_param_count is None or len(base_cls_args) == expected_param_count:
436
+ if base_cls_args: # Only return if we actually found parameters
437
+ return base_cls_args
438
+
439
+ if expected_param_count is not None:
440
+ raise ValueError(
441
+ f"Could not find generic parameters with count {expected_param_count} for class {target_class}")
442
+ raise ValueError(f"Could not find any generic parameters for class {target_class}")
443
+
444
+ @staticmethod
445
+ def is_type_compatible(source_type: type, target_type: type) -> bool:
446
+ """
447
+ Check if a source type is compatible with a target type.
448
+
449
+ This handles direct compatibility and special cases like batch compatibility
450
+ where list[T] can be compatible with targets that expect T.
451
+
452
+ Parameters
453
+ ----------
454
+ source_type : type
455
+ The source type to check
456
+ target_type : type
457
+ The target type to check compatibility with
458
+
459
+ Returns
460
+ -------
461
+ bool
462
+ True if types are compatible, False otherwise
463
+ """
464
+ # Direct compatibility check
465
+ try:
466
+ if issubclass(source_type, target_type):
467
+ return True
468
+ except TypeError:
469
+ # Handle generic types that can't use issubclass
470
+ pass
471
+
472
+ # Check if source outputs list[T] and target expects T
473
+ source_decomposed = DecomposedType(source_type)
474
+ if source_decomposed.origin is list and source_decomposed.args:
475
+ inner_type = source_decomposed.args[0]
476
+ try:
477
+ if issubclass(inner_type, target_type):
478
+ return True
479
+ except TypeError:
480
+ # If we can't use issubclass, check type equality
481
+ if inner_type == target_type:
482
+ return True
483
+
484
+ return False
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aiqtoolkit
3
- Version: 1.2.0a20250707
3
+ Version: 1.2.0a20250730
4
4
  Summary: NVIDIA Agent Intelligence toolkit
5
5
  Author: NVIDIA Corporation
6
6
  Maintainer: NVIDIA Corporation
@@ -212,18 +212,21 @@ Description-Content-Type: text/markdown
212
212
  License-File: LICENSE-3rd-party.txt
213
213
  License-File: LICENSE.md
214
214
  Requires-Dist: aioboto3>=11.0.0
215
+ Requires-Dist: authlib~=1.3.1
215
216
  Requires-Dist: click~=8.1
216
217
  Requires-Dist: colorama~=0.4.6
218
+ Requires-Dist: datasets~=4.0
217
219
  Requires-Dist: expandvars~=1.0
218
220
  Requires-Dist: fastapi~=0.115.5
219
221
  Requires-Dist: httpx~=0.27
220
222
  Requires-Dist: jinja2~=3.1
221
223
  Requires-Dist: jsonpath-ng~=1.7
222
- Requires-Dist: mcp>=1.0.0
224
+ Requires-Dist: mcp~=1.10
223
225
  Requires-Dist: networkx~=3.4
224
226
  Requires-Dist: numpy~=1.26
225
227
  Requires-Dist: openinference-semantic-conventions~=0.1.14
226
228
  Requires-Dist: openpyxl~=3.1
229
+ Requires-Dist: pkce==1.0.3
227
230
  Requires-Dist: pkginfo~=1.12
228
231
  Requires-Dist: platformdirs~=4.3
229
232
  Requires-Dist: pydantic==2.10.*
@@ -231,6 +234,7 @@ Requires-Dist: pymilvus~=2.4
231
234
  Requires-Dist: PyYAML~=6.0
232
235
  Requires-Dist: ragas~=0.2.14
233
236
  Requires-Dist: rich~=13.9
237
+ Requires-Dist: tabulate~=0.9
234
238
  Requires-Dist: uvicorn[standard]~=0.32.0
235
239
  Requires-Dist: wikipedia~=1.4
236
240
  Provides-Extra: agno
@@ -245,28 +249,52 @@ Provides-Extra: llama-index
245
249
  Requires-Dist: aiqtoolkit-llama-index; extra == "llama-index"
246
250
  Provides-Extra: mem0ai
247
251
  Requires-Dist: aiqtoolkit-mem0ai; extra == "mem0ai"
252
+ Provides-Extra: opentelemetry
253
+ Requires-Dist: aiqtoolkit-opentelemetry; extra == "opentelemetry"
254
+ Provides-Extra: phoenix
255
+ Requires-Dist: aiqtoolkit-phoenix; extra == "phoenix"
256
+ Provides-Extra: ragaai
257
+ Requires-Dist: aiqtoolkit-ragaai; extra == "ragaai"
258
+ Provides-Extra: mysql
259
+ Requires-Dist: aiqtoolkit-mysql; extra == "mysql"
260
+ Provides-Extra: redis
261
+ Requires-Dist: aiqtoolkit-redis; extra == "redis"
262
+ Provides-Extra: s3
263
+ Requires-Dist: aiqtoolkit-s3; extra == "s3"
248
264
  Provides-Extra: semantic-kernel
249
265
  Requires-Dist: aiqtoolkit-semantic-kernel; extra == "semantic-kernel"
250
266
  Provides-Extra: telemetry
251
- Requires-Dist: arize-phoenix~=6.1; extra == "telemetry"
252
- Requires-Dist: opentelemetry-api~=1.2; extra == "telemetry"
253
- Requires-Dist: opentelemetry-sdk~=1.3; extra == "telemetry"
267
+ Requires-Dist: aiqtoolkit-opentelemetry; extra == "telemetry"
268
+ Requires-Dist: aiqtoolkit-phoenix; extra == "telemetry"
269
+ Requires-Dist: aiqtoolkit-weave; extra == "telemetry"
270
+ Requires-Dist: aiqtoolkit-ragaai; extra == "telemetry"
254
271
  Provides-Extra: weave
255
272
  Requires-Dist: aiqtoolkit-weave; extra == "weave"
256
273
  Provides-Extra: zep-cloud
257
274
  Requires-Dist: aiqtoolkit-zep-cloud; extra == "zep-cloud"
258
275
  Provides-Extra: examples
276
+ Requires-Dist: aiq_agno_personal_finance; extra == "examples"
259
277
  Requires-Dist: aiq_alert_triage_agent; extra == "examples"
278
+ Requires-Dist: aiq_automated_description_generation; extra == "examples"
260
279
  Requires-Dist: aiq_email_phishing_analyzer; extra == "examples"
261
280
  Requires-Dist: aiq_multi_frameworks; extra == "examples"
262
281
  Requires-Dist: aiq_plot_charts; extra == "examples"
282
+ Requires-Dist: aiq_por_to_jiratickets; extra == "examples"
283
+ Requires-Dist: aiq_profiler_agent; extra == "examples"
284
+ Requires-Dist: aiq_redact_pii; extra == "examples"
263
285
  Requires-Dist: aiq_semantic_kernel_demo; extra == "examples"
286
+ Requires-Dist: aiq_simple_auth; extra == "examples"
287
+ Requires-Dist: aiq_simple_web_query; extra == "examples"
288
+ Requires-Dist: aiq_simple_web_query_eval; extra == "examples"
264
289
  Requires-Dist: aiq_simple_calculator; extra == "examples"
265
- Requires-Dist: aiq_simple; extra == "examples"
290
+ Requires-Dist: aiq_simple_calculator_custom_routes; extra == "examples"
291
+ Requires-Dist: aiq_simple_calculator_eval; extra == "examples"
292
+ Requires-Dist: aiq_simple_calculator_mcp; extra == "examples"
293
+ Requires-Dist: aiq_simple_calculator_observability; extra == "examples"
294
+ Requires-Dist: aiq_simple_calculator_hitl; extra == "examples"
295
+ Requires-Dist: aiq_simple_rag; extra == "examples"
266
296
  Requires-Dist: aiq_swe_bench; extra == "examples"
267
- Requires-Dist: aiq_automated_description_generation; extra == "examples"
268
- Requires-Dist: aiq_agno_personal_finance; extra == "examples"
269
- Requires-Dist: aiq_profiler_agent; extra == "examples"
297
+ Requires-Dist: aiq_user_report; extra == "examples"
270
298
  Provides-Extra: profiling
271
299
  Requires-Dist: matplotlib~=3.9; extra == "profiling"
272
300
  Requires-Dist: prefixspan~=0.5.2; extra == "profiling"