#[non_exhaustive]pub struct RagRetrievalConfig {
pub top_k: i32,
pub filter: Option<Filter>,
pub ranking: Option<Ranking>,
/* private fields */
}Available on crate features
gen-ai-cache-service or llm-utility-service or prediction-service or vertex-rag-service only.Expand description
Specifies the context retrieval config.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.top_k: i32Optional. The number of contexts to retrieve.
filter: Option<Filter>Optional. Config for filters.
ranking: Option<Ranking>Optional. Config for ranking and reranking.
Implementations§
Source§impl RagRetrievalConfig
impl RagRetrievalConfig
pub fn new() -> Self
Sourcepub fn set_filter<T>(self, v: T) -> Self
pub fn set_filter<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_filter<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_filter<T>(self, v: Option<T>) -> Self
Sourcepub fn set_ranking<T>(self, v: T) -> Self
pub fn set_ranking<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_ranking<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_ranking<T>(self, v: Option<T>) -> Self
Trait Implementations§
Source§impl Clone for RagRetrievalConfig
impl Clone for RagRetrievalConfig
Source§fn clone(&self) -> RagRetrievalConfig
fn clone(&self) -> RagRetrievalConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RagRetrievalConfig
impl Debug for RagRetrievalConfig
Source§impl Default for RagRetrievalConfig
impl Default for RagRetrievalConfig
Source§fn default() -> RagRetrievalConfig
fn default() -> RagRetrievalConfig
Returns the “default value” for a type. Read more
Source§impl Message for RagRetrievalConfig
impl Message for RagRetrievalConfig
Source§impl PartialEq for RagRetrievalConfig
impl PartialEq for RagRetrievalConfig
impl StructuralPartialEq for RagRetrievalConfig
Auto Trait Implementations§
impl Freeze for RagRetrievalConfig
impl RefUnwindSafe for RagRetrievalConfig
impl Send for RagRetrievalConfig
impl Sync for RagRetrievalConfig
impl Unpin for RagRetrievalConfig
impl UnwindSafe for RagRetrievalConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more