Skip to content

CompositeLoader

Vector loader that composes multiple vector loaders

Notes
  • The vector loaders are called concurrently depending on the maximum number of threads
  • If the maximum number of threads is 1, the vector loaders are composed vertically, i.e., in sequence
  • If the maximum number of threads is greater than 1, the vector loaders are composed horizontally, i.e., in parallel

Implements the VectorLoader protocol.

PARAMETER DESCRIPTION
vector_loaders

Vector loaders

TYPE: list[VectorLoader]

max_num_threads

Maximum number of threads

TYPE: int | None DEFAULT: None

from_config classmethod

Creates a composite loader from the configuration.

PARAMETER DESCRIPTION
config

Configuration

TYPE: CompositeLoaderConfig

RETURNS DESCRIPTION
CompositeLoader

Composite loader

__call__

Loads a vector from the sources.

RETURNS DESCRIPTION
Vector

Vector


CompositeLoaderConfig

Bases: pydantic.BaseModel

Configuration for the from_config class method of CompositeLoader

Create the configuration from a config file
  • Use null instead of None
Example

You can create the configuration from a config file.

config.yaml
package: 'aviary'
name: 'CompositeLoader'
config:
  vector_loader_configs:
    - ...
    ...
  max_num_threads: null
ATTRIBUTE DESCRIPTION
vector_loader_configs

Configurations of the vector loaders

TYPE: list[VectorLoaderConfig]

max_num_threads

Maximum number of threads - defaults to None

TYPE: int | None