aiqtoolkit 1.1.0rc5__py3-none-any.whl → 1.2.0.dev0__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.

@@ -38,6 +38,8 @@ class OpenStep:
38
38
  step_name: str
39
39
  step_type: str
40
40
  step_parent_id: str | None
41
+ prev_stack: list[str]
42
+ active_stack: list[str]
41
43
 
42
44
 
43
45
  class IntermediateStepManager:
@@ -62,6 +64,8 @@ class IntermediateStepManager:
62
64
 
63
65
  if (payload.event_state == IntermediateStepState.START):
64
66
 
67
+ prev_stack = active_span_id_stack
68
+
65
69
  parent_step_id = active_span_id_stack[-1]
66
70
 
67
71
  # Note, this must not mutate the active_span_id_stack in place
@@ -71,7 +75,16 @@ class IntermediateStepManager:
71
75
  self._outstanding_start_steps[payload.UUID] = OpenStep(step_id=payload.UUID,
72
76
  step_name=payload.name or payload.UUID,
73
77
  step_type=payload.event_type,
74
- step_parent_id=parent_step_id)
78
+ step_parent_id=parent_step_id,
79
+ prev_stack=prev_stack,
80
+ active_stack=active_span_id_stack)
81
+
82
+ logger.debug("Pushed start step %s, name %s, type %s, parent %s, stack id %s",
83
+ payload.UUID,
84
+ payload.name,
85
+ payload.event_type,
86
+ parent_step_id,
87
+ id(active_span_id_stack))
75
88
 
76
89
  elif (payload.event_state == IntermediateStepState.END):
77
90
 
@@ -82,21 +95,49 @@ class IntermediateStepManager:
82
95
  logger.warning("Step id %s not found in outstanding start steps", payload.UUID)
83
96
  return
84
97
 
85
- # Remove the current step from the active span id stack. Look for the step id in the stack and remove it to
86
- # correct errors
87
- current_step_index = active_span_id_stack.index(payload.UUID)
98
+ parent_step_id = open_step.step_parent_id
88
99
 
89
- if (current_step_index is not None):
90
- if (current_step_index != len(active_span_id_stack) - 1):
91
- logger.warning(
92
- "Step id %s not the last step in the stack. "
93
- "Removing it from the stack but this is likely an error",
94
- payload.UUID)
100
+ # Get the current and previous active span id stack.
101
+ curr_stack = open_step.active_stack
102
+ prev_stack = open_step.prev_stack
95
103
 
96
- active_span_id_stack = active_span_id_stack[:current_step_index]
97
- self._context_state.active_span_id_stack.set(active_span_id_stack)
104
+ # To restore the stack, we need to handle two scenarios:
105
+ # 1. This function is called from a coroutine. In this case, the context variable will be the same as the
106
+ # one used in START. So we can just set the context variable to the previous stack.
107
+ # 2. This function is called from a task. In this case, the context variable will be separate from the one
108
+ # used in START so calling set() will have no effect. However, we still have a reference to the list used
109
+ # in START. So we update the reference to be equal to the old one.. So we need to update the current
110
+ # reference stack to be equal to the previous stack.
98
111
 
99
- parent_step_id = open_step.step_parent_id
112
+ # Scenario 1: Restore the previous active span id stack in case we are in a coroutine. Dont use reset here
113
+ # since we can be in different contexts
114
+ self._context_state.active_span_id_stack.set(prev_stack)
115
+
116
+ pop_count = 0
117
+
118
+ # Scenario 2: Remove all steps from the current stack until we reach the parent step id to make it equal to
119
+ # the previous stack. In the coroutine case, this will not have any effect.
120
+ while (curr_stack[-1] != parent_step_id):
121
+ curr_stack.pop()
122
+ pop_count += 1
123
+
124
+ if (pop_count != 1):
125
+ logger.warning(
126
+ "Step id %s not the last step in the stack. "
127
+ "Removing it from the stack but this is likely an error",
128
+ payload.UUID)
129
+
130
+ # Verify that the stack is now equal to the previous stack
131
+ if (curr_stack != prev_stack):
132
+ logger.warning("Current span ID stack is not equal to the previous stack. "
133
+ "This is likely an error. Report this to the AIQ team.")
134
+
135
+ logger.debug("Popped end step %s, name %s, type %s, parent %s, stack id %s",
136
+ payload.UUID,
137
+ payload.name,
138
+ payload.event_type,
139
+ parent_step_id,
140
+ id(curr_stack))
100
141
 
