aiqtoolkit 1.1.0a20250429__py3-none-any.whl → 1.1.0a20250501__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.
- aiq/agent/react_agent/register.py +2 -2
- aiq/agent/reasoning_agent/reasoning_agent.py +1 -1
- aiq/agent/rewoo_agent/register.py +2 -2
- aiq/builder/component_utils.py +5 -5
- aiq/builder/front_end.py +4 -4
- aiq/builder/function_base.py +4 -4
- aiq/builder/function_info.py +1 -1
- aiq/builder/intermediate_step_manager.py +10 -8
- aiq/builder/workflow_builder.py +1 -1
- aiq/cli/cli_utils/validation.py +1 -1
- aiq/cli/commands/configure/channel/add.py +1 -1
- aiq/cli/commands/configure/channel/channel.py +3 -1
- aiq/cli/commands/configure/channel/remove.py +1 -1
- aiq/cli/commands/configure/channel/update.py +1 -1
- aiq/cli/commands/configure/configure.py +2 -2
- aiq/cli/commands/info/info.py +2 -2
- aiq/cli/commands/info/list_components.py +2 -2
- aiq/cli/commands/registry/publish.py +3 -3
- aiq/cli/commands/registry/pull.py +3 -3
- aiq/cli/commands/registry/registry.py +3 -1
- aiq/cli/commands/registry/remove.py +3 -3
- aiq/cli/commands/registry/search.py +3 -3
- aiq/cli/commands/start.py +4 -4
- aiq/cli/commands/uninstall.py +2 -2
- aiq/cli/commands/workflow/templates/pyproject.toml.j2 +2 -2
- aiq/cli/commands/workflow/workflow_commands.py +14 -8
- aiq/cli/entrypoint.py +1 -1
- aiq/data_models/api_server.py +6 -6
- aiq/data_models/component_ref.py +7 -7
- aiq/data_models/discovery_metadata.py +7 -7
- aiq/data_models/intermediate_step.py +2 -2
- aiq/eval/register.py +1 -0
- aiq/eval/remote_workflow.py +1 -1
- aiq/eval/tunable_rag_evaluator/__init__.py +0 -0
- aiq/eval/tunable_rag_evaluator/evaluate.py +263 -0
- aiq/eval/tunable_rag_evaluator/register.py +50 -0
- aiq/front_ends/console/console_front_end_config.py +1 -1
- aiq/front_ends/fastapi/fastapi_front_end_config.py +5 -5
- aiq/front_ends/fastapi/fastapi_front_end_plugin_worker.py +27 -18
- aiq/front_ends/fastapi/response_helpers.py +33 -19
- aiq/memory/__init__.py +2 -2
- aiq/meta/pypi.md +18 -18
- aiq/observability/async_otel_listener.py +13 -10
- aiq/profiler/callbacks/agno_callback_handler.py +2 -2
- aiq/profiler/callbacks/langchain_callback_handler.py +1 -1
- aiq/profiler/callbacks/llama_index_callback_handler.py +1 -1
- aiq/profiler/callbacks/semantic_kernel_callback_handler.py +1 -1
- aiq/profiler/decorators/function_tracking.py +1 -1
- aiq/profiler/profile_runner.py +1 -1
- aiq/registry_handlers/local/local_handler.py +5 -5
- aiq/registry_handlers/local/register_local.py +1 -1
- aiq/registry_handlers/package_utils.py +2 -2
- aiq/registry_handlers/pypi/pypi_handler.py +5 -5
- aiq/registry_handlers/pypi/register_pypi.py +3 -3
- aiq/registry_handlers/registry_handler_base.py +7 -7
- aiq/registry_handlers/rest/register_rest.py +4 -4
- aiq/registry_handlers/rest/rest_handler.py +5 -5
- aiq/registry_handlers/schemas/package.py +1 -1
- aiq/registry_handlers/schemas/publish.py +4 -4
- aiq/registry_handlers/schemas/pull.py +5 -4
- aiq/registry_handlers/schemas/search.py +7 -7
- aiq/retriever/models.py +1 -1
- aiq/runtime/loader.py +6 -6
- aiq/tool/mcp/mcp_tool.py +3 -2
- aiq/tool/retriever.py +1 -1
- aiq/utils/io/yaml_tools.py +75 -6
- aiq/utils/settings/global_settings.py +1 -1
- {aiqtoolkit-1.1.0a20250429.dist-info → aiqtoolkit-1.1.0a20250501.dist-info}/METADATA +22 -21
- {aiqtoolkit-1.1.0a20250429.dist-info → aiqtoolkit-1.1.0a20250501.dist-info}/RECORD +74 -71
- {aiqtoolkit-1.1.0a20250429.dist-info → aiqtoolkit-1.1.0a20250501.dist-info}/WHEEL +1 -1
- {aiqtoolkit-1.1.0a20250429.dist-info → aiqtoolkit-1.1.0a20250501.dist-info}/entry_points.txt +0 -0
- {aiqtoolkit-1.1.0a20250429.dist-info → aiqtoolkit-1.1.0a20250501.dist-info}/licenses/LICENSE-3rd-party.txt +0 -0
- {aiqtoolkit-1.1.0a20250429.dist-info → aiqtoolkit-1.1.0a20250501.dist-info}/licenses/LICENSE.md +0 -0
- {aiqtoolkit-1.1.0a20250429.dist-info → aiqtoolkit-1.1.0a20250501.dist-info}/top_level.txt +0 -0
|
@@ -117,16 +117,26 @@ async def generate_single_response(
|
|
|
117
117
|
return await runner.result(to_type=result_type)
|
|
118
118
|
|
|
119
119
|
|
|
120
|
-
async def
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
120
|
+
async def generate_streaming_response_full(payload: typing.Any,
|
|
121
|
+
*,
|
|
122
|
+
session_manager: AIQSessionManager,
|
|
123
|
+
streaming: bool,
|
|
124
|
+
result_type: type | None = None,
|
|
125
|
+
output_type: type | None = None,
|
|
126
|
+
filter_steps: str | None = None) -> AsyncGenerator[AIQResponseSerializable]:
|
|
126
127
|
"""
|
|
127
128
|
Similar to generate_streaming_response but provides raw AIQResponseIntermediateStep objects
|
|
128
129
|
without any step adaptor translations.
|
|
129
130
|
"""
|
|
131
|
+
# Parse filter_steps into a set of allowed types if provided
|
|
132
|
+
# Special case: if filter_steps is "none", suppress all steps
|
|
133
|
+
allowed_types = None
|
|
134
|
+
if filter_steps:
|
|
135
|
+
if filter_steps.lower() == "none":
|
|
136
|
+
allowed_types = set() # Empty set means no steps allowed
|
|
137
|
+
else:
|
|
138
|
+
allowed_types = set(filter_steps.split(','))
|
|
139
|
+
|
|
130
140
|
async with session_manager.run(payload) as runner:
|
|
131
141
|
q: AsyncIOProducerConsumerQueue[AIQResponseSerializable] = AsyncIOProducerConsumerQueue()
|
|
132
142
|
|
|
@@ -150,7 +160,9 @@ async def generate_streaming_response_raw(payload: typing.Any,
|
|
|
150
160
|
|
|
151
161
|
async for item in q:
|
|
152
162
|
if (isinstance(item, AIQResponseIntermediateStep)):
|
|
153
|
-
|
|
163
|
+
# Filter intermediate steps if filter_steps is provided
|
|
164
|
+
if allowed_types is None or item.type in allowed_types:
|
|
165
|
+
yield item
|
|
154
166
|
else:
|
|
155
167
|
yield AIQResponsePayloadOutput(payload=item)
|
|
156
168
|
except Exception as e:
|
|
@@ -160,20 +172,22 @@ async def generate_streaming_response_raw(payload: typing.Any,
|
|
|
160
172
|
await q.close()
|
|
161
173
|
|
|
162
174
|
|
|
163
|
-
async def
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
175
|
+
async def generate_streaming_response_full_as_str(payload: typing.Any,
|
|
176
|
+
*,
|
|
177
|
+
session_manager: AIQSessionManager,
|
|
178
|
+
streaming: bool,
|
|
179
|
+
result_type: type | None = None,
|
|
180
|
+
output_type: type | None = None,
|
|
181
|
+
filter_steps: str | None = None) -> AsyncGenerator[str]:
|
|
169
182
|
"""
|
|
170
|
-
Similar to
|
|
183
|
+
Similar to generate_streaming_response but converts the response to a string format.
|
|
171
184
|
"""
|
|
172
|
-
async for item in
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
185
|
+
async for item in generate_streaming_response_full(payload,
|
|
186
|
+
session_manager=session_manager,
|
|
187
|
+
streaming=streaming,
|
|
188
|
+
result_type=result_type,
|
|
189
|
+
output_type=output_type,
|
|
190
|
+
filter_steps=filter_steps):
|
|
177
191
|
if (isinstance(item, AIQResponseIntermediateStep) or isinstance(item, AIQResponsePayloadOutput)):
|
|
178
192
|
yield item.get_stream_data()
|
|
179
193
|
else:
|
aiq/memory/__init__.py
CHANGED
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
# See the License for the specific language governing permissions and
|
|
14
14
|
# limitations under the License.
|
|
15
15
|
"""
|
|
16
|
-
|
|
16
|
+
AIQ Toolkit Memory Module
|
|
17
17
|
|
|
18
18
|
This package provides foundational classes and interfaces
|
|
19
|
-
for managing text-based memory in
|
|
19
|
+
for managing text-based memory in AIQ Toolkit's LLM-based agents.
|
|
20
20
|
"""
|
aiq/meta/pypi.md
CHANGED
|
@@ -6,7 +6,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
6
6
|
you may not use this file except in compliance with the License.
|
|
7
7
|
You may obtain a copy of the License at
|
|
8
8
|
|
|
9
|
-
http
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
10
|
|
|
11
11
|
Unless required by applicable law or agreed to in writing, software
|
|
12
12
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
@@ -15,39 +15,39 @@ See the License for the specific language governing permissions and
|
|
|
15
15
|
limitations under the License.
|
|
16
16
|
-->
|
|
17
17
|
|
|
18
|
-

|
|
19
19
|
|
|
20
|
-
# NVIDIA
|
|
20
|
+
# NVIDIA Agent Intelligence Toolkit
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
AIQ Toolkit is a flexible library designed to seamlessly integrate your enterprise agents—regardless of framework—with various data sources and tools. By treating agents, tools, and agentic workflows as simple function calls, AIQ Toolkit enables true composability: build once and reuse anywhere.
|
|
23
23
|
|
|
24
24
|
## Key Features
|
|
25
25
|
|
|
26
|
-
- [**Framework Agnostic:**](https://docs.nvidia.com/
|
|
27
|
-
- [**Reusability:**](https://docs.nvidia.com/
|
|
28
|
-
- [**Rapid Development:**](https://docs.nvidia.com/
|
|
29
|
-
- [**Profiling:**](https://docs.nvidia.com/
|
|
30
|
-
- [**Observability:**](https://docs.nvidia.com/
|
|
31
|
-
- [**Evaluation System:**](https://docs.nvidia.com/
|
|
32
|
-
- [**User Interface:**](https://docs.nvidia.com/
|
|
33
|
-
- [**MCP Compatibility**](https://docs.nvidia.com/
|
|
26
|
+
- [**Framework Agnostic:**](https://docs.nvidia.com/aiqtoolkit/latest/concepts/plugins.html) Works with any agentic framework, so you can use your current technology stack without replatforming.
|
|
27
|
+
- [**Reusability:**](https://docs.nvidia.com/aiqtoolkit/latest/guides/sharing-workflows-and-tools.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/latest/guides/create-customize-workflows.html) Start with a pre-built agent, tool, or workflow, and customize it to your needs.
|
|
29
|
+
- [**Profiling:**](https://docs.nvidia.com/aiqtoolkit/latest/guides/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/latest/guides/observe-workflow-with-phoenix.html) Monitor and debug your workflows with any OpenTelemetry-compatible observability tool.
|
|
31
|
+
- [**Evaluation System:**](https://docs.nvidia.com/aiqtoolkit/latest/guides/evaluate.html) Validate and maintain accuracy of agentic workflows with built-in evaluation tools.
|
|
32
|
+
- [**User Interface:**](https://docs.nvidia.com/aiqtoolkit/latest/guides/using-aiqtoolkit-ui-and-server.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/latest/components/mcp.html) Compatible with Model Context Protocol (MCP), allowing tools served by MCP Servers to be used as AIQ Toolkit functions.
|
|
34
34
|
|
|
35
|
-
With
|
|
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/
|
|
39
|
-
* [About
|
|
38
|
+
* [Documentation](https://docs.nvidia.com/aiqtoolkit/latest/index.html): Explore the full documentation for AIQ Toolkit.
|
|
39
|
+
* [About AIQ Toolkit](https://docs.nvidia.com/aiqtoolkit/latest/intro/why-aiqtoolkit.html): Learn more about the benefits of using AIQ Toolkit.
|
|
40
40
|
|
|
41
41
|
## First time user?
|
|
42
|
-
If this is your first time using
|
|
42
|
+
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#get-started) 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.
|
|
43
43
|
|
|
44
44
|
## Feedback
|
|
45
45
|
|
|
46
|
-
We would love to hear from you! Please file an issue on [GitHub](https://github.com/NVIDIA/
|
|
46
|
+
We would love to hear from you! Please file an issue on [GitHub](https://github.com/NVIDIA/AIQToolkit/issues) if you have any feedback or feature requests.
|
|
47
47
|
|
|
48
48
|
## Acknowledgements
|
|
49
49
|
|
|
50
|
-
We would like to thank the following open source projects that made
|
|
50
|
+
We would like to thank the following open source projects that made AIQ Toolkit possible:
|
|
51
51
|
|
|
52
52
|
- [CrewAI](https://github.com/crewAIInc/crewAI)
|
|
53
53
|
- [FastAPI](https://github.com/tiangolo/fastapi)
|
|
@@ -37,7 +37,7 @@ OPENINFERENCE_SPAN_KIND = SpanAttributes.OPENINFERENCE_SPAN_KIND
|
|
|
37
37
|
|
|
38
38
|
def _ns_timestamp(seconds_float: float) -> int:
|
|
39
39
|
"""
|
|
40
|
-
Convert
|
|
40
|
+
Convert AIQ Toolkit’s float `event_timestamp` (in seconds) into an integer number
|
|
41
41
|
of nanoseconds, as OpenTelemetry expects.
|
|
42
42
|
"""
|
|
43
43
|
return int(seconds_float * 1e9)
|
|
@@ -45,14 +45,14 @@ def _ns_timestamp(seconds_float: float) -> int:
|
|
|
45
45
|
|
|
46
46
|
class AsyncOtelSpanListener:
|
|
47
47
|
"""
|
|
48
|
-
A separate, async class that listens to the
|
|
48
|
+
A separate, async class that listens to the AIQ Toolkit intermediate step
|
|
49
49
|
event stream and creates proper Otel spans:
|
|
50
50
|
|
|
51
51
|
- On FUNCTION_START => open a new top-level span
|
|
52
52
|
- On any other intermediate step => open a child subspan (immediate open/close)
|
|
53
53
|
- On FUNCTION_END => close the function’s top-level span
|
|
54
54
|
|
|
55
|
-
This runs fully independently from the normal
|
|
55
|
+
This runs fully independently from the normal AIQ Toolkit workflow, so that
|
|
56
56
|
the workflow is not blocking or entangled by OTel calls.
|
|
57
57
|
"""
|
|
58
58
|
|
|
@@ -70,7 +70,7 @@ class AsyncOtelSpanListener:
|
|
|
70
70
|
self._outstanding_spans: dict[str, Span] = {}
|
|
71
71
|
|
|
72
72
|
# Stack of spans, for when we need to create a child span
|
|
73
|
-
self._span_stack:
|
|
73
|
+
self._span_stack: dict[str, Span] = {}
|
|
74
74
|
|
|
75
75
|
self._running = False
|
|
76
76
|
|
|
@@ -109,11 +109,11 @@ class AsyncOtelSpanListener:
|
|
|
109
109
|
|
|
110
110
|
otel_listener = AsyncOtelSpanListener()
|
|
111
111
|
async with otel_listener.start():
|
|
112
|
-
# run your
|
|
112
|
+
# run your AIQ Toolkit workflow
|
|
113
113
|
...
|
|
114
114
|
# cleans up
|
|
115
115
|
|
|
116
|
-
This sets up the subscription to the
|
|
116
|
+
This sets up the subscription to the AIQ Toolkit event stream and starts the background loop.
|
|
117
117
|
"""
|
|
118
118
|
try:
|
|
119
119
|
# Subscribe to the event stream
|
|
@@ -152,7 +152,7 @@ class AsyncOtelSpanListener:
|
|
|
152
152
|
|
|
153
153
|
self._outstanding_spans.clear()
|
|
154
154
|
|
|
155
|
-
if self._span_stack:
|
|
155
|
+
if len(self._span_stack) > 0:
|
|
156
156
|
logger.error(
|
|
157
157
|
"Not all spans were closed. Ensure all start events have a corresponding end event. Remaining: %s",
|
|
158
158
|
self._span_stack)
|
|
@@ -175,7 +175,10 @@ class AsyncOtelSpanListener:
|
|
|
175
175
|
parent_ctx = None
|
|
176
176
|
|
|
177
177
|
if (len(self._span_stack) > 0):
|
|
178
|
-
parent_span = self._span_stack
|
|
178
|
+
parent_span = self._span_stack.get(step.function_ancestry.parent_id, None)
|
|
179
|
+
if parent_span is None:
|
|
180
|
+
logger.warning("No parent span found for step %s", step.UUID)
|
|
181
|
+
return
|
|
179
182
|
|
|
180
183
|
parent_ctx = set_span_in_context(parent_span)
|
|
181
184
|
|
|
@@ -230,7 +233,7 @@ class AsyncOtelSpanListener:
|
|
|
230
233
|
sub_span.set_attribute(SpanAttributes.INPUT_VALUE, serialized_input)
|
|
231
234
|
sub_span.set_attribute(SpanAttributes.INPUT_MIME_TYPE, "application/json" if is_json else "text/plain")
|
|
232
235
|
|
|
233
|
-
self._span_stack.
|
|
236
|
+
self._span_stack[step.UUID] = sub_span
|
|
234
237
|
|
|
235
238
|
self._outstanding_spans[step.UUID] = sub_span
|
|
236
239
|
|
|
@@ -243,7 +246,7 @@ class AsyncOtelSpanListener:
|
|
|
243
246
|
logger.warning("No subspan found for step %s", step.UUID)
|
|
244
247
|
return
|
|
245
248
|
|
|
246
|
-
self._span_stack.pop()
|
|
249
|
+
self._span_stack.pop(step.UUID, None)
|
|
247
250
|
|
|
248
251
|
# Optionally add more attributes from usage_info or data
|
|
249
252
|
usage_info = step.payload.usage_info
|
|
@@ -44,7 +44,7 @@ class AgnoProfilerHandler(BaseProfilerCallback):
|
|
|
44
44
|
- LLM Calls
|
|
45
45
|
|
|
46
46
|
to collect usage statistics (tokens, inputs, outputs, time intervals, etc.)
|
|
47
|
-
and store them in
|
|
47
|
+
and store them in AIQ Toolkit's usage_stats queue for subsequent analysis.
|
|
48
48
|
"""
|
|
49
49
|
|
|
50
50
|
def __init__(self) -> None:
|
|
@@ -73,7 +73,7 @@ class AgnoProfilerHandler(BaseProfilerCallback):
|
|
|
73
73
|
|
|
74
74
|
# Note: Agno doesn't have a class-based tool structure to patch directly.
|
|
75
75
|
# Instead, it uses decorators to convert functions to tools.
|
|
76
|
-
# In
|
|
76
|
+
# In AIQ Toolkit, tool executions are captured at the execute_agno_tool level
|
|
77
77
|
# in packages/aiqtoolkit_agno/src/aiq/plugins/agno/tool_wrapper.py
|
|
78
78
|
|
|
79
79
|
# To properly monitor Agno tool executions, we would need to either:
|
|
@@ -50,7 +50,7 @@ class LangchainProfilerHandler(AsyncCallbackHandler, BaseProfilerCallback): # p
|
|
|
50
50
|
completion_tokens: int = 0
|
|
51
51
|
successful_requests: int = 0
|
|
52
52
|
raise_error = True # Override to raise error and run inline
|
|
53
|
-
run_inline =
|
|
53
|
+
run_inline = True
|
|
54
54
|
|
|
55
55
|
def __init__(self) -> None:
|
|
56
56
|
super().__init__()
|
|
@@ -167,7 +167,7 @@ class LlamaIndexProfilerHandler(BaseCallbackHandler, BaseProfilerCallback):
|
|
|
167
167
|
except Exception as e:
|
|
168
168
|
logger.exception("Error getting model name: %s", e, exc_info=True)
|
|
169
169
|
|
|
170
|
-
# Append usage data to
|
|
170
|
+
# Append usage data to AIQ Toolkit usage stats
|
|
171
171
|
with self._lock:
|
|
172
172
|
stats = IntermediateStepPayload(
|
|
173
173
|
event_type=IntermediateStepType.LLM_END,
|
|
@@ -55,7 +55,7 @@ class SemanticKernelProfilerHandler(BaseProfilerCallback):
|
|
|
55
55
|
- Tool calls
|
|
56
56
|
|
|
57
57
|
to collect usage statistics (tokens, inputs, outputs, time intervals, etc.)
|
|
58
|
-
and store them in
|
|
58
|
+
and store them in AIQ Toolkit's usage_stats queue for subsequent analysis.
|
|
59
59
|
"""
|
|
60
60
|
|
|
61
61
|
def __init__(self, workflow_llms: dict) -> None:
|
|
@@ -61,7 +61,7 @@ def push_intermediate_step(step_manager: IntermediateStepManager,
|
|
|
61
61
|
kwargs: Any = None,
|
|
62
62
|
output: Any = None,
|
|
63
63
|
metadata: dict[str, Any] | None = None) -> None:
|
|
64
|
-
"""Push an intermediate step to the
|
|
64
|
+
"""Push an intermediate step to the AIQ Toolkit Event Stream."""
|
|
65
65
|
|
|
66
66
|
payload = IntermediateStepPayload(UUID=identifier,
|
|
67
67
|
event_type=event_type,
|
aiq/profiler/profile_runner.py
CHANGED
|
@@ -48,7 +48,7 @@ class InferenceOptimizationHolder(BaseModel):
|
|
|
48
48
|
|
|
49
49
|
class ProfilerRunner:
|
|
50
50
|
"""
|
|
51
|
-
A utility to run a series of prompts through an
|
|
51
|
+
A utility to run a series of prompts through an AIQ Toolkit workflow for profiling:
|
|
52
52
|
|
|
53
53
|
- can load prompts from a file
|
|
54
54
|
- or generate them via an LLM
|
|
@@ -42,10 +42,10 @@ class LocalRegistryHandler(AbstractRegistryHandler):
|
|
|
42
42
|
|
|
43
43
|
@asynccontextmanager
|
|
44
44
|
async def publish(self, artifact: AIQArtifact) -> AsyncGenerator[PublishResponse]:
|
|
45
|
-
"""Publishes an
|
|
45
|
+
"""Publishes an AIQ Toolkit artifact to a local registry.
|
|
46
46
|
|
|
47
47
|
Args:
|
|
48
|
-
artifact (AIQArtifact): An artifact that contain
|
|
48
|
+
artifact (AIQArtifact): An artifact that contain AIQ Toolkit plugin wheel and it's corrosponding discovery
|
|
49
49
|
metadata.
|
|
50
50
|
|
|
51
51
|
Yields:
|
|
@@ -62,10 +62,10 @@ class LocalRegistryHandler(AbstractRegistryHandler):
|
|
|
62
62
|
|
|
63
63
|
@asynccontextmanager
|
|
64
64
|
async def pull(self, packages: PullRequestPackages) -> AsyncGenerator[PullResponse]:
|
|
65
|
-
"""Download and install
|
|
65
|
+
"""Download and install AIQ Toolkit artifacts from a local registry.
|
|
66
66
|
|
|
67
67
|
Args:
|
|
68
|
-
packages (PullRequestPackages): Parameters used to pull the
|
|
68
|
+
packages (PullRequestPackages): Parameters used to pull the AIQ Toolkit artifact.
|
|
69
69
|
|
|
70
70
|
Yields:
|
|
71
71
|
Iterator[AsyncGenerator[PullResponse]]: A response message that includes a the pulled packages and a
|
|
@@ -83,7 +83,7 @@ class LocalRegistryHandler(AbstractRegistryHandler):
|
|
|
83
83
|
|
|
84
84
|
@asynccontextmanager
|
|
85
85
|
async def search(self, query: SearchQuery) -> AsyncGenerator[SearchResponse]:
|
|
86
|
-
"""Searches the local aiq registry for relevant
|
|
86
|
+
"""Searches the local aiq registry for relevant AIQ Toolkit components.
|
|
87
87
|
|
|
88
88
|
Args:
|
|
89
89
|
query (SearchQuery): Parameters of the search to be performed.
|
|
@@ -22,7 +22,7 @@ logger = logging.getLogger(__name__)
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
class LocalRegistryHandlerConfig(RegistryHandlerBaseConfig, name="local"):
|
|
25
|
-
"""Interact with the local
|
|
25
|
+
"""Interact with the local AIQ Toolkit environment to search and uninstall AIQ Toolkit components."""
|
|
26
26
|
|
|
27
27
|
pass
|
|
28
28
|
|
|
@@ -132,7 +132,7 @@ def build_wheel(package_root: str) -> WheelData:
|
|
|
132
132
|
|
|
133
133
|
|
|
134
134
|
def build_package_metadata(wheel_data: WheelData | None) -> dict[AIQComponentEnum, list[dict | DiscoveryMetadata]]:
|
|
135
|
-
"""Loads discovery metadata for all registered
|
|
135
|
+
"""Loads discovery metadata for all registered AIQ Toolkit components included in this Python package.
|
|
136
136
|
|
|
137
137
|
Args:
|
|
138
138
|
wheel_data (WheelData): Data model containing a built python wheel and its corresponding metadata.
|
|
@@ -180,7 +180,7 @@ def build_package_metadata(wheel_data: WheelData | None) -> dict[AIQComponentEnu
|
|
|
180
180
|
|
|
181
181
|
|
|
182
182
|
def build_aiq_artifact(package_root: str) -> AIQArtifact:
|
|
183
|
-
"""Builds a complete
|
|
183
|
+
"""Builds a complete AIQ Toolkit Artifact that can be published for discovery and reuse.
|
|
184
184
|
|
|
185
185
|
Args:
|
|
186
186
|
package_root (str): Path to root of python package
|
|
@@ -60,10 +60,10 @@ class PypiRegistryHandler(AbstractRegistryHandler):
|
|
|
60
60
|
|
|
61
61
|
@asynccontextmanager
|
|
62
62
|
async def publish(self, artifact: AIQArtifact) -> AsyncGenerator[PublishResponse]:
|
|
63
|
-
"""Publishes an
|
|
63
|
+
"""Publishes an AIQ Toolkit artifact to a PyPI remote registry.
|
|
64
64
|
|
|
65
65
|
Args:
|
|
66
|
-
artifact (AIQArtifact): An artifact that contain
|
|
66
|
+
artifact (AIQArtifact): An artifact that contain AIQ Toolkit plugin wheel and it's corrosponding discovery
|
|
67
67
|
metadata.
|
|
68
68
|
|
|
69
69
|
Yields:
|
|
@@ -101,10 +101,10 @@ class PypiRegistryHandler(AbstractRegistryHandler):
|
|
|
101
101
|
|
|
102
102
|
@asynccontextmanager
|
|
103
103
|
async def pull(self, packages: PullRequestPackages) -> AsyncGenerator[PullResponse]:
|
|
104
|
-
"""Download and install
|
|
104
|
+
"""Download and install AIQ Toolkit artifacts from a remote PyPI remote registry.
|
|
105
105
|
|
|
106
106
|
Args:
|
|
107
|
-
packages (PullRequestPackages): Parameters used to pull the
|
|
107
|
+
packages (PullRequestPackages): Parameters used to pull the AIQ Toolkit artifact.
|
|
108
108
|
|
|
109
109
|
Yields:
|
|
110
110
|
Iterator[AsyncGenerator[PullResponse, None]]: A response message that includes a the pulled packages and a
|
|
@@ -160,7 +160,7 @@ class PypiRegistryHandler(AbstractRegistryHandler):
|
|
|
160
160
|
|
|
161
161
|
@asynccontextmanager
|
|
162
162
|
async def search(self, query: SearchQuery) -> AsyncGenerator[SearchResponse]:
|
|
163
|
-
"""Searches a remote PyPI registry for relevant
|
|
163
|
+
"""Searches a remote PyPI registry for relevant AIQ Toolkit components.
|
|
164
164
|
|
|
165
165
|
Args:
|
|
166
166
|
query (SearchQuery): Parameters of the search to be performed.
|
|
@@ -25,9 +25,9 @@ class PypiRegistryHandlerConfig(RegistryHandlerBaseConfig, name="pypi"):
|
|
|
25
25
|
endpoint: str = Field(description="A string representing the remote endpoint.")
|
|
26
26
|
token: str | None = Field(default=None,
|
|
27
27
|
description="The authentication token to use when interacting with the registry.")
|
|
28
|
-
publish_route: str = Field(description="The route to the
|
|
29
|
-
pull_route: str = Field(description="The route to the
|
|
30
|
-
search_route: str = Field(default="simple", description="The route to the
|
|
28
|
+
publish_route: str = Field(description="The route to the AIQ Toolkit publish service.")
|
|
29
|
+
pull_route: str = Field(description="The route to the AIQ Toolkit pull service.")
|
|
30
|
+
search_route: str = Field(default="simple", description="The route to the AIQ Toolkit search service.")
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
@register_registry_handler(config_type=PypiRegistryHandlerConfig)
|
|
@@ -33,7 +33,7 @@ from aiq.registry_handlers.schemas.search import VisualizeFields
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
class AbstractRegistryHandler(ABC):
|
|
36
|
-
"""Base class outlining the interfaces for remote
|
|
36
|
+
"""Base class outlining the interfaces for remote AIQ Toolkit registry interactions."""
|
|
37
37
|
|
|
38
38
|
def __init__(self):
|
|
39
39
|
self._discovery_metadata: dict[AIQComponentEnum, list[dict | DiscoveryMetadata]] = {}
|
|
@@ -45,10 +45,10 @@ class AbstractRegistryHandler(ABC):
|
|
|
45
45
|
@abstractmethod
|
|
46
46
|
@asynccontextmanager
|
|
47
47
|
async def publish(self, artifact: AIQArtifact) -> AsyncGenerator[PublishResponse]:
|
|
48
|
-
"""Publishes an
|
|
48
|
+
"""Publishes an AIQ Toolkit artifact to a remote registry.
|
|
49
49
|
|
|
50
50
|
Args:
|
|
51
|
-
artifact (AIQArtifact): An artifact that contain
|
|
51
|
+
artifact (AIQArtifact): An artifact that contain AIQ Toolkit plugin wheel and it's corrosponding discovery
|
|
52
52
|
metadata.
|
|
53
53
|
|
|
54
54
|
Yields:
|
|
@@ -61,10 +61,10 @@ class AbstractRegistryHandler(ABC):
|
|
|
61
61
|
@abstractmethod
|
|
62
62
|
@asynccontextmanager
|
|
63
63
|
async def pull(self, packages: PullRequestPackages) -> AsyncGenerator[PullResponse]:
|
|
64
|
-
"""Download and install
|
|
64
|
+
"""Download and install AIQ Toolkit artifacts from a remote registry.
|
|
65
65
|
|
|
66
66
|
Args:
|
|
67
|
-
packages (PullRequestPackages): Parameters used to pull the
|
|
67
|
+
packages (PullRequestPackages): Parameters used to pull the AIQ Toolkit artifact.
|
|
68
68
|
|
|
69
69
|
Yields:
|
|
70
70
|
Iterator[AsyncGenerator[PullResponse]]: A response message that includes a the pulled packages and a
|
|
@@ -76,7 +76,7 @@ class AbstractRegistryHandler(ABC):
|
|
|
76
76
|
@abstractmethod
|
|
77
77
|
@asynccontextmanager
|
|
78
78
|
async def search(self, query: SearchQuery) -> AsyncGenerator[SearchResponse]:
|
|
79
|
-
"""Searches the local aiq registry for relevant
|
|
79
|
+
"""Searches the local aiq registry for relevant AIQ Toolkit components.
|
|
80
80
|
|
|
81
81
|
Args:
|
|
82
82
|
query (SearchQuery): Parameters of the search to be performed.
|
|
@@ -118,7 +118,7 @@ class AbstractRegistryHandler(ABC):
|
|
|
118
118
|
from rich.table import Table
|
|
119
119
|
from rich.text import Text
|
|
120
120
|
|
|
121
|
-
table = Table(title="
|
|
121
|
+
table = Table(title="AIQ Toolkit Search Results", padding=(0, 1), show_lines=True)
|
|
122
122
|
for column in VisualizeFields:
|
|
123
123
|
table.add_column(column.value)
|
|
124
124
|
|
|
@@ -27,10 +27,10 @@ class RestRegistryHandlerConfig(RegistryHandlerBaseConfig, name="rest"):
|
|
|
27
27
|
endpoint: str = Field(description="A string representing the remote endpoint.")
|
|
28
28
|
token: str | None = Field(default=None,
|
|
29
29
|
description="The authentication token to use when interacting with the registry.")
|
|
30
|
-
publish_route: str = Field(default="", description="The route to the
|
|
31
|
-
pull_route: str = Field(default="", description="The route to the
|
|
32
|
-
search_route: str = Field(default="", description="The route to the
|
|
33
|
-
remove_route: str = Field(default="", description="The route to the
|
|
30
|
+
publish_route: str = Field(default="", description="The route to the AIQ Toolkit publish service.")
|
|
31
|
+
pull_route: str = Field(default="", description="The route to the AIQ Toolkit pull service.")
|
|
32
|
+
search_route: str = Field(default="", description="The route to the AIQ Toolkit search service")
|
|
33
|
+
remove_route: str = Field(default="", description="The route to the AIQ Toolkit remove service")
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
@register_registry_handler(config_type=RestRegistryHandlerConfig)
|
|
@@ -62,10 +62,10 @@ class RestRegistryHandler(AbstractRegistryHandler):
|
|
|
62
62
|
|
|
63
63
|
@asynccontextmanager
|
|
64
64
|
async def publish(self, artifact: AIQArtifact) -> AsyncGenerator[PublishResponse]:
|
|
65
|
-
"""Publishes an
|
|
65
|
+
"""Publishes an AIQ Toolkit artifact to a remote REST registry.
|
|
66
66
|
|
|
67
67
|
Args:
|
|
68
|
-
artifact (AIQArtifact): An artifact that contain
|
|
68
|
+
artifact (AIQArtifact): An artifact that contain AIQ Toolkit plugin wheel and it's corrosponding discovery
|
|
69
69
|
metadata.
|
|
70
70
|
|
|
71
71
|
Yields:
|
|
@@ -98,10 +98,10 @@ class RestRegistryHandler(AbstractRegistryHandler):
|
|
|
98
98
|
|
|
99
99
|
@asynccontextmanager
|
|
100
100
|
async def pull(self, packages: PullRequestPackages) -> AsyncGenerator[PullResponse]:
|
|
101
|
-
"""Download and install
|
|
101
|
+
"""Download and install AIQ Toolkit artifacts from a remote REST registry.
|
|
102
102
|
|
|
103
103
|
Args:
|
|
104
|
-
packages (PullRequestPackages): Parameters used to pull the
|
|
104
|
+
packages (PullRequestPackages): Parameters used to pull the AIQ Toolkit artifact.
|
|
105
105
|
|
|
106
106
|
Yields:
|
|
107
107
|
Iterator[AsyncGenerator[PullResponse]]: A response message that includes a the pulled packages and a
|
|
@@ -165,7 +165,7 @@ class RestRegistryHandler(AbstractRegistryHandler):
|
|
|
165
165
|
|
|
166
166
|
@asynccontextmanager
|
|
167
167
|
async def search(self, query: SearchQuery) -> AsyncGenerator[SearchResponse]:
|
|
168
|
-
"""Searches a remote REST registry for relevant
|
|
168
|
+
"""Searches a remote REST registry for relevant AIQ Toolkit components.
|
|
169
169
|
|
|
170
170
|
Args:
|
|
171
171
|
query (SearchQuery): Parameters of the search to be performed.
|
|
@@ -28,7 +28,7 @@ class WheelData(BaseModel):
|
|
|
28
28
|
package_name (str): The name of the python package.
|
|
29
29
|
toml_project (dict): A dictionary containing data about the python project.
|
|
30
30
|
toml_dependencies (set): The list of dependencies provided in the pyproject.toml file.
|
|
31
|
-
toml_aiq_packages (set): The
|
|
31
|
+
toml_aiq_packages (set): The AIQ Toolkit plugins listed in the pyproject.toml.
|
|
32
32
|
union_dependencies (set): The union of toml_dependencies and toml_aiq_packages.
|
|
33
33
|
whl_path (str): The path to the package wheel file.
|
|
34
34
|
whl_base64 (str): Base64 encoded string of the wheel file.
|
|
@@ -25,10 +25,10 @@ logger = logging.getLogger(__name__)
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
class BuiltAIQArtifact(BaseModel):
|
|
28
|
-
"""An
|
|
28
|
+
"""An AIQ Toolkit artifact including base64 encoded string of wheel package and corrosponding discovery metadata.
|
|
29
29
|
|
|
30
30
|
Args:
|
|
31
|
-
whl (str): A base64 encoded string of an
|
|
31
|
+
whl (str): A base64 encoded string of an AIQ Toolkit package wheel (.whl).
|
|
32
32
|
|
|
33
33
|
metadata (dict[AIQComponentEnum, list[DiscoveryMetadata]]): Provides rich discover metadata for developers to
|
|
34
34
|
quickly find useful components.
|
|
@@ -39,10 +39,10 @@ class BuiltAIQArtifact(BaseModel):
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
class AIQArtifact(BaseModel):
|
|
42
|
-
"""An
|
|
42
|
+
"""An AIQ Toolkit artifact including base64 encoded string of wheel package and corrosponding discovery metadata.
|
|
43
43
|
|
|
44
44
|
Args:
|
|
45
|
-
artifact (BuildAIQArtifact): An
|
|
45
|
+
artifact (BuildAIQArtifact): An AIQ Toolkit artifact including base64 encoded string of wheel package and
|
|
46
46
|
corrosponding discovery metadata.
|
|
47
47
|
|
|
48
48
|
whl_path (str): A local path to the built wheel package.
|
|
@@ -27,7 +27,7 @@ class PulledPackage(BaseModel):
|
|
|
27
27
|
"""Represents a data model of a pulled package containing the package wheel and its name.
|
|
28
28
|
|
|
29
29
|
Args:
|
|
30
|
-
whl (str): Base64 encoded string of the
|
|
30
|
+
whl (str): Base64 encoded string of the AIQ Toolkit python package wheel (.whl).
|
|
31
31
|
whl_name (str): A string representing the wheel filename.
|
|
32
32
|
"""
|
|
33
33
|
|
|
@@ -37,7 +37,8 @@ class PulledPackage(BaseModel):
|
|
|
37
37
|
|
|
38
38
|
class PullResponse(BaseModel):
|
|
39
39
|
"""
|
|
40
|
-
Represents a data model of the expected respones from a
|
|
40
|
+
Represents a data model of the expected respones from a AIQ Toolkit pull request, including detailed status
|
|
41
|
+
information.
|
|
41
42
|
|
|
42
43
|
Args:
|
|
43
44
|
packages (list[PulledPackage]): A list of pulled packages included in the pull request.
|
|
@@ -71,11 +72,11 @@ class PullRequestPackage(BaseModel):
|
|
|
71
72
|
|
|
72
73
|
|
|
73
74
|
class PullRequestPackages(BaseModel):
|
|
74
|
-
"""Represents a list of all packages th download and install in the local
|
|
75
|
+
"""Represents a list of all packages th download and install in the local AIQ Toolkit environment.
|
|
75
76
|
|
|
76
77
|
Args:
|
|
77
78
|
packages (list[typing.Union[PackageNameVersion, PullPackageWhl]]): A list of packages that can be
|
|
78
|
-
downloaded and installed in the local
|
|
79
|
+
downloaded and installed in the local AIQ Toolkit environment.
|
|
79
80
|
"""
|
|
80
81
|
|
|
81
82
|
packages: list[PackageNameVersion | PullPackageWhl]
|