Service Client: Google::Cloud::Discoveryengine::V1::RankService::RankServiceClient
Client stub representing the remote RankService gRPC service. Delegates call dispatching to Google::gRPC::Client.
target
The endpoint target address. Defaults to discoveryengine.googleapis.com:443.
credentials
The authentication credentials provider. Defaults to application default credentials via Google::Auth.
NAME
Google::Cloud::Discoveryengine::V1::RankService - Compiled Protocol Buffers messages for google/cloud/discoveryengine/v1/rank_service.proto
SYNOPSIS
use Google::Cloud::Discoveryengine::V1::RankService;
my $msg = Google::Cloud::Discoveryengine::V1::RankService::RankingRecord->new({
id => $id,
title => $title,
content => $content,
score => $score,
});
# Read or update a field
my $val = $msg->id();
# Binary wire-format roundtrip
my $bytes = $msg->serialize();
my $decoded = Google::Cloud::Discoveryengine::V1::RankService::RankingRecord->parse($bytes);
# Canonical ProtoJSON
my $json = $msg->to_json();
DESCRIPTION
Auto-generated Protobuf message classes compiled from google/cloud/discoveryengine/v1/rank_service.proto. All message classes inherit from Protobuf::Message and support new(), serialize(), parse(), to_json(), from_json(), to_text(), and to_perl().
MESSAGES
Google::Cloud::Discoveryengine::V1::RankService::RankingRecord
Record message for [RankService.Rank][google.cloud.discoveryengine.v1.RankService.Rank] method.
Inherits from Protobuf::Message.
Accessors
$msg->id()/$msg->id($value)Type:
StringThe unique ID to represent the record.
$msg->title()/$msg->title($value)Type:
StringThe title of the record. Empty by default. At least one of [title][google.cloud.discoveryengine.v1.RankingRecord.title] or [content][google.cloud.discoveryengine.v1.RankingRecord.content] should be set otherwise an INVALID_ARGUMENT error is thrown.
$msg->content()/$msg->content($value)Type:
StringThe content of the record. Empty by default. At least one of [title][google.cloud.discoveryengine.v1.RankingRecord.title] or [content][google.cloud.discoveryengine.v1.RankingRecord.content] should be set otherwise an INVALID_ARGUMENT error is thrown.
$msg->score()/$msg->score($value)Type:
FloatThe score of this record based on the given query and selected model. The score will be rounded to 4 decimal places. If the score is close to 0, it will be rounded to 0.00001 to avoid returning unset.
Google::Cloud::Discoveryengine::V1::RankService::RankRequest
Request message for [RankService.Rank][google.cloud.discoveryengine.v1.RankService.Rank] method.
Inherits from Protobuf::Message.
Accessors
$msg->ranking_config()/$msg->ranking_config($value)Type:
StringRequired. The resource name of the rank service config, such as `projects/{project_num}/locations/{location}/rankingConfigs/default_ranking_config`.
$msg->model()/$msg->model($value)Type:
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.
$msg->top_n()/$msg->top_n($value)Type:
Int32The number of results to return. If this is unset or no bigger than zero, returns all results.
$msg->query()/$msg->query($value)Type:
StringThe query to use.
$msg->records()/$msg->records($value)Type:
Message(Google::Cloud::Discoveryengine::V1::RankService::RankingRecord)Required. A list of records to rank.
$msg->ignore_record_details_in_response()/$msg->ignore_record_details_in_response($value)Type:
BoolIf true, the response will contain only record ID and score. By default, it is false, the response will contain record details.
$msg->user_labels()/$msg->user_labels($value)Type:
Message(Google::Cloud::Discoveryengine::V1::RankService::RankRequest::UserLabelsEntry)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](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) for more details.
Google::Cloud::Discoveryengine::V1::RankService::RankResponse
Response message for [RankService.Rank][google.cloud.discoveryengine.v1.RankService.Rank] method.
Inherits from Protobuf::Message.
Accessors
$msg->records()/$msg->records($value)Type:
Message(Google::Cloud::Discoveryengine::V1::RankService::RankingRecord)A list of records sorted by descending score.
SEE ALSO
Protobuf, Protobuf::Message, Google::Cloud::Discoveryengine::V1::RankService::Types, https://protobuf.dev/
LICENSE AND COPYRIGHT
Copyright (C) 2026 Google LLC
This program is released under the Apache 2.0 license.