LoadResult

org.llm4s.rag.loader.LoadResult
See theLoadResult companion trait
object LoadResult

Attributes

Companion
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
LoadResult.type

Members list

Type members

Classlikes

final case class Failure(source: String, error: LLMError, recoverable: Boolean, documentId: Option[String]) extends LoadResult

Failed to load document.

Failed to load document.

documentId tells RAG.sync which indexed document the failure is about, since source is a path or key and not the id Documents are indexed under. A loader sets it when the failure concerns exactly one document that the source still lists - an S3 object whose read or extraction failed - and sync then keeps that document as indexed: not deleted, not counted as changed. It leaves it None when it cannot name the document, or when the failure may hide others (a crawled page whose links were never followed); sync then cannot tell which unlisted documents are really gone, and skips its deletion pass for that run.

Value parameters

documentId

The id the document is (or would be) indexed under, when the loader knows it

error

The error that occurred

recoverable

Whether the error is potentially recoverable (e.g., timeout)

source

Identifier for the failed source (path, URL, etc.)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait LoadResult
class Object
trait Matchable
class Any
Show all
final case class ListingFailure(source: String, error: LLMError) extends LoadResult

The loader could not enumerate its documents: an S3 listing that failed (no credentials, missing bucket, access denied), a directory that does not exist.

The loader could not enumerate its documents: an S3 listing that failed (no credentials, missing bucket, access denied), a directory that does not exist.

Unlike Failure, this is not about one document. The set of documents the loader would have produced is unknown, so it cannot be counted as one failed document among successes: RAG.ingest, RAG.sync and RAG.refresh (and their async forms) return its error as a Left; sync deletes nothing, rather than treat every indexed document as gone, and refresh leaves the index as it was. A listing that fails part-way through (a later S3 page) is reported the same way, after the documents that were listed before it.

Value parameters

error

The error that occurred

source

The source that could not be listed (e.g. S3(s3://bucket/prefix), a path)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait LoadResult
class Object
trait Matchable
class Any
Show all
final case class Skipped(source: String, reason: String) extends LoadResult

Document was intentionally skipped.

Document was intentionally skipped.

Value parameters

reason

Why the document was skipped

source

Identifier for the skipped source

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait LoadResult
class Object
trait Matchable
class Any
Show all
final case class Success(document: Document) extends LoadResult

Successfully loaded document.

Successfully loaded document.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait LoadResult
class Object
trait Matchable
class Any
Show all

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def failure(source: String, error: LLMError): LoadResult
def failure(source: String, error: LLMError, documentId: String): LoadResult

A failed read of the document indexed as documentId; see Failure.

A failed read of the document indexed as documentId; see Failure.

Attributes

def listingFailure(source: String, error: LLMError): LoadResult
def skipped(source: String, reason: String): LoadResult