ContextBuilder class

Builds optimized context for LLM prompts.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

build({required List<ChunkSearchResult> searchResults, int tokenBudget = 2000, ContextStrategy strategy = ContextStrategy.relevanceFirst, String separator = '\n\n---\n\n', bool singleSourceMode = false}) AssembledContext
Assemble context from search results within a token budget.
buildWithCompression({required List<ChunkSearchResult> searchResults, int tokenBudget = 2000, ContextStrategy strategy = ContextStrategy.relevanceFirst, int compressionLevel = 1, String language = 'ko', bool singleSourceMode = false}) Future<AssembledContext>
Build context with REFRAG-style compression.
formatForPrompt({required String query, required AssembledContext context, String? systemInstruction, bool useStrictMode = true}) String
Format context for LLM prompt.