#[non_exhaustive]pub struct RankRequest {
pub ranking_config: String,
pub model: String,
pub top_n: i32,
pub query: String,
pub records: Vec<RankingRecord>,
pub ignore_record_details_in_response: bool,
pub user_labels: HashMap<String, String>,
/* private fields */
}rank-service only.Expand description
Request message for RankService.Rank method.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.ranking_config: StringRequired. The resource name of the rank service config, such as
projects/{project_num}/locations/{location}/rankingConfigs/default_ranking_config.
model: StringThe identifier of the model to use. It is one of:
semantic-ranker-512@latest: Semantic ranking model with maximum input token size 512.
It is set to semantic-ranker-512@latest by default if unspecified.
top_n: i32The number of results to return. If this is unset or no bigger than zero, returns all results.
query: StringThe query to use.
records: Vec<RankingRecord>Required. A list of records to rank. At most 200 records to rank.
ignore_record_details_in_response: boolIf true, the response will contain only record ID and score. By default, it is false, the response will contain record details.
user_labels: HashMap<String, String>The user labels applied to a resource must meet the following requirements:
- Each resource can have multiple labels, up to a maximum of 64.
- Each label must be a key-value pair.
- Keys have a minimum length of 1 character and a maximum length of 63 characters and cannot be empty. Values can be empty and have a maximum length of 63 characters.
- Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed.
- The key portion of a label must be unique. However, you can use the same key with multiple resources.
- Keys must start with a lowercase letter or international character.
See Google Cloud Document for more details.
Implementations§
Source§impl RankRequest
impl RankRequest
Sourcepub fn set_ranking_config<T: Into<String>>(self, v: T) -> Self
pub fn set_ranking_config<T: Into<String>>(self, v: T) -> Self
Sets the value of ranking_config.
§Example
let x = RankRequest::new().set_ranking_config("example");Sourcepub fn set_records<T, V>(self, v: T) -> Self
pub fn set_records<T, V>(self, v: T) -> Self
Sourcepub fn set_ignore_record_details_in_response<T: Into<bool>>(self, v: T) -> Self
pub fn set_ignore_record_details_in_response<T: Into<bool>>(self, v: T) -> Self
Sets the value of ignore_record_details_in_response.
§Example
let x = RankRequest::new().set_ignore_record_details_in_response(true);Sourcepub fn set_user_labels<T, K, V>(self, v: T) -> Self
pub fn set_user_labels<T, K, V>(self, v: T) -> Self
Sets the value of user_labels.
§Example
let x = RankRequest::new().set_user_labels([
("key0", "abc"),
("key1", "xyz"),
]);Trait Implementations§
Source§impl Clone for RankRequest
impl Clone for RankRequest
Source§fn clone(&self) -> RankRequest
fn clone(&self) -> RankRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RankRequest
impl Debug for RankRequest
Source§impl Default for RankRequest
impl Default for RankRequest
Source§fn default() -> RankRequest
fn default() -> RankRequest
Source§impl Message for RankRequest
impl Message for RankRequest
Source§impl PartialEq for RankRequest
impl PartialEq for RankRequest
impl StructuralPartialEq for RankRequest
Auto Trait Implementations§
impl Freeze for RankRequest
impl RefUnwindSafe for RankRequest
impl Send for RankRequest
impl Sync for RankRequest
impl Unpin for RankRequest
impl UnsafeUnpin for RankRequest
impl UnwindSafe for RankRequest
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request