aiq.builder.workflow_builder#
Attributes#
Classes#
Helper class that provides a standard way to create an ABC using |
|
Helper class that provides a standard way to create an ABC using |
Module Contents#
- logger#
- class ConfiguredFunction#
-
- instance: aiq.builder.function.Function#
- class ConfiguredLLM#
-
- instance: aiq.builder.llm.LLMProviderInfo#
- class ConfiguredEmbedder#
- class ConfiguredMemory#
-
- instance: aiq.memory.interfaces.MemoryEditor#
- class ConfiguredRetriever#
- class WorkflowBuilder(
- *,
- general_config: aiq.data_models.config.GeneralConfig | None = None,
- registry: aiq.cli.type_registry.TypeRegistry | None = None,
Bases:
aiq.builder.builder.Builder
,contextlib.AbstractAsyncContextManager
Helper class that provides a standard way to create an ABC using inheritance.
- general_config = None#
- _registry = None#
- _logging_handlers: dict[str, logging.Handler]#
- _exporters: dict[str, ConfiguredExporter]#
- _functions: dict[str, ConfiguredFunction]#
- _workflow: ConfiguredFunction | None = None#
- _llms: dict[str, ConfiguredLLM]#
- _embedders: dict[str, ConfiguredEmbedder]#
- _memory_clients: dict[str, ConfiguredMemory]#
- _retrievers: dict[str, ConfiguredRetriever]#
- _context_state#
- _exit_stack: contextlib.AsyncExitStack | None = None#
- function_dependencies: dict[str, aiq.data_models.function_dependencies.FunctionDependencies]#
- build( ) aiq.builder.workflow.Workflow #
Creates an instance of a workflow object using the added components and the desired entry function.
Parameters#
- entry_functionstr | None, optional
The function name to use as the entry point for the created workflow. If None, the entry point will be the specified workflow function. By default None
Returns#
- Workflow
A created workflow.
Raises#
- ValueError
If the workflow has not been set before building.
- _get_exit_stack() contextlib.AsyncExitStack #
- async _build_function(
- name: str,
- config: aiq.data_models.function.FunctionBaseConfig,
- async add_function(
- name: str | aiq.data_models.component_ref.FunctionRef,
- config: aiq.data_models.function.FunctionBaseConfig,
- get_function( ) aiq.builder.function.Function #
- get_function_config( ) aiq.data_models.function.FunctionBaseConfig #
- async set_workflow( ) aiq.builder.function.Function #
- get_workflow() aiq.builder.function.Function #
- get_workflow_config() aiq.data_models.function.FunctionBaseConfig #
- get_function_dependencies(
- fn_name: str | aiq.data_models.component_ref.FunctionRef,
- get_tool(
- fn_name: str | aiq.data_models.component_ref.FunctionRef,
- wrapper_type: aiq.builder.framework_enum.LLMFrameworkEnum | str,
- async add_llm(
- name: str | aiq.data_models.component_ref.LLMRef,
- config: aiq.data_models.llm.LLMBaseConfig,
- async get_llm(
- llm_name: str | aiq.data_models.component_ref.LLMRef,
- wrapper_type: aiq.builder.framework_enum.LLMFrameworkEnum | str,
- get_llm_config(
- llm_name: str | aiq.data_models.component_ref.LLMRef,
- async add_embedder(
- name: str | aiq.data_models.component_ref.EmbedderRef,
- config: aiq.data_models.embedder.EmbedderBaseConfig,
- async get_embedder(
- embedder_name: str | aiq.data_models.component_ref.EmbedderRef,
- wrapper_type: aiq.builder.framework_enum.LLMFrameworkEnum | str,
- get_embedder_config(
- embedder_name: str | aiq.data_models.component_ref.EmbedderRef,
- async add_memory_client(
- name: str | aiq.data_models.component_ref.MemoryRef,
- config: aiq.data_models.memory.MemoryBaseConfig,
- get_memory_client(
- memory_name: str | aiq.data_models.component_ref.MemoryRef,
Return the instantiated memory client for the given name.
- get_memory_client_config(
- memory_name: str | aiq.data_models.component_ref.MemoryRef,
- async add_retriever(
- name: str | aiq.data_models.component_ref.RetrieverRef,
- config: aiq.data_models.retriever.RetrieverBaseConfig,
- async get_retriever(
- retriever_name: str | aiq.data_models.component_ref.RetrieverRef,
- wrapper_type: aiq.builder.framework_enum.LLMFrameworkEnum | str | None = None,
- async get_retriever_config(
- retriever_name: str | aiq.data_models.component_ref.RetrieverRef,
- get_user_manager()#
- async populate_builder(config: aiq.data_models.config.AIQConfig)#
- classmethod from_config(config: aiq.data_models.config.AIQConfig)#
- Async:
- class ChildBuilder(workflow_builder: WorkflowBuilder)#
Bases:
aiq.builder.builder.Builder
Helper class that provides a standard way to create an ABC using inheritance.
- _workflow_builder#
- _dependencies#
- property dependencies: aiq.data_models.function_dependencies.FunctionDependencies#
- async add_function(
- name: str,
- config: aiq.data_models.function.FunctionBaseConfig,
- get_function(name: str) aiq.builder.function.Function #
- get_function_config(
- name: str,
- async set_workflow( ) aiq.builder.function.Function #
- get_workflow() aiq.builder.function.Function #
- get_workflow_config() aiq.data_models.function.FunctionBaseConfig #
- get_tool(
- fn_name: str,
- wrapper_type: aiq.builder.framework_enum.LLMFrameworkEnum | str,
- async add_llm(name: str, config: aiq.data_models.llm.LLMBaseConfig)#
- async get_llm(
- llm_name: str,
- wrapper_type: aiq.builder.framework_enum.LLMFrameworkEnum | str,
- get_llm_config(llm_name: str) aiq.data_models.llm.LLMBaseConfig #
- async add_embedder(
- name: str,
- config: aiq.data_models.embedder.EmbedderBaseConfig,
- async get_embedder(
- embedder_name: str,
- wrapper_type: aiq.builder.framework_enum.LLMFrameworkEnum | str,
- get_embedder_config(
- embedder_name: str,
- async add_memory_client(
- name: str,
- config: aiq.data_models.memory.MemoryBaseConfig,
- get_memory_client(
- memory_name: str,
Return the instantiated memory client for the given name.
- get_memory_client_config(
- memory_name: str,
- async add_retriever(
- name: str,
- config: aiq.data_models.retriever.RetrieverBaseConfig,
- async get_retriever(
- retriever_name: str,
- wrapper_type: aiq.builder.framework_enum.LLMFrameworkEnum | str | None = None,
- async get_retriever_config(
- retriever_name: str,
- get_user_manager() aiq.builder.builder.UserManagerHolder #
- get_function_dependencies(
- fn_name: str,