Package com.embabel.agent.rag.tools
Class RagOptions
-
- All Implemented Interfaces:
-
com.embabel.agent.rag.RagRequestRefinement,com.embabel.agent.rag.RetrievalFilters,com.embabel.common.core.types.SimilarityCutoff
public final class RagOptions implements RagRequestRefinement<RagOptions>
Operations for RAG use as an LLM tool. Options are immutable and stable.
-
-
Field Summary
Fields Modifier and Type Field Description private final RagServiceragServiceprivate final DoublesimilarityThresholdprivate final IntegertopKprivate final HyDEhyDEprivate final DurationdesiredMaxLatencyprivate final CompressionConfigcompressionConfigprivate final LlmOptionsllmprivate final ContentElementSearchcontentElementSearchprivate final EntitySearchentitySearchprivate final RagResponseFormatterragResponseFormatterprivate final DualShotConfigdualShot
-
Constructor Summary
Constructors Constructor Description RagOptions(RagService ragService, Double similarityThreshold, Integer topK, HyDE hyDE, Duration desiredMaxLatency, CompressionConfig compressionConfig, LlmOptions llm, ContentElementSearch contentElementSearch, EntitySearch entitySearch, RagResponseFormatter ragResponseFormatter, DualShotConfig dualShot)RagOptions(RagService ragService, Double similarityThreshold, Integer topK, HyDE hyDE, Duration desiredMaxLatency, CompressionConfig compressionConfig, LlmOptions llm, ContentElementSearch contentElementSearch, EntitySearch entitySearch, RagResponseFormatter ragResponseFormatter)RagOptions(RagService ragService, Double similarityThreshold, Integer topK, HyDE hyDE, Duration desiredMaxLatency, CompressionConfig compressionConfig, LlmOptions llm, ContentElementSearch contentElementSearch, EntitySearch entitySearch)RagOptions(RagService ragService, Double similarityThreshold, Integer topK, HyDE hyDE, Duration desiredMaxLatency, CompressionConfig compressionConfig, LlmOptions llm, ContentElementSearch contentElementSearch)RagOptions(RagService ragService, Double similarityThreshold, Integer topK, HyDE hyDE, Duration desiredMaxLatency, CompressionConfig compressionConfig, LlmOptions llm)RagOptions(RagService ragService, Double similarityThreshold, Integer topK, HyDE hyDE, Duration desiredMaxLatency, CompressionConfig compressionConfig)RagOptions(RagService ragService, Double similarityThreshold, Integer topK, HyDE hyDE, Duration desiredMaxLatency)RagOptions(RagService ragService, Double similarityThreshold, Integer topK, HyDE hyDE)RagOptions(RagService ragService, Double similarityThreshold, Integer topK)RagOptions(RagService ragService, Double similarityThreshold)RagOptions(RagService ragService)
-
Method Summary
Modifier and Type Method Description final RagServicegetRagService()DoublegetSimilarityThreshold()IntegergetTopK()HyDEgetHyDE()DurationgetDesiredMaxLatency()CompressionConfiggetCompressionConfig()final LlmOptionsgetLlm()ContentElementSearchgetContentElementSearch()EntitySearchgetEntitySearch()final RagResponseFormattergetRagResponseFormatter()final DualShotConfiggetDualShot()RagOptionswithHyDE(HyDE hyDE)RagOptionswithSimilarityThreshold(Double similarityThreshold)RagOptionswithTopK(Integer topK)RagOptionswithDesiredMaxLatency(Duration desiredMaxLatency)RagOptionswithCompression(CompressionConfig compressionConfig)RagOptionswithContentElementSearch(ContentElementSearch contentElementSearch)RagOptionswithEntitySearch(EntitySearch entitySearch)final RagOptionswithDualShot(DualShotConfig dualShot)-
-
Constructor Detail
-
RagOptions
RagOptions(RagService ragService, Double similarityThreshold, Integer topK, HyDE hyDE, Duration desiredMaxLatency, CompressionConfig compressionConfig, LlmOptions llm, ContentElementSearch contentElementSearch, EntitySearch entitySearch, RagResponseFormatter ragResponseFormatter, DualShotConfig dualShot)
- Parameters:
ragService- the RagService to use for retrievalsimilarityThreshold- minimum similarity threshold for results (0.0 to 1.topK- maximum number of results to return returned.ragResponseFormatter- formatter to convert RagResponse to StringdualShot- whether to use dual-shot RAG, where the first tool returns a summary and the second tool returns detailed results.
-
RagOptions
RagOptions(RagService ragService, Double similarityThreshold, Integer topK, HyDE hyDE, Duration desiredMaxLatency, CompressionConfig compressionConfig, LlmOptions llm, ContentElementSearch contentElementSearch, EntitySearch entitySearch, RagResponseFormatter ragResponseFormatter)
- Parameters:
ragService- the RagService to use for retrievalsimilarityThreshold- minimum similarity threshold for results (0.0 to 1.topK- maximum number of results to return returned.ragResponseFormatter- formatter to convert RagResponse to String
-
RagOptions
RagOptions(RagService ragService, Double similarityThreshold, Integer topK, HyDE hyDE, Duration desiredMaxLatency, CompressionConfig compressionConfig, LlmOptions llm, ContentElementSearch contentElementSearch, EntitySearch entitySearch)
- Parameters:
ragService- the RagService to use for retrievalsimilarityThreshold- minimum similarity threshold for results (0.0 to 1.topK- maximum number of results to return returned.
-
RagOptions
RagOptions(RagService ragService, Double similarityThreshold, Integer topK, HyDE hyDE, Duration desiredMaxLatency, CompressionConfig compressionConfig, LlmOptions llm, ContentElementSearch contentElementSearch)
- Parameters:
ragService- the RagService to use for retrievalsimilarityThreshold- minimum similarity threshold for results (0.0 to 1.topK- maximum number of results to return returned.
-
RagOptions
RagOptions(RagService ragService, Double similarityThreshold, Integer topK, HyDE hyDE, Duration desiredMaxLatency, CompressionConfig compressionConfig, LlmOptions llm)
- Parameters:
ragService- the RagService to use for retrievalsimilarityThreshold- minimum similarity threshold for results (0.0 to 1.topK- maximum number of results to return returned.
-
RagOptions
RagOptions(RagService ragService, Double similarityThreshold, Integer topK, HyDE hyDE, Duration desiredMaxLatency, CompressionConfig compressionConfig)
- Parameters:
ragService- the RagService to use for retrievalsimilarityThreshold- minimum similarity threshold for results (0.0 to 1.topK- maximum number of results to return returned.
-
RagOptions
RagOptions(RagService ragService, Double similarityThreshold, Integer topK, HyDE hyDE, Duration desiredMaxLatency)
- Parameters:
ragService- the RagService to use for retrievalsimilarityThreshold- minimum similarity threshold for results (0.0 to 1.topK- maximum number of results to return returned.
-
RagOptions
RagOptions(RagService ragService, Double similarityThreshold, Integer topK, HyDE hyDE)
- Parameters:
ragService- the RagService to use for retrievalsimilarityThreshold- minimum similarity threshold for results (0.0 to 1.topK- maximum number of results to return returned.
-
RagOptions
RagOptions(RagService ragService, Double similarityThreshold, Integer topK)
- Parameters:
ragService- the RagService to use for retrievalsimilarityThreshold- minimum similarity threshold for results (0.0 to 1.topK- maximum number of results to return returned.
-
RagOptions
RagOptions(RagService ragService, Double similarityThreshold)
- Parameters:
ragService- the RagService to use for retrievalsimilarityThreshold- minimum similarity threshold for results (0.0 to 1.
-
RagOptions
RagOptions(RagService ragService)
- Parameters:
ragService- the RagService to use for retrieval
-
-
Method Detail
-
getRagService
final RagService getRagService()
-
getSimilarityThreshold
Double getSimilarityThreshold()
-
getDesiredMaxLatency
Duration getDesiredMaxLatency()
-
getCompressionConfig
CompressionConfig getCompressionConfig()
-
getLlm
final LlmOptions getLlm()
-
getContentElementSearch
ContentElementSearch getContentElementSearch()
-
getEntitySearch
EntitySearch getEntitySearch()
-
getRagResponseFormatter
final RagResponseFormatter getRagResponseFormatter()
-
getDualShot
final DualShotConfig getDualShot()
-
withHyDE
RagOptions withHyDE(HyDE hyDE)
-
withSimilarityThreshold
RagOptions withSimilarityThreshold(Double similarityThreshold)
-
withTopK
RagOptions withTopK(Integer topK)
-
withDesiredMaxLatency
RagOptions withDesiredMaxLatency(Duration desiredMaxLatency)
-
withCompression
RagOptions withCompression(CompressionConfig compressionConfig)
-
withContentElementSearch
RagOptions withContentElementSearch(ContentElementSearch contentElementSearch)
-
withEntitySearch
RagOptions withEntitySearch(EntitySearch entitySearch)
-
withDualShot
final RagOptions withDualShot(DualShotConfig dualShot)
-
-
-
-