Rag Options
data class RagOptions constructor(val similarityThreshold: <Error class: unknown class> = 0.7, val topK: Int = 8, val hyDE: HyDE? = null, val desiredMaxLatency: Duration = Duration.ofMillis(5000), val compressionConfig: CompressionConfig = CompressionConfig(), val llm: <Error class: unknown class> = LlmOptions.withAutoLlm(), val contentElementSearch: ContentElementSearch = ContentElementSearch.CHUNKS_ONLY, val entitySearch: EntitySearch? = null, val ragResponseFormatter: RagResponseFormatter = SimpleRagResponseFormatter, val service: String? = null, val listener: RagEventListener = RagEventListener.NOOP, val dualShot: DualShotConfig? = null) : RagRequestRefinement<RagOptions>
Operations for RAG use as an LLM tool. Options are immutable and stable.
Parameters
similarity Threshold
minimum similarity threshold for results (0.0 to 1.0)
top K
maximum number of results to return returned. If set, only the given entities will be searched for.
rag Response Formatter
formatter to convert RagResponse to String
service
optional name of the RAG service to use. If null, the default service will be used.
dual Shot
whether to use dual-shot RAG, where the first tool returns a summary and the second tool returns detailed results.
Constructors
Link copied to clipboard
constructor(similarityThreshold: <Error class: unknown class> = 0.7, topK: Int = 8, hyDE: HyDE? = null, desiredMaxLatency: Duration = Duration.ofMillis(5000), compressionConfig: CompressionConfig = CompressionConfig(), llm: <Error class: unknown class> = LlmOptions.withAutoLlm(), contentElementSearch: ContentElementSearch = ContentElementSearch.CHUNKS_ONLY, entitySearch: EntitySearch? = null, ragResponseFormatter: RagResponseFormatter = SimpleRagResponseFormatter, service: String? = null, listener: RagEventListener = RagEventListener.NOOP, dualShot: DualShotConfig? = null)
Properties
Functions
Link copied to clipboard
Create a RagRequest from this refinement and a query.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Return an instance using the given Rag service name.
Link copied to clipboard
open override fun withSimilarityThreshold(similarityThreshold: <Error class: unknown class>): RagOptions
Link copied to clipboard