Rag Options
data class RagOptions constructor(val ragService: RagService, 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 dualShot: DualShotConfig? = null) : RagRequestRefinement<RagOptions>
Operations for RAG use as an LLM tool. Options are immutable and stable.
Parameters
rag Service
the RagService to use for retrieval
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
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(ragService: RagService, 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, 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
open override fun withSimilarityThreshold(similarityThreshold: <Error class: unknown class>): RagOptions
Link copied to clipboard