Package com.tnsai.annotations
Enum Class Knowledge.Type
- All Implemented Interfaces:
Serializable,Comparable<Knowledge.Type>,Constable
- Enclosing class:
Knowledge
Kinds of corpus a loader can ingest.
Each value is a SourceLoader SPI key. FILE and HTTP/HTTPS URL
have bundled loaders; DATABASE is an application extension point.
MEMORY and GRAPH load nothing, and no loader serves them.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionRows ingested from a SQL or NoSQL database.Documents on disk.A handle to a graph store, not a corpus.Chat knowledge the application supplies at runtime, through aChatKnowledgeBindingit attaches to the agent.Documents fetched from HTTP/HTTPS through the bundled source loader. -
Method Summary
Modifier and TypeMethodDescriptionstatic Knowledge.TypeReturns the enum constant of this class with the specified name.static Knowledge.Type[]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
-
FILE
Documents on disk. The bundled loader handles the textual aliases registered byDocumentFormat. PDF, DOCX, XLSX, PPTX and EPUB need an optionalContentExtractor(PDFBox/POI on the classpath, or a consumer provider) and are not decoded as text. -
URL
Documents fetched from HTTP/HTTPS through the bundled source loader. -
DATABASE
Rows ingested from a SQL or NoSQL database. No bundled loader. -
MEMORY
Chat knowledge the application supplies at runtime, through aChatKnowledgeBindingit attaches to the agent. Nothing is loaded or indexed, and initialization resolves nothing for it.- Declared on
@AgentSpeconly; a role or an action that names it fails. useis SEARCH, with nomaxTokens; itssearchsetstopKat most.- No location or loader member is set.
- A chat scope holds at most one MEMORY entry; other SEARCH entries and DIRECT entries may sit beside it, and a chat turn searches the MEMORY binding and the other SEARCH entries each on its own.
- The binding must be owned by the agent, name this entry alone and carry its topK, which is the chat default when none is set.
- A
SourceLoaderthat handles MEMORY fails discovery.
- Declared on
-
GRAPH
A handle to a graph store, not a corpus. Nothing is loaded or indexed; an action that names the entry searches the graph that an installedGraphStoreProviderserves for its role.useis SEARCH. DIRECT and SEQUENTIAL fail, since there are no documents to give.- The search strategy is
GRAPH. When noSearch.strategy()is set, on the entry or on the action that names it, the strategy is GRAPH. Any other strategy fails at init, whichever of the two set it. - No location or loader member may be set:
path,connection,query,format,include,exclude,unit,chunkContext,chunkContextModel,select,refreshandmaxTokensfail.enabledapplies as usual. - An action names at most one GRAPH entry and no document entry beside it.
- A chat turn leaves GRAPH entries out; only actions search them.
-
-
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
-