RagOptions

data class RagOptions constructor(val similarityThreshold: <Error class: unknown class> = 0.7, val topK: Int = 8, val compressionConfig: CompressionConfig = CompressionConfig(), val llm: <Error class: unknown class> = LlmOptions.withAutoLlm(), val labels: Set<String> = emptySet(), val ragResponseFormatter: RagResponseFormatter = SimpleRagResponseFormatter, val service: String? = null, val listener: RagEventListener = RagEventListener.NOOP) : RagRequestRefinement

Operations for RAG use as an LLM tool. Options are immutable and stable.

Parameters

similarityThreshold

minimum similarity threshold for results (0.0 to 1.0)

topK

maximum number of results to return

labels

optional set of labels to filter results. If not set all entities may be returned. If set, only the given entities will be searched for.

ragResponseFormatter

formatter to convert RagResponse to String

service

optional name of the RAG service to use. If null, the default service will be used.

Constructors

Link copied to clipboard
constructor(similarityThreshold: <Error class: unknown class> = 0.7, topK: Int = 8, compressionConfig: CompressionConfig = CompressionConfig(), llm: <Error class: unknown class> = LlmOptions.withAutoLlm(), labels: Set<String> = emptySet(), ragResponseFormatter: RagResponseFormatter = SimpleRagResponseFormatter, service: String? = null, listener: RagEventListener = RagEventListener.NOOP)

Properties

Link copied to clipboard
Link copied to clipboard
open override val labels: Set<String>
Link copied to clipboard
Link copied to clipboard
val llm: <Error class: unknown class>
Link copied to clipboard
val service: String? = null
Link copied to clipboard
open val similarityThreshold: <Error class: unknown class> = 0.7
Link copied to clipboard
open val topK: Int = 8

Functions

Link copied to clipboard
open fun toRequest(query: String): RagRequest

Create a RagRequest from this refinement and a query.

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
fun withSimilarityThreshold(similarityThreshold: <Error class: unknown class>): RagOptions
Link copied to clipboard
fun withTopK(topK: Int): RagOptions