aiq.builder.builder#

Classes#

UserManagerHolder

Builder

Helper class that provides a standard way to create an ABC using

EvalBuilder

Helper class that provides a standard way to create an ABC using

Module Contents#

class UserManagerHolder(context: aiq.builder.context.AIQContext)#
_context#
get_id()#
class Builder#

Bases: abc.ABC

Helper class that provides a standard way to create an ABC using inheritance.

abstractmethod add_function(
name: str | aiq.data_models.component_ref.FunctionRef,
config: aiq.data_models.function.FunctionBaseConfig,
) aiq.builder.function.Function#
Async:

abstractmethod get_function(
name: str | aiq.data_models.component_ref.FunctionRef,
) aiq.builder.function.Function#
get_functions(
function_names: collections.abc.Sequence[str | aiq.data_models.component_ref.FunctionRef],
) list[aiq.builder.function.Function]#
abstractmethod get_function_config(
name: str | aiq.data_models.component_ref.FunctionRef,
) aiq.data_models.function.FunctionBaseConfig#
abstractmethod set_workflow(
config: aiq.data_models.function.FunctionBaseConfig,
) aiq.builder.function.Function#
Async:

abstractmethod get_workflow() aiq.builder.function.Function#
abstractmethod get_workflow_config() aiq.data_models.function.FunctionBaseConfig#
get_tools(
tool_names: collections.abc.Sequence[str | aiq.data_models.component_ref.FunctionRef],
wrapper_type: aiq.builder.framework_enum.LLMFrameworkEnum | str,
) list[Any]#
abstractmethod get_tool(
fn_name: str | aiq.data_models.component_ref.FunctionRef,
wrapper_type: aiq.builder.framework_enum.LLMFrameworkEnum | str,
) Any#
abstractmethod add_llm(
name: str | aiq.data_models.component_ref.LLMRef,
config: aiq.data_models.llm.LLMBaseConfig,
)#
Async:

async get_llms(
llm_names: collections.abc.Sequence[str | aiq.data_models.component_ref.LLMRef],
wrapper_type: aiq.builder.framework_enum.LLMFrameworkEnum | str,
) list[Any]#
abstractmethod get_llm(
llm_name: str | aiq.data_models.component_ref.LLMRef,
wrapper_type: aiq.builder.framework_enum.LLMFrameworkEnum | str,
) Any#
Async:

abstractmethod get_llm_config(
llm_name: str | aiq.data_models.component_ref.LLMRef,
) aiq.data_models.llm.LLMBaseConfig#
abstractmethod add_embedder(
name: str | aiq.data_models.component_ref.EmbedderRef,
config: aiq.data_models.embedder.EmbedderBaseConfig,
)#
Async:

async get_embedders(
embedder_names: collections.abc.Sequence[str | aiq.data_models.component_ref.EmbedderRef],
wrapper_type: aiq.builder.framework_enum.LLMFrameworkEnum | str,
) list[Any]#
abstractmethod get_embedder(
embedder_name: str | aiq.data_models.component_ref.EmbedderRef,
wrapper_type: aiq.builder.framework_enum.LLMFrameworkEnum | str,
) Any#
Async:

abstractmethod get_embedder_config(
embedder_name: str | aiq.data_models.component_ref.EmbedderRef,
) aiq.data_models.embedder.EmbedderBaseConfig#
abstractmethod add_memory_client(
name: str | aiq.data_models.component_ref.MemoryRef,
config: aiq.data_models.memory.MemoryBaseConfig,
)#
Async:

get_memory_clients(
memory_names: collections.abc.Sequence[str | aiq.data_models.component_ref.MemoryRef],
) list[aiq.memory.interfaces.MemoryEditor]#

Return a list of memory clients for the specified names.

abstractmethod get_memory_client(
memory_name: str | aiq.data_models.component_ref.MemoryRef,
) aiq.memory.interfaces.MemoryEditor#

Return the instantiated memory client for the given name.

abstractmethod get_memory_client_config(
memory_name: str | aiq.data_models.component_ref.MemoryRef,
) aiq.data_models.memory.MemoryBaseConfig#
abstractmethod add_retriever(
name: str | aiq.data_models.component_ref.RetrieverRef,
config: aiq.data_models.retriever.RetrieverBaseConfig,
)#
Async:

async get_retrievers(
retriever_names: collections.abc.Sequence[str | aiq.data_models.component_ref.RetrieverRef],
wrapper_type: aiq.builder.framework_enum.LLMFrameworkEnum | str | None = None,
)#
async get_retriever(
retriever_name: str | aiq.data_models.component_ref.RetrieverRef,
wrapper_type: aiq.builder.framework_enum.LLMFrameworkEnum | str,
) Any#
async get_retriever(
retriever_name: str | aiq.data_models.component_ref.RetrieverRef,
wrapper_type: None,
) aiq.retriever.interface.AIQRetriever
async get_retriever(
retriever_name: str | aiq.data_models.component_ref.RetrieverRef,
) aiq.retriever.interface.AIQRetriever
abstractmethod get_retriever_config(
retriever_name: str | aiq.data_models.component_ref.RetrieverRef,
) aiq.data_models.retriever.RetrieverBaseConfig#
Async:

abstractmethod get_user_manager() UserManagerHolder#
abstractmethod get_function_dependencies(
fn_name: str,
) aiq.data_models.function_dependencies.FunctionDependencies#
class EvalBuilder#

Bases: Builder

Helper class that provides a standard way to create an ABC using inheritance.

abstractmethod add_evaluator(
name: str,
config: aiq.data_models.evaluator.EvaluatorBaseConfig,
)#
Async:

abstractmethod get_evaluator(evaluator_name: str) Any#
abstractmethod get_evaluator_config(
evaluator_name: str,
) aiq.data_models.evaluator.EvaluatorBaseConfig#
abstractmethod get_max_concurrency() int#
abstractmethod get_output_dir() pathlib.Path#
abstractmethod get_all_tools(
wrapper_type: aiq.builder.framework_enum.LLMFrameworkEnum | str,
) list[Any]#