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
|
@@ -34,8 +34,8 @@ logger = logging.getLogger(__name__)
|
|
|
34
34
|
|
|
35
35
|
class ReActAgentWorkflowConfig(FunctionBaseConfig, name="react_agent"):
|
|
36
36
|
"""
|
|
37
|
-
Defines an
|
|
38
|
-
names and descriptions to select the optimal tool.
|
|
37
|
+
Defines an AIQ Toolkit function that uses a ReAct Agent performs reasoning inbetween tool calls, and utilizes the
|
|
38
|
+
tool names and descriptions to select the optimal tool.
|
|
39
39
|
"""
|
|
40
40
|
|
|
41
41
|
tool_names: list[FunctionRef] = Field(default_factory=list,
|
|
@@ -34,7 +34,7 @@ logger = logging.getLogger(__name__)
|
|
|
34
34
|
|
|
35
35
|
class ReasoningFunctionConfig(FunctionBaseConfig, name="reasoning_agent"):
|
|
36
36
|
"""
|
|
37
|
-
Defines an
|
|
37
|
+
Defines an AIQ Toolkit function that performs reasoning on the input data.
|
|
38
38
|
Output is passed to the next function in the workflow.
|
|
39
39
|
|
|
40
40
|
Designed to be used with an InterceptingFunction.
|
|
@@ -33,8 +33,8 @@ logger = logging.getLogger(__name__)
|
|
|
33
33
|
|
|
34
34
|
class ReWOOAgentWorkflowConfig(FunctionBaseConfig, name="rewoo_agent"):
|
|
35
35
|
"""
|
|
36
|
-
Defines an
|
|
37
|
-
names and descriptions to select the optimal tool.
|
|
36
|
+
Defines an AIQ Toolkit function that uses a ReWOO Agent performs reasoning inbetween tool calls, and utilizes the
|
|
37
|
+
tool names and descriptions to select the optimal tool.
|
|
38
38
|
"""
|
|
39
39
|
|
|
40
40
|
tool_names: list[FunctionRef] = Field(default_factory=list,
|
aiq/builder/component_utils.py
CHANGED
|
@@ -50,7 +50,7 @@ class ComponentInstanceData(BaseModel):
|
|
|
50
50
|
"""A data model to hold component runtime instance metadata to support generating build sequences.
|
|
51
51
|
|
|
52
52
|
Args:
|
|
53
|
-
component_group (ComponentGroup): The component group in an
|
|
53
|
+
component_group (ComponentGroup): The component group in an AIQ Toolkit configuration object.
|
|
54
54
|
name (ComponentRef): The name of the component runtime instance.
|
|
55
55
|
config (TypedBaseModel): The runtime instance's configuration object.
|
|
56
56
|
instance_id (str): Unique identifier for each runtime instance.
|
|
@@ -154,7 +154,7 @@ def update_dependency_graph(config: "AIQConfig", instance_config: TypedBaseModel
|
|
|
154
154
|
"""Updates the hierarchical component instance dependency graph from a configuration runtime instance.
|
|
155
155
|
|
|
156
156
|
Args:
|
|
157
|
-
config (AIQConfig): An
|
|
157
|
+
config (AIQConfig): An AIQ Toolkit configuration object with runtime instance details.
|
|
158
158
|
instance_config (TypedBaseModel): A component's runtime instance configuration object.
|
|
159
159
|
dependency_graph (nx.DiGraph): A graph tracking runtime instance component dependencies.
|
|
160
160
|
|
|
@@ -184,7 +184,7 @@ def config_to_dependency_objects(config: "AIQConfig") -> tuple[dict[str, Compone
|
|
|
184
184
|
"""Generates a map of component runtime instance IDs to use when generating a build sequence.
|
|
185
185
|
|
|
186
186
|
Args:
|
|
187
|
-
config (AIQConfig): The
|
|
187
|
+
config (AIQConfig): The AIQ Toolkit workflow configuration object.
|
|
188
188
|
|
|
189
189
|
Returns:
|
|
190
190
|
tuple[dict[str, ComponentInstanceData], nx.DiGraph]: A tuple containing a map of component runtime instance
|
|
@@ -232,10 +232,10 @@ def config_to_dependency_objects(config: "AIQConfig") -> tuple[dict[str, Compone
|
|
|
232
232
|
|
|
233
233
|
|
|
234
234
|
def build_dependency_sequence(config: "AIQConfig") -> list[ComponentInstanceData]:
|
|
235
|
-
"""Generates the depencency sequence from an
|
|
235
|
+
"""Generates the depencency sequence from an AIQ Toolkit configuration object
|
|
236
236
|
|
|
237
237
|
Args:
|
|
238
|
-
config (AIQConfig): An
|
|
238
|
+
config (AIQConfig): An AIQ Toolkit configuration object.
|
|
239
239
|
|
|
240
240
|
Returns:
|
|
241
241
|
list[ComponentInstanceData]: A list representing the instatiation sequence to ensure all valid
|
aiq/builder/front_end.py
CHANGED
|
@@ -27,7 +27,7 @@ class FrontEndBase(typing.Generic[FrontEndConfigT], ABC):
|
|
|
27
27
|
|
|
28
28
|
def __init__(self, full_config: "AIQConfig"):
|
|
29
29
|
"""
|
|
30
|
-
Initializes the FrontEndBase object with the specified
|
|
30
|
+
Initializes the FrontEndBase object with the specified AIQ Toolkit configuration.
|
|
31
31
|
|
|
32
32
|
Parameters
|
|
33
33
|
----------
|
|
@@ -43,7 +43,7 @@ class FrontEndBase(typing.Generic[FrontEndConfigT], ABC):
|
|
|
43
43
|
@property
|
|
44
44
|
def front_end_config(self) -> FrontEndConfigT:
|
|
45
45
|
"""
|
|
46
|
-
Returns the front end configuration object extracted from the
|
|
46
|
+
Returns the front end configuration object extracted from the AIQ Toolkit configuration.
|
|
47
47
|
|
|
48
48
|
Returns
|
|
49
49
|
-------
|
|
@@ -55,12 +55,12 @@ class FrontEndBase(typing.Generic[FrontEndConfigT], ABC):
|
|
|
55
55
|
@property
|
|
56
56
|
def full_config(self) -> "AIQConfig":
|
|
57
57
|
"""
|
|
58
|
-
Returns the full
|
|
58
|
+
Returns the full AIQ Toolkit configuration object.
|
|
59
59
|
|
|
60
60
|
Returns
|
|
61
61
|
-------
|
|
62
62
|
AIQConfig
|
|
63
|
-
The full
|
|
63
|
+
The full AIQ Toolkit configuration object.
|
|
64
64
|
"""
|
|
65
65
|
|
|
66
66
|
return self._full_config
|
aiq/builder/function_base.py
CHANGED
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
# See the License for the specific language governing permissions and
|
|
14
14
|
# limitations under the License.
|
|
15
|
-
"""Base class for
|
|
15
|
+
"""Base class for AIQ Toolkit functions providing type handling and schema management.
|
|
16
16
|
|
|
17
17
|
This module contains the FunctionBase abstract base class which provides core functionality
|
|
18
|
-
for
|
|
18
|
+
for AIQ Toolkit functions including type handling via generics, schema management for inputs and outputs,
|
|
19
19
|
and type conversion capabilities.
|
|
20
20
|
"""
|
|
21
21
|
|
|
@@ -40,7 +40,7 @@ logger = logging.getLogger(__name__)
|
|
|
40
40
|
|
|
41
41
|
class FunctionBase(typing.Generic[InputT, StreamingOutputT, SingleOutputT], ABC):
|
|
42
42
|
"""
|
|
43
|
-
Abstract base class providing core functionality for
|
|
43
|
+
Abstract base class providing core functionality for AIQ Toolkit functions.
|
|
44
44
|
|
|
45
45
|
This class provides type handling via generics, schema management for inputs and outputs,
|
|
46
46
|
and type conversion capabilities.
|
|
@@ -56,7 +56,7 @@ class FunctionBase(typing.Generic[InputT, StreamingOutputT, SingleOutputT], ABC)
|
|
|
56
56
|
|
|
57
57
|
Notes
|
|
58
58
|
-----
|
|
59
|
-
FunctionBase is the foundation of the
|
|
59
|
+
FunctionBase is the foundation of the AIQ Toolkit function system, providing:
|
|
60
60
|
- Type handling via generics
|
|
61
61
|
- Schema management for inputs and outputs
|
|
62
62
|
- Type conversion capabilities
|
aiq/builder/function_info.py
CHANGED
|
@@ -574,7 +574,7 @@ class FunctionInfo:
|
|
|
574
574
|
Returns
|
|
575
575
|
-------
|
|
576
576
|
FunctionInfo
|
|
577
|
-
The created FunctionInfo object which can be used to create a Generic
|
|
577
|
+
The created FunctionInfo object which can be used to create a Generic AIQ Toolkit function.
|
|
578
578
|
|
|
579
579
|
"""
|
|
580
580
|
|
|
@@ -43,7 +43,7 @@ class OpenStep:
|
|
|
43
43
|
|
|
44
44
|
class IntermediateStepManager:
|
|
45
45
|
"""
|
|
46
|
-
Manages updates to the
|
|
46
|
+
Manages updates to the AIQ Toolkit Event Stream for intermediate steps
|
|
47
47
|
"""
|
|
48
48
|
|
|
49
49
|
def __init__(self, context_state: "AIQContextState"): # noqa: F821
|
|
@@ -53,7 +53,7 @@ class IntermediateStepManager:
|
|
|
53
53
|
|
|
54
54
|
def push_intermediate_step(self, payload: IntermediateStepPayload) -> None:
|
|
55
55
|
"""
|
|
56
|
-
Pushes an intermediate step to the
|
|
56
|
+
Pushes an intermediate step to the AIQ Toolkit Event Stream
|
|
57
57
|
"""
|
|
58
58
|
|
|
59
59
|
if not isinstance(payload, IntermediateStepPayload):
|
|
@@ -81,13 +81,15 @@ class IntermediateStepManager:
|
|
|
81
81
|
logger.warning("Step id %s not found in outstanding start steps", payload.UUID)
|
|
82
82
|
return
|
|
83
83
|
|
|
84
|
-
#
|
|
85
|
-
if
|
|
86
|
-
_current_open_step_id.
|
|
87
|
-
|
|
84
|
+
# Restore the parent step ID directly instead of using a cross‑context token.
|
|
85
|
+
if parent_step_id == payload.UUID:
|
|
86
|
+
_current_open_step_id.set(open_step.step_parent_id)
|
|
88
87
|
else:
|
|
89
|
-
#
|
|
88
|
+
# Different context (e.g. thread‑pool); safely restore the parent ID **without**
|
|
89
|
+
# trying to use a token that belongs to another Context.
|
|
90
|
+
_current_open_step_id.set(open_step.step_parent_id)
|
|
90
91
|
parent_step_id = open_step.step_parent_id
|
|
92
|
+
|
|
91
93
|
elif (payload.event_state == IntermediateStepState.CHUNK):
|
|
92
94
|
|
|
93
95
|
# Get the current step from the outstanding steps
|
|
@@ -119,7 +121,7 @@ class IntermediateStepManager:
|
|
|
119
121
|
on_error: OnError = None,
|
|
120
122
|
on_complete: OnComplete = None) -> Subscription:
|
|
121
123
|
"""
|
|
122
|
-
Subscribes to the
|
|
124
|
+
Subscribes to the AIQ Toolkit Event Stream for intermediate steps
|
|
123
125
|
"""
|
|
124
126
|
|
|
125
127
|
return self._context_state.event_stream.get().subscribe(on_next, on_error, on_complete)
|
aiq/builder/workflow_builder.py
CHANGED
|
@@ -153,7 +153,7 @@ class WorkflowBuilder(Builder, AbstractAsyncContextManager):
|
|
|
153
153
|
# Store them in a dict so we can un-register them if needed
|
|
154
154
|
self._logging_handlers[key] = handler
|
|
155
155
|
|
|
156
|
-
# Now attach to
|
|
156
|
+
# Now attach to AIQ Toolkit's root logger
|
|
157
157
|
logging.getLogger().addHandler(handler)
|
|
158
158
|
|
|
159
159
|
provider = TracerProvider()
|
aiq/cli/cli_utils/validation.py
CHANGED
|
@@ -26,7 +26,7 @@ def validate_config(config_file: Path) -> AIQConfig:
|
|
|
26
26
|
try:
|
|
27
27
|
from aiq.runtime.loader import load_config
|
|
28
28
|
|
|
29
|
-
# Load using the
|
|
29
|
+
# Load using the AIQ Toolkit loader functions. This performs validation
|
|
30
30
|
config = load_config(config_file)
|
|
31
31
|
|
|
32
32
|
return config
|
|
@@ -20,7 +20,7 @@ import click
|
|
|
20
20
|
logger = logging.getLogger(__name__)
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
@click.group(name=__name__, invoke_without_command=True, help="Utility to add an
|
|
23
|
+
@click.group(name=__name__, invoke_without_command=True, help="Utility to add an AIQ Toolkit remote registry channel.")
|
|
24
24
|
@click.argument("channel_type", type=str)
|
|
25
25
|
def add(channel_type: str) -> None:
|
|
26
26
|
from aiq.utils.settings.global_settings import add_channel_interative
|
|
@@ -24,7 +24,9 @@ from aiq.cli.commands.configure.channel.update import update
|
|
|
24
24
|
logger = logging.getLogger(__name__)
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
@click.group(name=__name__,
|
|
27
|
+
@click.group(name=__name__,
|
|
28
|
+
invoke_without_command=False,
|
|
29
|
+
help="Utility to configure AIQ Toolkit remote registry channels.")
|
|
28
30
|
def channel(**kwargs):
|
|
29
31
|
pass
|
|
30
32
|
|
|
@@ -22,7 +22,7 @@ logger = logging.getLogger(__name__)
|
|
|
22
22
|
|
|
23
23
|
@click.group(name=__name__,
|
|
24
24
|
invoke_without_command=True,
|
|
25
|
-
help="Utility to remove a configured
|
|
25
|
+
help="Utility to remove a configured AIQ Toolkit remote registry channel.")
|
|
26
26
|
@click.argument("channel", type=str)
|
|
27
27
|
def remove(channel: str):
|
|
28
28
|
from aiq.utils.settings.global_settings import remove_channel_interactive
|
|
@@ -22,7 +22,7 @@ logger = logging.getLogger(__name__)
|
|
|
22
22
|
|
|
23
23
|
@click.group(name="update",
|
|
24
24
|
invoke_without_command=True,
|
|
25
|
-
help="Utility to update an
|
|
25
|
+
help="Utility to update an AIQ Toolkit remote registry channel's settings.")
|
|
26
26
|
@click.argument("channel", type=str)
|
|
27
27
|
def update(channel):
|
|
28
28
|
from aiq.utils.settings.global_settings import update_channel_interactive
|
|
@@ -22,10 +22,10 @@ from aiq.cli.commands.configure.channel.channel import channel
|
|
|
22
22
|
logger = logging.getLogger(__name__)
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
@click.group(name=__name__, invoke_without_command=False, help="Configure
|
|
25
|
+
@click.group(name=__name__, invoke_without_command=False, help="Configure AIQ Toolkit developer preferences.")
|
|
26
26
|
def configure_command(**kwargs):
|
|
27
27
|
"""
|
|
28
|
-
Publish
|
|
28
|
+
Publish AIQ Toolkit artifacts with the specified configuration
|
|
29
29
|
"""
|
|
30
30
|
pass
|
|
31
31
|
|
aiq/cli/commands/info/info.py
CHANGED
|
@@ -25,10 +25,10 @@ logger = logging.getLogger(__name__)
|
|
|
25
25
|
|
|
26
26
|
@click.group(name=__name__,
|
|
27
27
|
invoke_without_command=False,
|
|
28
|
-
help="Provide information about the local
|
|
28
|
+
help="Provide information about the local AIQ Toolkit environment.")
|
|
29
29
|
def info_command(**kwargs):
|
|
30
30
|
"""
|
|
31
|
-
Provide information about the local
|
|
31
|
+
Provide information about the local AIQ Toolkit environment.
|
|
32
32
|
"""
|
|
33
33
|
pass
|
|
34
34
|
|
|
@@ -60,7 +60,7 @@ async def search_artifacts( # pylint: disable=R0917
|
|
|
60
60
|
registry_handler.save_search_results(search_response=search_response, save_path=save_path)
|
|
61
61
|
|
|
62
62
|
|
|
63
|
-
@click.group(name=__name__, invoke_without_command=True, help="List the locally registered
|
|
63
|
+
@click.group(name=__name__, invoke_without_command=True, help="List the locally registered AIQ Toolkit components.")
|
|
64
64
|
@click.option(
|
|
65
65
|
"-t",
|
|
66
66
|
"--types",
|
|
@@ -68,7 +68,7 @@ async def search_artifacts( # pylint: disable=R0917
|
|
|
68
68
|
multiple=True,
|
|
69
69
|
type=click.Choice([e.value for e in AIQComponentEnum], case_sensitive=False),
|
|
70
70
|
required=False,
|
|
71
|
-
help=("Filter the search by
|
|
71
|
+
help=("Filter the search by AIQ Toolkit component type."),
|
|
72
72
|
)
|
|
73
73
|
@click.option(
|
|
74
74
|
"-o",
|
|
@@ -47,7 +47,7 @@ async def publish_artifact(registry_handler_config: RegistryHandlerBaseConfig, p
|
|
|
47
47
|
|
|
48
48
|
@click.group(name=__name__,
|
|
49
49
|
invoke_without_command=True,
|
|
50
|
-
help=("Publish local
|
|
50
|
+
help=("Publish local AIQ Toolkit artifacts to a remote "
|
|
51
51
|
"registry from package repository."))
|
|
52
52
|
@click.option(
|
|
53
53
|
"--config_file",
|
|
@@ -61,12 +61,12 @@ async def publish_artifact(registry_handler_config: RegistryHandlerBaseConfig, p
|
|
|
61
61
|
"--channel",
|
|
62
62
|
type=str,
|
|
63
63
|
required=True,
|
|
64
|
-
help=("The remote registry channel to use when publishing the
|
|
64
|
+
help=("The remote registry channel to use when publishing the AIQ Toolkit artifact."),
|
|
65
65
|
)
|
|
66
66
|
@click.argument("package_root", type=str)
|
|
67
67
|
def publish(channel: str, config_file: str, package_root: str) -> None:
|
|
68
68
|
"""
|
|
69
|
-
Publish
|
|
69
|
+
Publish AIQ Toolkit artifacts with the specified configuration
|
|
70
70
|
"""
|
|
71
71
|
from aiq.settings.global_settings import GlobalSettings
|
|
72
72
|
|
|
@@ -74,7 +74,7 @@ async def pull_artifact(registry_handler_config: RegistryHandlerBaseConfig, pack
|
|
|
74
74
|
|
|
75
75
|
@click.group(name=__name__,
|
|
76
76
|
invoke_without_command=True,
|
|
77
|
-
help=("Pull
|
|
77
|
+
help=("Pull AIQ Toolkit artifacts from a remote registry "
|
|
78
78
|
"by package name."))
|
|
79
79
|
@click.option(
|
|
80
80
|
"--config_file",
|
|
@@ -88,12 +88,12 @@ async def pull_artifact(registry_handler_config: RegistryHandlerBaseConfig, pack
|
|
|
88
88
|
"--channel",
|
|
89
89
|
type=str,
|
|
90
90
|
required=True,
|
|
91
|
-
help=("The remote registry channel to use when pulling the
|
|
91
|
+
help=("The remote registry channel to use when pulling the AIQ Toolkit artifact."),
|
|
92
92
|
)
|
|
93
93
|
@click.argument("packages", type=str)
|
|
94
94
|
def pull(channel: str, config_file: str, packages: str) -> None:
|
|
95
95
|
"""
|
|
96
|
-
Pull
|
|
96
|
+
Pull AIQ Toolkit artifacts from a remote registry channel.
|
|
97
97
|
"""
|
|
98
98
|
|
|
99
99
|
from aiq.settings.global_settings import GlobalSettings
|
|
@@ -25,7 +25,9 @@ from aiq.cli.commands.registry.search import search
|
|
|
25
25
|
logger = logging.getLogger(__name__)
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
@click.group(name=__name__,
|
|
28
|
+
@click.group(name=__name__,
|
|
29
|
+
invoke_without_command=False,
|
|
30
|
+
help="Utility to configure AIQ Toolkit remote registry channels.")
|
|
29
31
|
def registry_command(**kwargs):
|
|
30
32
|
pass
|
|
31
33
|
|
|
@@ -48,7 +48,7 @@ async def remove_artifact(registry_handler_config: RegistryHandlerBaseConfig, pa
|
|
|
48
48
|
|
|
49
49
|
@click.group(name=__name__,
|
|
50
50
|
invoke_without_command=True,
|
|
51
|
-
help=("Remove
|
|
51
|
+
help=("Remove AIQ Toolkit artifact from a remote registry by name and version."))
|
|
52
52
|
@click.argument("packages", type=str)
|
|
53
53
|
@click.option(
|
|
54
54
|
"--config_file",
|
|
@@ -62,11 +62,11 @@ async def remove_artifact(registry_handler_config: RegistryHandlerBaseConfig, pa
|
|
|
62
62
|
"--channel",
|
|
63
63
|
type=str,
|
|
64
64
|
required=True,
|
|
65
|
-
help=("The remote registry channel that will remove the
|
|
65
|
+
help=("The remote registry channel that will remove the AIQ Toolkit artifact."),
|
|
66
66
|
)
|
|
67
67
|
def remove(channel: str, config_file: str, packages: str) -> None:
|
|
68
68
|
"""
|
|
69
|
-
Remove
|
|
69
|
+
Remove AIQ Toolkit artifacts from a remote registry.
|
|
70
70
|
"""
|
|
71
71
|
|
|
72
72
|
from aiq.settings.global_settings import GlobalSettings
|
|
@@ -62,7 +62,7 @@ async def search_artifacts( # pylint: disable=R0917
|
|
|
62
62
|
registry_handler.save_search_results(search_response=search_response, save_path=save_path)
|
|
63
63
|
|
|
64
64
|
|
|
65
|
-
@click.group(name=__name__, invoke_without_command=True, help="Search for
|
|
65
|
+
@click.group(name=__name__, invoke_without_command=True, help="Search for AIQ Toolkit artifacts from remote registry.")
|
|
66
66
|
@click.option(
|
|
67
67
|
"--config_file",
|
|
68
68
|
type=click.Path(exists=True, file_okay=True, dir_okay=False, path_type=Path),
|
|
@@ -75,7 +75,7 @@ async def search_artifacts( # pylint: disable=R0917
|
|
|
75
75
|
"--channel",
|
|
76
76
|
type=str,
|
|
77
77
|
required=True,
|
|
78
|
-
help=("The remote registry channel to use when pulling the
|
|
78
|
+
help=("The remote registry channel to use when pulling the AIQ Toolkit artifact."),
|
|
79
79
|
)
|
|
80
80
|
@click.option(
|
|
81
81
|
"-o",
|
|
@@ -125,7 +125,7 @@ def search( # pylint: disable=R0917
|
|
|
125
125
|
n_results: int,
|
|
126
126
|
output_path: str) -> None:
|
|
127
127
|
"""
|
|
128
|
-
Search for
|
|
128
|
+
Search for AIQ Toolkit artifacts with the specified configuration.
|
|
129
129
|
"""
|
|
130
130
|
|
|
131
131
|
from aiq.settings.global_settings import GlobalSettings
|
aiq/cli/commands/start.py
CHANGED
|
@@ -149,7 +149,7 @@ class StartCommandGroup(click.MultiCommand):
|
|
|
149
149
|
|
|
150
150
|
# Build the command parameters
|
|
151
151
|
params: list[click.Parameter] = self._build_params(registered_front_end)
|
|
152
|
-
help_msg = f"Run an
|
|
152
|
+
help_msg = f"Run an AIQ Toolkit workflow using the {registered_front_end.local_name} front end."
|
|
153
153
|
|
|
154
154
|
cmd = click.Command(name=registered_front_end.local_name,
|
|
155
155
|
params=params,
|
|
@@ -178,7 +178,7 @@ class StartCommandGroup(click.MultiCommand):
|
|
|
178
178
|
# Here we need to ensure all objects are loaded before we try to create the config object
|
|
179
179
|
discover_and_register_plugins(PluginTypes.CONFIG_OBJECT)
|
|
180
180
|
|
|
181
|
-
logger.info("Starting
|
|
181
|
+
logger.info("Starting AIQ Toolkit from config file: '%s'", config_file)
|
|
182
182
|
|
|
183
183
|
config_dict = load_and_override_config(config_file, override)
|
|
184
184
|
|
|
@@ -242,9 +242,9 @@ class StartCommandGroup(click.MultiCommand):
|
|
|
242
242
|
|
|
243
243
|
@click.command(name=__name__,
|
|
244
244
|
invoke_without_command=False,
|
|
245
|
-
help="Run an
|
|
245
|
+
help="Run an AIQ Toolkit workflow using a front end configuration.",
|
|
246
246
|
cls=StartCommandGroup)
|
|
247
247
|
@click.pass_context
|
|
248
248
|
def start_command(ctx: click.Context, **kwargs) -> None:
|
|
249
|
-
"""Run an
|
|
249
|
+
"""Run an AIQ Toolkit workflow using a front end configuration."""
|
|
250
250
|
pass
|
aiq/cli/commands/uninstall.py
CHANGED
|
@@ -55,11 +55,11 @@ async def uninstall_packages(packages: list[dict[str, str]]) -> None:
|
|
|
55
55
|
|
|
56
56
|
@click.group(name=__name__,
|
|
57
57
|
invoke_without_command=True,
|
|
58
|
-
help=("Uninstall an
|
|
58
|
+
help=("Uninstall an AIQ Toolkit plugin packages from the local environment."))
|
|
59
59
|
@click.argument("packages", type=str)
|
|
60
60
|
def uninstall_command(packages: str) -> None:
|
|
61
61
|
"""
|
|
62
|
-
Uninstall
|
|
62
|
+
Uninstall AIQ Toolkit plugin packages from the local environment.
|
|
63
63
|
"""
|
|
64
64
|
|
|
65
65
|
packages = packages.split()
|
|
@@ -11,8 +11,8 @@ name = "{{ package_name }}"
|
|
|
11
11
|
dependencies = [
|
|
12
12
|
"aiqtoolkit[langchain]",
|
|
13
13
|
]
|
|
14
|
-
requires-python = ">=3.11"
|
|
15
|
-
description = "Custom
|
|
14
|
+
requires-python = ">=3.11,<3.13"
|
|
15
|
+
description = "Custom AIQ Toolkit Workflow"
|
|
16
16
|
classifiers = ["Programming Language :: Python"]
|
|
17
17
|
|
|
18
18
|
{% if editable %}[tool.uv.sources]
|
|
@@ -98,7 +98,7 @@ def find_package_root(package_name: str) -> Path | None:
|
|
|
98
98
|
|
|
99
99
|
def get_workflow_path_from_name(workflow_name: str):
|
|
100
100
|
"""
|
|
101
|
-
Look up the location of an installed
|
|
101
|
+
Look up the location of an installed AIQ Toolkit workflow and retrieve the root directory of the installed workflow.
|
|
102
102
|
|
|
103
103
|
Args:
|
|
104
104
|
workflow_name: The name of the workflow.
|
|
@@ -123,17 +123,17 @@ def get_workflow_path_from_name(workflow_name: str):
|
|
|
123
123
|
@click.option(
|
|
124
124
|
"--workflow-dir",
|
|
125
125
|
default=".",
|
|
126
|
-
help="Output directory for saving the created workflow. A new folder with the workflow name will be created
|
|
127
|
-
"Defaults to the present working directory.")
|
|
126
|
+
help="Output directory for saving the created workflow. A new folder with the workflow name will be created "
|
|
127
|
+
"within. Defaults to the present working directory.")
|
|
128
128
|
@click.option(
|
|
129
129
|
"--description",
|
|
130
|
-
default="
|
|
130
|
+
default="AIQ Toolkit function template. Please update the description.",
|
|
131
131
|
help="""A description of the component being created. Will be used to populate the docstring and will describe the
|
|
132
132
|
component when inspecting installed components using 'aiq info component'""")
|
|
133
133
|
# pylint: disable=missing-param-doc
|
|
134
134
|
def create_command(workflow_name: str, install: bool, workflow_dir: str, description: str):
|
|
135
135
|
"""
|
|
136
|
-
Create a new
|
|
136
|
+
Create a new AIQ Toolkit workflow using templates.
|
|
137
137
|
|
|
138
138
|
Args:
|
|
139
139
|
workflow_name (str): The name of the new workflow.
|
|
@@ -170,6 +170,8 @@ def create_command(workflow_name: str, install: bool, workflow_dir: str, descrip
|
|
|
170
170
|
(new_workflow_dir / 'src' / package_name).mkdir(parents=True)
|
|
171
171
|
# Create config directory
|
|
172
172
|
(new_workflow_dir / 'src' / package_name / 'configs').mkdir(parents=True)
|
|
173
|
+
# Create package level configs directory
|
|
174
|
+
(new_workflow_dir / 'configs').mkdir(parents=True)
|
|
173
175
|
|
|
174
176
|
# Initialize Jinja2 environment
|
|
175
177
|
env = Environment(loader=FileSystemLoader(str(template_dir)))
|
|
@@ -196,7 +198,6 @@ def create_command(workflow_name: str, install: bool, workflow_dir: str, descrip
|
|
|
196
198
|
'python_safe_workflow_name': workflow_name.replace("-", "_"),
|
|
197
199
|
'package_name': package_name,
|
|
198
200
|
'rel_path_to_repo_root': rel_path_to_repo_root,
|
|
199
|
-
# 'workflow_class_name': f"{workflow_name.capitalize().replace("-", "").replace("_", "")}WorkflowConfig",
|
|
200
201
|
'workflow_class_name': f"{_generate_valid_classname(workflow_name)}FunctionConfig",
|
|
201
202
|
'workflow_description': description
|
|
202
203
|
}
|
|
@@ -207,6 +208,11 @@ def create_command(workflow_name: str, install: bool, workflow_dir: str, descrip
|
|
|
207
208
|
with open(output_path, 'w', encoding="utf-8") as f:
|
|
208
209
|
f.write(content)
|
|
209
210
|
|
|
211
|
+
# Create symlink for config.yml
|
|
212
|
+
config_source = new_workflow_dir / 'src' / package_name / 'configs' / 'config.yml'
|
|
213
|
+
config_link = new_workflow_dir / 'configs' / 'config.yml'
|
|
214
|
+
os.symlink(config_source, config_link)
|
|
215
|
+
|
|
210
216
|
if install:
|
|
211
217
|
# Install the new package without changing directories
|
|
212
218
|
click.echo(f"Installing workflow '{workflow_name}'...")
|
|
@@ -228,7 +234,7 @@ def create_command(workflow_name: str, install: bool, workflow_dir: str, descrip
|
|
|
228
234
|
@click.argument('workflow_name')
|
|
229
235
|
def reinstall_command(workflow_name):
|
|
230
236
|
"""
|
|
231
|
-
Reinstall an
|
|
237
|
+
Reinstall an AIQ Toolkit workflow to update dependencies and code changes.
|
|
232
238
|
|
|
233
239
|
Args:
|
|
234
240
|
workflow_name (str): The name of the workflow to reinstall.
|
|
@@ -264,7 +270,7 @@ def reinstall_command(workflow_name):
|
|
|
264
270
|
@click.argument('workflow_name')
|
|
265
271
|
def delete_command(workflow_name: str):
|
|
266
272
|
"""
|
|
267
|
-
Delete an
|
|
273
|
+
Delete an AIQ Toolkit workflow and uninstall its package.
|
|
268
274
|
|
|
269
275
|
Args:
|
|
270
276
|
workflow_name (str): The name of the workflow to delete.
|
aiq/cli/entrypoint.py
CHANGED
|
@@ -77,7 +77,7 @@ def get_version():
|
|
|
77
77
|
help='Set the logging level')
|
|
78
78
|
@click.pass_context
|
|
79
79
|
def cli(ctx: click.Context, log_level: str):
|
|
80
|
-
"""Main entrypoint for the
|
|
80
|
+
"""Main entrypoint for the AIQ Toolkit CLI"""
|
|
81
81
|
|
|
82
82
|
ctx_dict = ctx.ensure_object(dict)
|
|
83
83
|
|
aiq/data_models/api_server.py
CHANGED
|
@@ -39,7 +39,7 @@ class Message(BaseModel):
|
|
|
39
39
|
|
|
40
40
|
class AIQChatRequest(BaseModel):
|
|
41
41
|
"""
|
|
42
|
-
AIQChatRequest is a data model that represents a request to the
|
|
42
|
+
AIQChatRequest is a data model that represents a request to the AIQ Toolkit chat API.
|
|
43
43
|
"""
|
|
44
44
|
|
|
45
45
|
# Allow extra fields in the model_config to support derived models
|
|
@@ -88,8 +88,8 @@ class AIQUsage(BaseModel):
|
|
|
88
88
|
|
|
89
89
|
class AIQResponseSerializable(abc.ABC):
|
|
90
90
|
"""
|
|
91
|
-
AIQChatResponseSerializable is an abstract class that defines the interface for serializing output for the
|
|
92
|
-
chat streaming API.
|
|
91
|
+
AIQChatResponseSerializable is an abstract class that defines the interface for serializing output for the AIQ
|
|
92
|
+
Toolkit chat streaming API.
|
|
93
93
|
"""
|
|
94
94
|
|
|
95
95
|
@abstractmethod
|
|
@@ -111,7 +111,7 @@ class AIQResponseBaseModelIntermediate(BaseModel, AIQResponseSerializable):
|
|
|
111
111
|
|
|
112
112
|
class AIQChatResponse(AIQResponseBaseModelOutput):
|
|
113
113
|
"""
|
|
114
|
-
AIQChatResponse is a data model that represents a response from the
|
|
114
|
+
AIQChatResponse is a data model that represents a response from the AIQ Toolkit chat API.
|
|
115
115
|
"""
|
|
116
116
|
|
|
117
117
|
# Allow extra fields in the model_config to support derived models
|
|
@@ -152,7 +152,7 @@ class AIQChatResponse(AIQResponseBaseModelOutput):
|
|
|
152
152
|
|
|
153
153
|
class AIQChatResponseChunk(AIQResponseBaseModelOutput):
|
|
154
154
|
"""
|
|
155
|
-
AIQChatResponseChunk is a data model that represents a response chunk from the
|
|
155
|
+
AIQChatResponseChunk is a data model that represents a response chunk from the AIQ Toolkit chat streaming API.
|
|
156
156
|
"""
|
|
157
157
|
|
|
158
158
|
# Allow extra fields in the model_config to support derived models
|
|
@@ -191,7 +191,7 @@ class AIQChatResponseChunk(AIQResponseBaseModelOutput):
|
|
|
191
191
|
|
|
192
192
|
class AIQResponseIntermediateStep(AIQResponseBaseModelIntermediate):
|
|
193
193
|
"""
|
|
194
|
-
AIQResponseSerializedStep is a data model that represents a serialized step in the
|
|
194
|
+
AIQResponseSerializedStep is a data model that represents a serialized step in the AIQ Toolkit chat streaming API.
|
|
195
195
|
"""
|
|
196
196
|
|
|
197
197
|
# Allow extra fields in the model_config to support derived models
|