aiqtoolkit 1.1.0a20250429__py3-none-any.whl → 1.1.0a20250502__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 +73 -57
- 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 +157 -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.0a20250502.dist-info}/METADATA +24 -21
- {aiqtoolkit-1.1.0a20250429.dist-info → aiqtoolkit-1.1.0a20250502.dist-info}/RECORD +74 -71
- {aiqtoolkit-1.1.0a20250429.dist-info → aiqtoolkit-1.1.0a20250502.dist-info}/WHEEL +1 -1
- {aiqtoolkit-1.1.0a20250429.dist-info → aiqtoolkit-1.1.0a20250502.dist-info}/entry_points.txt +0 -0
- {aiqtoolkit-1.1.0a20250429.dist-info → aiqtoolkit-1.1.0a20250502.dist-info}/licenses/LICENSE-3rd-party.txt +0 -0
- {aiqtoolkit-1.1.0a20250429.dist-info → aiqtoolkit-1.1.0a20250502.dist-info}/licenses/LICENSE.md +0 -0
- {aiqtoolkit-1.1.0a20250429.dist-info → aiqtoolkit-1.1.0a20250502.dist-info}/top_level.txt +0 -0
|
@@ -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]
|
|
@@ -42,12 +42,12 @@ class VisualizeFields(str, Enum):
|
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
class SearchQuery(BaseModel):
|
|
45
|
-
"""Represents the search criteria that will be used to discover useful
|
|
45
|
+
"""Represents the search criteria that will be used to discover useful AIQ Toolkit components.
|
|
46
46
|
|
|
47
47
|
Args:
|
|
48
|
-
query (str): A query string used to find useful
|
|
48
|
+
query (str): A query string used to find useful AIQ Toolkit components.
|
|
49
49
|
fields (list[SearchFields]): The list of fields used when applying the query string.
|
|
50
|
-
component_types (list[AIQComponentEnum]):
|
|
50
|
+
component_types (list[AIQComponentEnum]): AIQ Toolkit components types to filter search results.
|
|
51
51
|
top_k (int): Specifies the number of search results to provide.
|
|
52
52
|
"""
|
|
53
53
|
|
|
@@ -61,10 +61,10 @@ class SearchResponseItem(BaseModel):
|
|
|
61
61
|
"""Represents an individual item in the search response, including elements of it's discovery metadata.
|
|
62
62
|
|
|
63
63
|
Args:
|
|
64
|
-
package (str): The name of the
|
|
65
|
-
version (str): The version of the
|
|
66
|
-
component_type (AIQComponentEnum): Type of
|
|
67
|
-
description (str): A description of this
|
|
64
|
+
package (str): The name of the AIQ Toolkit package that includes the component.
|
|
65
|
+
version (str): The version of the AIQ Toolkit package that includes the component.
|
|
66
|
+
component_type (AIQComponentEnum): Type of AIQ Toolkit component this item represents.
|
|
67
|
+
description (str): A description of this AIQ Toolkit component.
|
|
68
68
|
developer_notes (str): Additional details that would help a developer use this component.
|
|
69
69
|
"""
|
|
70
70
|
|
aiq/retriever/models.py
CHANGED
|
@@ -26,7 +26,7 @@ from aiq.utils.type_converter import GlobalTypeConverter
|
|
|
26
26
|
|
|
27
27
|
class AIQDocument(BaseModel):
|
|
28
28
|
"""
|
|
29
|
-
Object representing a retrieved document/chunk from a standard
|
|
29
|
+
Object representing a retrieved document/chunk from a standard AIQ Toolkit Retriever.
|
|
30
30
|
"""
|
|
31
31
|
page_content: str = Field(description="Primary content of the document to insert or retrieve")
|
|
32
32
|
metadata: dict[str, Any] = Field(description="Metadata dictionary attached to the AIQDocument")
|
aiq/runtime/loader.py
CHANGED
|
@@ -53,7 +53,7 @@ class PluginTypes(IntFlag):
|
|
|
53
53
|
# Convenience flag for groups of plugin types
|
|
54
54
|
CONFIG_OBJECT = COMPONENT | FRONT_END | EVALUATOR
|
|
55
55
|
"""
|
|
56
|
-
Any plugin that can be specified in the
|
|
56
|
+
Any plugin that can be specified in the AIQ Toolkit configuration file.
|
|
57
57
|
"""
|
|
58
58
|
ALL = COMPONENT | FRONT_END | EVALUATOR | REGISTRY_HANDLER
|
|
59
59
|
"""
|
|
@@ -63,8 +63,8 @@ class PluginTypes(IntFlag):
|
|
|
63
63
|
|
|
64
64
|
def load_config(config_file: StrPath) -> AIQConfig:
|
|
65
65
|
"""
|
|
66
|
-
This is the primary entry point for loading an
|
|
67
|
-
and then validates the configuration file against the AIQConfig schema.
|
|
66
|
+
This is the primary entry point for loading an AIQ Toolkit configuration file. It ensures that all plugins are
|
|
67
|
+
loaded and then validates the configuration file against the AIQConfig schema.
|
|
68
68
|
|
|
69
69
|
Parameters
|
|
70
70
|
----------
|
|
@@ -82,7 +82,7 @@ def load_config(config_file: StrPath) -> AIQConfig:
|
|
|
82
82
|
|
|
83
83
|
config_yaml = yaml_load(config_file)
|
|
84
84
|
|
|
85
|
-
# Validate configuration adheres to
|
|
85
|
+
# Validate configuration adheres to AIQ Toolkit schemas
|
|
86
86
|
validated_aiq_config = validate_schema(config_yaml, AIQConfig)
|
|
87
87
|
|
|
88
88
|
return validated_aiq_config
|
|
@@ -91,8 +91,8 @@ def load_config(config_file: StrPath) -> AIQConfig:
|
|
|
91
91
|
@asynccontextmanager
|
|
92
92
|
async def load_workflow(config_file: StrPath, max_concurrency: int = -1):
|
|
93
93
|
"""
|
|
94
|
-
Load the
|
|
95
|
-
|
|
94
|
+
Load the AIQ Toolkit configuration file and create an AIQRunner object. This is the primary entry point for running
|
|
95
|
+
AIQ Toolkit workflows.
|
|
96
96
|
|
|
97
97
|
Parameters
|
|
98
98
|
----------
|
aiq/tool/mcp/mcp_tool.py
CHANGED
|
@@ -29,7 +29,8 @@ logger = logging.getLogger(__name__)
|
|
|
29
29
|
|
|
30
30
|
class MCPToolConfig(FunctionBaseConfig, name="mcp_tool_wrapper"):
|
|
31
31
|
"""
|
|
32
|
-
Function which connects to a Model Context Protocol (MCP) server and wraps the selected tool as an
|
|
32
|
+
Function which connects to a Model Context Protocol (MCP) server and wraps the selected tool as an AIQ Toolkit
|
|
33
|
+
function.
|
|
33
34
|
"""
|
|
34
35
|
# Add your custom configuration parameters here
|
|
35
36
|
url: HttpUrl = Field(description="The URL of the MCP server")
|
|
@@ -44,7 +45,7 @@ class MCPToolConfig(FunctionBaseConfig, name="mcp_tool_wrapper"):
|
|
|
44
45
|
@register_function(config_type=MCPToolConfig)
|
|
45
46
|
async def mcp_tool(config: MCPToolConfig, builder: Builder):
|
|
46
47
|
"""
|
|
47
|
-
Generate an
|
|
48
|
+
Generate an AIQ Toolkit Function that wraps a tool provided by the MCP server.
|
|
48
49
|
"""
|
|
49
50
|
|
|
50
51
|
from aiq.tool.mcp.mcp_client import MCPBuilder
|
aiq/tool/retriever.py
CHANGED
|
@@ -58,7 +58,7 @@ def _get_description_from_config(config: AIQRetrieverConfig) -> str:
|
|
|
58
58
|
@register_function(config_type=AIQRetrieverConfig)
|
|
59
59
|
async def aiq_retriever_tool(config: AIQRetrieverConfig, builder: Builder):
|
|
60
60
|
"""
|
|
61
|
-
Configure an
|
|
61
|
+
Configure an AIQ Toolkit Retriever Tool which supports different clients such as Milvus and Nemo Retriever.
|
|
62
62
|
|
|
63
63
|
Args:
|
|
64
64
|
config: A config object with required parameters 'client' and 'client_config'
|
aiq/utils/io/yaml_tools.py
CHANGED
|
@@ -14,37 +14,106 @@
|
|
|
14
14
|
# limitations under the License.
|
|
15
15
|
|
|
16
16
|
import io
|
|
17
|
+
import logging
|
|
17
18
|
import typing
|
|
18
19
|
|
|
20
|
+
import expandvars
|
|
19
21
|
import yaml
|
|
20
22
|
|
|
21
23
|
from aiq.utils.type_utils import StrPath
|
|
22
24
|
|
|
25
|
+
logger = logging.getLogger(__name__)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def _interpolate_variables(value: str | int | float | bool | None) -> str | int | float | bool | None:
|
|
29
|
+
"""
|
|
30
|
+
Interpolate variables in a string with the format ${VAR:-default_value}.
|
|
31
|
+
If the variable is not set, the default value will be used.
|
|
32
|
+
If no default value is provided, an empty string will be used.
|
|
33
|
+
|
|
34
|
+
Args:
|
|
35
|
+
value (str | int | float | bool | None): The value to interpolate variables in.
|
|
36
|
+
|
|
37
|
+
Returns:
|
|
38
|
+
str | int | float | bool | None: The value with variables interpolated.
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
if not isinstance(value, str):
|
|
42
|
+
return value
|
|
43
|
+
|
|
44
|
+
return expandvars.expandvars(value)
|
|
45
|
+
|
|
23
46
|
|
|
24
47
|
def yaml_load(config_path: StrPath) -> dict:
|
|
48
|
+
"""
|
|
49
|
+
Load a YAML file and interpolate variables in the format
|
|
50
|
+
${VAR:-default_value}.
|
|
51
|
+
|
|
52
|
+
Args:
|
|
53
|
+
config_path (StrPath): The path to the YAML file to load.
|
|
54
|
+
|
|
55
|
+
Returns:
|
|
56
|
+
dict: The processed configuration dictionary.
|
|
57
|
+
"""
|
|
25
58
|
|
|
26
59
|
# Read YAML file
|
|
27
|
-
with open(config_path,
|
|
28
|
-
|
|
60
|
+
with open(config_path, "r", encoding="utf-8") as stream:
|
|
61
|
+
config_str = stream.read()
|
|
29
62
|
|
|
30
|
-
return
|
|
63
|
+
return yaml_loads(config_str)
|
|
31
64
|
|
|
32
65
|
|
|
33
66
|
def yaml_loads(config: str) -> dict:
|
|
67
|
+
"""
|
|
68
|
+
Load a YAML string and interpolate variables in the format
|
|
69
|
+
${VAR:-default_value}.
|
|
34
70
|
|
|
35
|
-
|
|
71
|
+
Args:
|
|
72
|
+
config (str): The YAML string to load.
|
|
73
|
+
|
|
74
|
+
Returns:
|
|
75
|
+
dict: The processed configuration dictionary.
|
|
76
|
+
"""
|
|
77
|
+
|
|
78
|
+
interpolated_config_str = _interpolate_variables(config)
|
|
79
|
+
assert isinstance(interpolated_config_str, str), "Config must be a string"
|
|
80
|
+
|
|
81
|
+
stream = io.StringIO(interpolated_config_str)
|
|
36
82
|
stream.seek(0)
|
|
37
83
|
|
|
38
|
-
|
|
84
|
+
# Load the YAML data
|
|
85
|
+
try:
|
|
86
|
+
config_data = yaml.safe_load(stream)
|
|
87
|
+
except yaml.YAMLError as e:
|
|
88
|
+
logger.error("Error loading YAML: %s", interpolated_config_str, exc_info=True)
|
|
89
|
+
raise ValueError(f"Error loading YAML: {e}") from e
|
|
90
|
+
|
|
91
|
+
assert isinstance(config_data, dict)
|
|
92
|
+
|
|
93
|
+
return config_data
|
|
39
94
|
|
|
40
95
|
|
|
41
96
|
def yaml_dump(config: dict, fp: typing.TextIO) -> None:
|
|
97
|
+
"""
|
|
98
|
+
Dump a configuration dictionary to a YAML file.
|
|
42
99
|
|
|
100
|
+
Args:
|
|
101
|
+
config (dict): The configuration dictionary to dump.
|
|
102
|
+
fp (typing.TextIO): The file pointer to write the YAML to.
|
|
103
|
+
"""
|
|
43
104
|
yaml.dump(config, stream=fp, indent=2, sort_keys=False)
|
|
44
|
-
|
|
45
105
|
fp.flush()
|
|
46
106
|
|
|
47
107
|
|
|
48
108
|
def yaml_dumps(config: dict) -> str:
|
|
109
|
+
"""
|
|
110
|
+
Dump a configuration dictionary to a YAML string.
|
|
111
|
+
|
|
112
|
+
Args:
|
|
113
|
+
config (dict): The configuration dictionary to dump.
|
|
114
|
+
|
|
115
|
+
Returns:
|
|
116
|
+
str: The YAML string.
|
|
117
|
+
"""
|
|
49
118
|
|
|
50
119
|
return yaml.dump(config, indent=2)
|
|
@@ -66,7 +66,7 @@ def configure_registry_channel(config_type: RegistryHandlerBaseConfig, channel_n
|
|
|
66
66
|
|
|
67
67
|
|
|
68
68
|
def add_channel_interative(channel_type: str) -> None:
|
|
69
|
-
"""Add a remote registry channel to publish/search/pull
|
|
69
|
+
"""Add a remote registry channel to publish/search/pull AIQ Toolkit plugin packages.
|
|
70
70
|
|
|
71
71
|
Args:
|
|
72
72
|
channel_type (str): They type of channel to configure.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: aiqtoolkit
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.0a20250502
|
|
4
4
|
Summary: Agent Intelligence Toolkit (AIQ Toolkit)
|
|
5
5
|
Author: NVIDIA Corporation
|
|
6
6
|
Maintainer: NVIDIA Corporation
|
|
@@ -207,7 +207,7 @@ License: Apache License
|
|
|
207
207
|
limitations under the License.
|
|
208
208
|
Keywords: ai,rag,agents
|
|
209
209
|
Classifier: Programming Language :: Python
|
|
210
|
-
Requires-Python:
|
|
210
|
+
Requires-Python: <3.13,>=3.11
|
|
211
211
|
Description-Content-Type: text/markdown
|
|
212
212
|
License-File: LICENSE-3rd-party.txt
|
|
213
213
|
License-File: LICENSE.md
|
|
@@ -215,6 +215,7 @@ Requires-Dist: aioboto3>=11.0.0
|
|
|
215
215
|
Requires-Dist: arize-phoenix~=6.1
|
|
216
216
|
Requires-Dist: click~=8.1
|
|
217
217
|
Requires-Dist: colorama~=0.4.6
|
|
218
|
+
Requires-Dist: expandvars~=1.0
|
|
218
219
|
Requires-Dist: fastapi~=0.115.5
|
|
219
220
|
Requires-Dist: httpx~=0.27
|
|
220
221
|
Requires-Dist: jinja2~=3.1
|
|
@@ -228,7 +229,7 @@ Requires-Dist: opentelemetry-api~=1.2
|
|
|
228
229
|
Requires-Dist: opentelemetry-sdk~=1.3
|
|
229
230
|
Requires-Dist: pkginfo~=1.12
|
|
230
231
|
Requires-Dist: platformdirs~=4.3
|
|
231
|
-
Requires-Dist: pydantic
|
|
232
|
+
Requires-Dist: pydantic==2.10.*
|
|
232
233
|
Requires-Dist: pymilvus~=2.4
|
|
233
234
|
Requires-Dist: PyYAML~=6.0
|
|
234
235
|
Requires-Dist: ragas~=0.2.14
|
|
@@ -249,6 +250,8 @@ Provides-Extra: zep-cloud
|
|
|
249
250
|
Requires-Dist: aiqtoolkit-zep-cloud; extra == "zep-cloud"
|
|
250
251
|
Provides-Extra: agno
|
|
251
252
|
Requires-Dist: aiqtoolkit-agno; extra == "agno"
|
|
253
|
+
Provides-Extra: weave
|
|
254
|
+
Requires-Dist: aiqtoolkit-weave; extra == "weave"
|
|
252
255
|
Provides-Extra: examples
|
|
253
256
|
Requires-Dist: aiq_email_phishing_analyzer; extra == "examples"
|
|
254
257
|
Requires-Dist: aiq_multi_frameworks; extra == "examples"
|
|
@@ -273,7 +276,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
273
276
|
you may not use this file except in compliance with the License.
|
|
274
277
|
You may obtain a copy of the License at
|
|
275
278
|
|
|
276
|
-
http
|
|
279
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
277
280
|
|
|
278
281
|
Unless required by applicable law or agreed to in writing, software
|
|
279
282
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
@@ -282,39 +285,39 @@ See the License for the specific language governing permissions and
|
|
|
282
285
|
limitations under the License.
|
|
283
286
|
-->
|
|
284
287
|
|
|
285
|
-

|
|
286
289
|
|
|
287
|
-
# NVIDIA
|
|
290
|
+
# NVIDIA Agent Intelligence Toolkit
|
|
288
291
|
|
|
289
|
-
|
|
292
|
+
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.
|
|
290
293
|
|
|
291
294
|
## Key Features
|
|
292
295
|
|
|
293
|
-
- [**Framework Agnostic:**](https://docs.nvidia.com/
|
|
294
|
-
- [**Reusability:**](https://docs.nvidia.com/
|
|
295
|
-
- [**Rapid Development:**](https://docs.nvidia.com/
|
|
296
|
-
- [**Profiling:**](https://docs.nvidia.com/
|
|
297
|
-
- [**Observability:**](https://docs.nvidia.com/
|
|
298
|
-
- [**Evaluation System:**](https://docs.nvidia.com/
|
|
299
|
-
- [**User Interface:**](https://docs.nvidia.com/
|
|
300
|
-
- [**MCP Compatibility**](https://docs.nvidia.com/
|
|
296
|
+
- [**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.
|
|
297
|
+
- [**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.
|
|
298
|
+
- [**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.
|
|
299
|
+
- [**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.
|
|
300
|
+
- [**Observability:**](https://docs.nvidia.com/aiqtoolkit/latest/guides/observe-workflow-with-phoenix.html) Monitor and debug your workflows with any OpenTelemetry-compatible observability tool.
|
|
301
|
+
- [**Evaluation System:**](https://docs.nvidia.com/aiqtoolkit/latest/guides/evaluate.html) Validate and maintain accuracy of agentic workflows with built-in evaluation tools.
|
|
302
|
+
- [**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.
|
|
303
|
+
- [**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.
|
|
301
304
|
|
|
302
|
-
With
|
|
305
|
+
With AIQ Toolkit, you can move quickly, experiment freely, and ensure reliability across all your agent-driven projects.
|
|
303
306
|
|
|
304
307
|
## Links
|
|
305
|
-
* [Documentation](https://docs.nvidia.com/
|
|
306
|
-
* [About
|
|
308
|
+
* [Documentation](https://docs.nvidia.com/aiqtoolkit/latest/index.html): Explore the full documentation for AIQ Toolkit.
|
|
309
|
+
* [About AIQ Toolkit](https://docs.nvidia.com/aiqtoolkit/latest/intro/why-aiqtoolkit.html): Learn more about the benefits of using AIQ Toolkit.
|
|
307
310
|
|
|
308
311
|
## First time user?
|
|
309
|
-
If this is your first time using
|
|
312
|
+
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.
|
|
310
313
|
|
|
311
314
|
## Feedback
|
|
312
315
|
|
|
313
|
-
We would love to hear from you! Please file an issue on [GitHub](https://github.com/NVIDIA/
|
|
316
|
+
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.
|
|
314
317
|
|
|
315
318
|
## Acknowledgements
|
|
316
319
|
|
|
317
|
-
We would like to thank the following open source projects that made
|
|
320
|
+
We would like to thank the following open source projects that made AIQ Toolkit possible:
|
|
318
321
|
|
|
319
322
|
- [CrewAI](https://github.com/crewAIInc/crewAI)
|
|
320
323
|
- [FastAPI](https://github.com/tiangolo/fastapi)
|