liveBook · Manning

fileSupplier

As explained in Spring AI in Action

fileSupplier is a Spring Function Catalog function that monitors a directory for new files and emits them to a consumer.

fileSupplier is a Spring Function Catalog function that watches a directory for new files, emits their bytes, and passes them to the next function in a composed pipeline. section 4.3.1 section 4.3.2

Configure fileSupplier as the ingestion stage of a reactive document loader:

  • Add the Spring Functions Catalog file-supplier dependency; its bean is autoconfigured in the application context. section 4.3.1
  • Set file.supplier.directory to the directory that receives incoming files, such as /var/dropoff. section 4.3.2
  • Use file.supplier.filename-regex to accept only desired formats, such as PDF, DOCX, and plain-text files. section 4.3.2
  • Compose fileSupplier with documentReader, splitter, titleDeterminer, and vectorStoreConsumer using a pipe-delimited function definition. section 4.3.2

Directory-to-vector-store loader

A loader can watch /var/dropoff, select files matching .*\.(pdf|docx|txt), and emit a Flux<byte[]> to a TikaDocumentReader. The reader produces Documents, a splitter creates chunks, and a vector-store consumer persists them. section 4.3.2 section 4.3.3

spring.cloud.function.definition=\
  fileSupplier|\
  documentReader|\
  splitter|\
  titleDeterminer|\
  vectorStoreConsumer

Inspect the complete pipe-delimited definition connecting fileSupplier to document parsing, splitting, title determination, and vector-store persistence. section 4.3.2

How Spring AI in Action covers it

How deep it goes
Defines the bean role, directory and regex configuration, pipeline composition, and Flux handoff; stops short of catalog internals.
Examples
Uses /var/dropoff and a PDF, DOCX, or plain-text filename regex in a vector-store loader.
What it assumes
Assumes Spring Boot configuration and reactive Flux concepts while supplying the catalog dependency and integrating it with Spring AI components.
What you can do after
Operate/configure fileSupplier by adding its dependency and wiring directory and filename filtering into a composed function.
How it connects
Connects Spring Function Catalog to Spring Cloud Function, Project Reactor, Spring AI, TikaDocumentReader, and VectorStore.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Spring AI in Action. The section links point to the parts of the book it draws on.