Package com.tnsai.rag
Interface ChunkContextGenerator
public interface ChunkContextGenerator
SPI for LLM-written chunk context used by
ChunkContext.LLM.
TnsAI does not bundle a generator. Provider modules own inference,
credentials, and lifecycle. supports(String) must be
answerable without a network call.
- Since:
- 0.15.0
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringStable identity of the bundled situate-the-chunk prompt. -
Method Summary
Modifier and TypeMethodDescriptiongenerate(ChunkContextGenerator.Request request) Writes a short (about 50–100 tokens) description of the chunk's place in its parent document.booleanReturns whether this provider can servemodelwithout calling out.default StringStable identity of this provider's situate prompt.default StringProvider-owned prompt revision.
-
Field Details
-
LLM_TEMPLATE_ID
Stable identity of the bundled situate-the-chunk prompt.- See Also:
-
-
Method Details
-
supports
Returns whether this provider can servemodelwithout calling out.- Parameters:
model- exact, case-sensitive model identifier- Returns:
truewhen this provider can generate context
-
generate
Writes a short (about 50–100 tokens) description of the chunk's place in its parent document.- Parameters:
request- immutable generation request- Returns:
- non-blank context string, without the chunk body
-
templateId
Stable identity of this provider's situate prompt. Changing the prompt requires a new id so fingerprints and the generation cache invalidate.- Returns:
- non-blank template identity
- Since:
- 0.15.0
-
templateVersion
Provider-owned prompt revision. A bump invalidates cached context and the ingest fingerprint forChunkContext.LLMsources.- Returns:
- non-blank version token
- Since:
- 0.15.0
-