aiq.data_models.component_ref#

Classes#

ComponentRefNode

A node type for component runtime instances reference names in a networkx digraph.

ComponentRef

Abstract class used for the interface to derive ComponentRef objects.

EmbedderRef

A reference to an embedder in an AIQ Toolkit configuration object.

FunctionRef

A reference to a function in an AIQ Toolkit configuration object.

LLMRef

A reference to an LLM in an AIQ Toolkit configuration object.

MemoryRef

A reference to a memory in an AIQ Toolkit configuration object.

RetrieverRef

A reference to a retriever in an AIQ Toolkit configuration object.

Functions#

generate_instance_id(→ str)

Generates a unique identifier for a python object derived from its python unique id.

Module Contents#

generate_instance_id(input_object: Any) str#

Generates a unique identifier for a python object derived from its python unique id.

Args:

input_object (typing.Any): The input object to receive a unique identifier.

Returns:

str: Unique identifier.

class ComponentRefNode(/, **data: Any)#

Bases: aiq.data_models.common.HashableBaseModel

A node type for component runtime instances reference names in a networkx digraph.

Args:

ref_name (ComponentRef): The name of the component runtime instance. component_group (ComponentGroup): The component group in an AIQ Toolkit configuration object.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

ref_name: ComponentRef#
component_group: aiq.data_models.component.ComponentGroup#
class ComponentRef#

Bases: str, abc.ABC

Abstract class used for the interface to derive ComponentRef objects.

Initialize self. See help(type(self)) for accurate signature.

property component_group: aiq.data_models.component.ComponentGroup#
Abstractmethod:

Provides the component group this ComponentRef object represents.

Returns:

ComponentGroup: A component group of the AIQ Toolkit configuration object

class EmbedderRef#

Bases: ComponentRef

A reference to an embedder in an AIQ Toolkit configuration object.

Initialize self. See help(type(self)) for accurate signature.

property component_group#

Provides the component group this ComponentRef object represents.

Returns:

ComponentGroup: A component group of the AIQ Toolkit configuration object

class FunctionRef#

Bases: ComponentRef

A reference to a function in an AIQ Toolkit configuration object.

Initialize self. See help(type(self)) for accurate signature.

property component_group#

Provides the component group this ComponentRef object represents.

Returns:

ComponentGroup: A component group of the AIQ Toolkit configuration object

class LLMRef#

Bases: ComponentRef

A reference to an LLM in an AIQ Toolkit configuration object.

Initialize self. See help(type(self)) for accurate signature.

property component_group#

Provides the component group this ComponentRef object represents.

Returns:

ComponentGroup: A component group of the AIQ Toolkit configuration object

class MemoryRef#

Bases: ComponentRef

A reference to a memory in an AIQ Toolkit configuration object.

Initialize self. See help(type(self)) for accurate signature.

property component_group#

Provides the component group this ComponentRef object represents.

Returns:

ComponentGroup: A component group of the AIQ Toolkit configuration object

class RetrieverRef#

Bases: ComponentRef

A reference to a retriever in an AIQ Toolkit configuration object.

Initialize self. See help(type(self)) for accurate signature.

property component_group#

Provides the component group this ComponentRef object represents.

Returns:

ComponentGroup: A component group of the AIQ Toolkit configuration object