RagRequest

data class RagRequest(val query: String, val similarityThreshold: <Error class: unknown class> = 0.8, val topK: Int = 8, val hyDE: HyDE? = null, val desiredMaxLatency: Duration = Duration.ofMillis(5000), val compressionConfig: CompressionConfig = CompressionConfig(), val contentElementSearch: ContentElementSearch = ContentElementSearch.CHUNKS_ONLY, val entitySearch: EntitySearch? = null, val timestamp: Instant = Instant.now()) : RagRequestRefinement<RagRequest>

RAG request. Contains a query and parameters for similarity search.

Parameters

query

the query string to search for

similarityThreshold

the minimum similarity score for results (default is 0.8)

topK

the maximum number of results to return (default is 8) If set, only the given entities will be searched for.

Constructors

Link copied to clipboard
constructor(query: String, similarityThreshold: <Error class: unknown class> = 0.8, topK: Int = 8, hyDE: HyDE? = null, desiredMaxLatency: Duration = Duration.ofMillis(5000), compressionConfig: CompressionConfig = CompressionConfig(), contentElementSearch: ContentElementSearch = ContentElementSearch.CHUNKS_ONLY, entitySearch: EntitySearch? = null, timestamp: Instant = Instant.now())

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val desiredMaxLatency: Duration
Link copied to clipboard
open override val entitySearch: EntitySearch? = null
Link copied to clipboard
open override val hyDE: HyDE? = null
Link copied to clipboard
open val query: String
Link copied to clipboard
open val similarityThreshold: <Error class: unknown class> = 0.8
Link copied to clipboard
open val timestamp: Instant
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
open override fun withCompression(compressionConfig: CompressionConfig): RagRequest
Link copied to clipboard
open override fun withContentElementSearch(contentElementSearch: ContentElementSearch): RagRequest
Link copied to clipboard
open override fun withDesiredMaxLatency(desiredMaxLatency: Duration): RagRequest
Link copied to clipboard
@ApiStatus.Experimental
open override fun withEntitySearch(entitySearch: EntitySearch): RagRequest
Link copied to clipboard
open override fun withHyDE(hyDE: HyDE): RagRequest
Link copied to clipboard
open override fun withSimilarityThreshold(similarityThreshold: <Error class: unknown class>): RagRequest
Link copied to clipboard
open override fun withTopK(topK: Int): RagRequest