Package com.tnsai.rag
Enum Class KnowledgeUnit
- All Implemented Interfaces:
Serializable,Comparable<KnowledgeUnit>,Constable
How one ingested file becomes retrieval documents.
@Knowledge.format says what a file is. This enum says
how many documents it becomes. It is an ingest-time decision,
not consulted per query, and it does not change how SEARCH knowledge
ranks results.
AUTO is the default and names the behaviour the framework
already had: a file that fits one chunk stays one document, a larger file
is split by NormalizedDocumentChunker. The other values are
explicit opt-ins. There is no RECORD constant — JSONL and CSV
already yield one document per row under their own extractors, and a
dedicated value would be redundant for two formats and meaningless for
the rest.
- Since:
- 0.15.0
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionToday's hybrid, unchanged.NormalizedDocumentChunkerapplied unconditionally, including to files that would otherwise fit in one chunk.The whole file is one document, chunking suppressed, and a file over the chunker limits fails at ingest rather than being split behind the declaration.Markdown heading sections (#{1,6}).Each non-blank line is one document. -
Method Summary
Modifier and TypeMethodDescriptionstatic KnowledgeUnitReturns the enum constant of this class with the specified name.static KnowledgeUnit[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
AUTO
-
DOCUMENT
The whole file is one document, chunking suppressed, and a file over the chunker limits fails at ingest rather than being split behind the declaration. -
LINE
Each non-blank line is one document. Blank and whitespace-only lines are skipped, and a file containing no non-blank lines yields no units. -
HEADING
Markdown heading sections (#{1,6}). -
CHUNK
NormalizedDocumentChunkerapplied unconditionally, including to files that would otherwise fit in one chunk.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-