Interface Reader

All Known Implementing Classes:
AbstractChunkingReader, ExternalApiReader, ImageReader, PDFReader, TextReader, TikaReader, WordReader

public interface Reader
Interface for document readers.

This interface provides a unified API for reading various types of documents and chunking them into Document objects. Implementations should support different file formats and input sources.

  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the list of file formats supported by this reader.
    reactor.core.publisher.Mono<List<io.agentscope.core.rag.model.Document>>
    Reads a document and returns a list of chunked Document objects.
  • Method Details

    • read

      reactor.core.publisher.Mono<List<io.agentscope.core.rag.model.Document>> read(ReaderInput input)
      Reads a document and returns a list of chunked Document objects.

      Errors during reading are propagated through the Mono via Mono.error().

      Parameters:
      input - the input to read (text, file path, URL, etc.)
      Returns:
      a Mono that emits a list of Document objects, or an error signal on failure
    • getSupportedFormats

      List<String> getSupportedFormats()
      Gets the list of file formats supported by this reader.
      Returns:
      a list of supported file extensions (e.g., "txt", "md", "pdf")