101
142
  elif (payload.event_state == IntermediateStepState.CHUNK):
102
143
 
aiq/meta/pypi.md CHANGED
@@ -23,19 +23,19 @@ AIQ toolkit is a flexible library designed to seamlessly integrate your enterpri
23
23
 
24
24
  ## Key Features
25
25
 
26
- - [**Framework Agnostic:**](https://docs.nvidia.com/aiqtoolkit/v1.1.0-rc5/extend/plugins.html) Works with any agentic framework, so you can use your current technology stack without replatforming.
27
- - [**Reusability:**](https://docs.nvidia.com/aiqtoolkit/v1.1.0-rc5/extend/sharing-components.html) Every agent, tool, or workflow can be combined and repurposed, allowing developers to leverage existing work in new scenarios.
28
- - [**Rapid Development:**](https://docs.nvidia.com/aiqtoolkit/v1.1.0-rc5/tutorials/index.html) Start with a pre-built agent, tool, or workflow, and customize it to your needs.
29
- - [**Profiling:**](https://docs.nvidia.com/aiqtoolkit/v1.1.0-rc5/workflows/profiler.html) Profile entire workflows down to the tool and agent level, track input/output tokens and timings, and identify bottlenecks.
30
- - [**Observability:**](https://docs.nvidia.com/aiqtoolkit/v1.1.0-rc5/workflows/observe/observe-workflow-with-phoenix.html) Monitor and debug your workflows with any OpenTelemetry-compatible observability tool, with examples using [Phoenix](https://docs.nvidia.com/aiqtoolkit/v1.1.0-rc5/workflows/observe/observe-workflow-with-phoenix.html) and [W&B Weave](https://docs.nvidia.com/aiqtoolkit/v1.1.0-rc5/workflows/observe/observe-workflow-with-weave.html).
31
- - [**Evaluation System:**](https://docs.nvidia.com/aiqtoolkit/v1.1.0-rc5/workflows/evaluate.html) Validate and maintain accuracy of agentic workflows with built-in evaluation tools.
32
- - [**User Interface:**](https://docs.nvidia.com/aiqtoolkit/v1.1.0-rc5/quick-start/launching-ui.html) Use the AIQ toolkit UI chat interface to interact with your agents, visualize output, and debug workflows.
33
- - [**MCP Compatibility**](https://docs.nvidia.com/aiqtoolkit/v1.1.0-rc5/workflows/mcp/mcp-client.html) Compatible with Model Context Protocol (MCP), allowing tools served by MCP Servers to be used as AIQ toolkit functions.
26
+ - [**Framework Agnostic:**](https://docs.nvidia.com/aiqtoolkit/v1.2.0-dev/extend/plugins.html) Works with any agentic framework, so you can use your current technology stack without replatforming.
27
+ - [**Reusability:**](https://docs.nvidia.com/aiqtoolkit/v1.2.0-dev/extend/sharing-components.html) Every agent, tool, or workflow can be combined and repurposed, allowing developers to leverage existing work in new scenarios.
28
+ - [**Rapid Development:**](https://docs.nvidia.com/aiqtoolkit/v1.2.0-dev/tutorials/index.html) Start with a pre-built agent, tool, or workflow, and customize it to your needs.
29
+ - [**Profiling:**](https://docs.nvidia.com/aiqtoolkit/v1.2.0-dev/workflows/profiler.html) Profile entire workflows down to the tool and agent level, track input/output tokens and timings, and identify bottlenecks.
30
+ - [**Observability:**](https://docs.nvidia.com/aiqtoolkit/v1.2.0-dev/workflows/observe/observe-workflow-with-phoenix.html) Monitor and debug your workflows with any OpenTelemetry-compatible observability tool, with examples using [Phoenix](https://docs.nvidia.com/aiqtoolkit/v1.2.0-dev/workflows/observe/observe-workflow-with-phoenix.html) and [W&B Weave](https://docs.nvidia.com/aiqtoolkit/v1.2.0-dev/workflows/observe/observe-workflow-with-weave.html).
31
+ - [**Evaluation System:**](https://docs.nvidia.com/aiqtoolkit/v1.2.0-dev/workflows/evaluate.html) Validate and maintain accuracy of agentic workflows with built-in evaluation tools.
32
+ - [**User Interface:**](https://docs.nvidia.com/aiqtoolkit/v1.2.0-dev/quick-start/launching-ui.html) Use the AIQ toolkit UI chat interface to interact with your agents, visualize output, and debug workflows.
33
+ - [**MCP Compatibility**](https://docs.nvidia.com/aiqtoolkit/v1.2.0-dev/workflows/mcp/mcp-client.html) Compatible with Model Context Protocol (MCP), allowing tools served by MCP Servers to be used as AIQ toolkit functions.
34
34
 
35
35
  With AIQ toolkit, you can move quickly, experiment freely, and ensure reliability across all your agent-driven projects.
36
36
 
37
37
  ## Links
38
- * [Documentation](https://docs.nvidia.com/aiqtoolkit/v1.1.0-rc5/index.html): Explore the full documentation for AIQ toolkit.
38
+ * [Documentation](https://docs.nvidia.com/aiqtoolkit/v1.2.0-dev/index.html): Explore the full documentation for AIQ toolkit.
39
39
 
40
40
  ## First time user?
41
41
  If this is your first time using AIQ toolkit, it is recommended to install the latest version from the [source repository](https://github.com/NVIDIA/AIQToolkit?tab=readme-ov-file#quick-start) on GitHub. This package is intended for users who are familiar with AIQ toolkit applications and need to add AIQ toolkit as a dependency to their project.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aiqtoolkit
3
- Version: 1.1.0rc5
3
+ Version: 1.2.0.dev0
4
4
  Summary: NVIDIA Agent Intelligence toolkit
5
5
  Author: NVIDIA Corporation
6
6
  Maintainer: NVIDIA Corporation
@@ -296,19 +296,19 @@ AIQ toolkit is a flexible library designed to seamlessly integrate your enterpri
296
296
 
297
297
  ## Key Features
298
298
 
299
- - [**Framework Agnostic:**](https://docs.nvidia.com/aiqtoolkit/v1.1.0-rc5/extend/plugins.html) Works with any agentic framework, so you can use your current technology stack without replatforming.
300
- - [**Reusability:**](https://docs.nvidia.com/aiqtoolkit/v1.1.0-rc5/extend/sharing-components.html) Every agent, tool, or workflow can be combined and repurposed, allowing developers to leverage existing work in new scenarios.
301
- - [**Rapid Development:**](https://docs.nvidia.com/aiqtoolkit/v1.1.0-rc5/tutorials/index.html) Start with a pre-built agent, tool, or workflow, and customize it to your needs.
302
- - [**Profiling:**](https://docs.nvidia.com/aiqtoolkit/v1.1.0-rc5/workflows/profiler.html) Profile entire workflows down to the tool and agent level, track input/output tokens and timings, and identify bottlenecks.
303
- - [**Observability:**](https://docs.nvidia.com/aiqtoolkit/v1.1.0-rc5/workflows/observe/observe-workflow-with-phoenix.html) Monitor and debug your workflows with any OpenTelemetry-compatible observability tool, with examples using [Phoenix](https://docs.nvidia.com/aiqtoolkit/v1.1.0-rc5/workflows/observe/observe-workflow-with-phoenix.html) and [W&B Weave](https://docs.nvidia.com/aiqtoolkit/v1.1.0-rc5/workflows/observe/observe-workflow-with-weave.html).
304
- - [**Evaluation System:**](https://docs.nvidia.com/aiqtoolkit/v1.1.0-rc5/workflows/evaluate.html) Validate and maintain accuracy of agentic workflows with built-in evaluation tools.
305
- - [**User Interface:**](https://docs.nvidia.com/aiqtoolkit/v1.1.0-rc5/quick-start/launching-ui.html) Use the AIQ toolkit UI chat interface to interact with your agents, visualize output, and debug workflows.
306
- - [**MCP Compatibility**](https://docs.nvidia.com/aiqtoolkit/v1.1.0-rc5/workflows/mcp/mcp-client.html) Compatible with Model Context Protocol (MCP), allowing tools served by MCP Servers to be used as AIQ toolkit functions.
299
+ - [**Framework Agnostic:**](https://docs.nvidia.com/aiqtoolkit/v1.2.0-dev/extend/plugins.html) Works with any agentic framework, so you can use your current technology stack without replatforming.
300
+ - [**Reusability:**](https://docs.nvidia.com/aiqtoolkit/v1.2.0-dev/extend/sharing-components.html) Every agent, tool, or workflow can be combined and repurposed, allowing developers to leverage existing work in new scenarios.
301
+ - [**Rapid Development:**](https://docs.nvidia.com/aiqtoolkit/v1.2.0-dev/tutorials/index.html) Start with a pre-built agent, tool, or workflow, and customize it to your needs.
302
+ - [**Profiling:**](https://docs.nvidia.com/aiqtoolkit/v1.2.0-dev/workflows/profiler.html) Profile entire workflows down to the tool and agent level, track input/output tokens and timings, and identify bottlenecks.
303
+ - [**Observability:**](https://docs.nvidia.com/aiqtoolkit/v1.2.0-dev/workflows/observe/observe-workflow-with-phoenix.html) Monitor and debug your workflows with any OpenTelemetry-compatible observability tool, with examples using [Phoenix](https://docs.nvidia.com/aiqtoolkit/v1.2.0-dev/workflows/observe/observe-workflow-with-phoenix.html) and [W&B Weave](https://docs.nvidia.com/aiqtoolkit/v1.2.0-dev/workflows/observe/observe-workflow-with-weave.html).
304
+ - [**Evaluation System:**](https://docs.nvidia.com/aiqtoolkit/v1.2.0-dev/workflows/evaluate.html) Validate and maintain accuracy of agentic workflows with built-in evaluation tools.
305
+ - [**User Interface:**](https://docs.nvidia.com/aiqtoolkit/v1.2.0-dev/quick-start/launching-ui.html) Use the AIQ toolkit UI chat interface to interact with your agents, visualize output, and debug workflows.
306
+ - [**MCP Compatibility**](https://docs.nvidia.com/aiqtoolkit/v1.2.0-dev/workflows/mcp/mcp-client.html) Compatible with Model Context Protocol (MCP), allowing tools served by MCP Servers to be used as AIQ toolkit functions.
307
307
 
308
308
  With AIQ toolkit, you can move quickly, experiment freely, and ensure reliability across all your agent-driven projects.
309
309
 
310
310
  ## Links
311
- * [Documentation](https://docs.nvidia.com/aiqtoolkit/v1.1.0-rc5/index.html): Explore the full documentation for AIQ toolkit.
311
+ * [Documentation](https://docs.nvidia.com/aiqtoolkit/v1.2.0-dev/index.html): Explore the full documentation for AIQ toolkit.
312
312
 
313
313
  ## First time user?
314
314
  If this is your first time using AIQ toolkit, it is recommended to install the latest version from the [source repository](https://github.com/NVIDIA/AIQToolkit?tab=readme-ov-file#quick-start) on GitHub. This package is intended for users who are familiar with AIQ toolkit applications and need to add AIQ toolkit as a dependency to their project.
@@ -28,7 +28,7 @@ aiq/builder/front_end.py,sha256=Xhvfi4VcDh5EoCtLr6AlLQfbRm8_TyugUc_IRfirN6Y,2225
28
28
  aiq/builder/function.py,sha256=Sh4LKgC-gipsMkNexUY4mw-Br4dWZxq6AHv-als0-e0,11430
29
29
  aiq/builder/function_base.py,sha256=AF5a56y-Nw9OpWsP8IFukUKM2FtP8758qYQW6EfObO0,13109
30
30
  aiq/builder/function_info.py,sha256=pGPIAL0tjVqLOJymIRB0boI9pzJGdXiPK3KiZvXQsqM,25266
31
- aiq/builder/intermediate_step_manager.py,sha256=TafKueZRFxAzhoYH2BH57giaGAhc4FLR6WM1dfx8yzo,5669
31
+ aiq/builder/intermediate_step_manager.py,sha256=aKjOK7Gk9XbKhKvRMQTylRGDFZJU7rwqSuiZYaPfwjA,7830
32
32
  aiq/builder/llm.py,sha256=DcoYCyschsRjkW_yGsa_Ci7ELSpk5KRbi9778Dm_B9c,951
33
33
  aiq/builder/retriever.py,sha256=GM7L1T4NdNZKerFZiCfLcQOwsGoX0NRlF8my7SMq3l4,970
34
34
  aiq/builder/user_interaction_manager.py,sha256=OXr-RxWf1sEZjzQH_jt0nmqrLBtYLHGEZEcfDYYFV88,2913
@@ -171,7 +171,7 @@ aiq/memory/__init__.py,sha256=sNqiLatqyTNSBUKKgmInOvCmebkuDHRTErZaeOaE8C8,844
171
171
  aiq/memory/interfaces.py,sha256=lyj1TGr3Fhibul8Y64Emj-BUEqDotmmFoVCEMqTujUA,5531
172
172
  aiq/memory/models.py,sha256=c5dA7nKHQ4AS1_ptQZcfC_oXO495-ehocnf_qXTE6c8,4319
173
173
  aiq/meta/module_to_distro.json,sha256=1XV7edobFrdDKvsSoynfodXg_hczUWpDrQzGkW9qqEs,28
174
- aiq/meta/pypi.md,sha256=OYkfnhA2QhkEgG0nxc70UjJLaBDJvuBDgMRiZ-X1gnE,4417
174
+ aiq/meta/pypi.md,sha256=paeIfIxPyCinzDbIFamNJbccI2T0yzkothgs_bQJ3bw,4417
175
175
  aiq/observability/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
176
176
  aiq/observability/async_otel_listener.py,sha256=oyDO_8XNzQqyiFe-8iJhZr3z9kWsEJEuKEoOPf7L-Bk,17667
177
177
  aiq/observability/register.py,sha256=ZDQOaSuy9igc7nAKG7XWP2u6JanC2T8yufMWItNpPJI,4245
@@ -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.1.0rc5.dist-info/licenses/LICENSE-3rd-party.txt,sha256=8o7aySJa9CBvFshPcsRdJbczzdNyDGJ8b0J67WRUQ2k,183936
311
- aiqtoolkit-1.1.0rc5.dist-info/licenses/LICENSE.md,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
312
- aiqtoolkit-1.1.0rc5.dist-info/METADATA,sha256=A21grEksHmg5DsTpzbcn9QbLQL3Q11DrAagRmLjB_Vw,20150
313
- aiqtoolkit-1.1.0rc5.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
314
- aiqtoolkit-1.1.0rc5.dist-info/entry_points.txt,sha256=gRlPfR5g21t328WNEQ4CcEz80S1sJNS8A7rMDYnzl4A,452
315
- aiqtoolkit-1.1.0rc5.dist-info/top_level.txt,sha256=fo7AzYcNhZ_tRWrhGumtxwnxMew4xrT1iwouDy_f0Kc,4
316
- aiqtoolkit-1.1.0rc5.dist-info/RECORD,,
310
+ aiqtoolkit-1.2.0.dev0.dist-info/licenses/LICENSE-3rd-party.txt,sha256=8o7aySJa9CBvFshPcsRdJbczzdNyDGJ8b0J67WRUQ2k,183936
311
+ aiqtoolkit-1.2.0.dev0.dist-info/licenses/LICENSE.md,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
312
+ aiqtoolkit-1.2.0.dev0.dist-info/METADATA,sha256=HzUhxoak0RU3snZu5vnClgTFBkd4XwWi0kfqECTalJo,20152
313
+ aiqtoolkit-1.2.0.dev0.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
314
+ aiqtoolkit-1.2.0.dev0.dist-info/entry_points.txt,sha256=gRlPfR5g21t328WNEQ4CcEz80S1sJNS8A7rMDYnzl4A,452
315
+ aiqtoolkit-1.2.0.dev0.dist-info/top_level.txt,sha256=fo7AzYcNhZ_tRWrhGumtxwnxMew4xrT1iwouDy_f0Kc,4
316
+ aiqtoolkit-1.2.0.dev0.dist-info/RECORD,,