Skip to content

Chunk processor

Defines a base class for chunk processors used in Gen AI applications.

Authors

Henry Wicaksono (henry.wicaksono@gdplabs.id)

References

NONE

BaseChunkProcessor

Bases: Component, ABC

An abstract base class for the chunk processors used in Gen AI applications.

process_chunks(chunks) abstractmethod async

Processes the given list of chunks.

This abstract method must be implemented by subclasses to define how the chunks are processed. It is expected to return a list of processed chunks.

Parameters:

Name Type Description Default
chunks list[Chunk]

The list of chunks to be processed.

required

Returns:

Type Description
list[Chunk]

list[Chunk]: A list of processed chunks.

Raises:

Type Description
NotImplementedError

If the method is not implemented in a subclass.