Service Client: Google::Ai::Generativelanguage::V1beta::RetrieverService::RetrieverServiceClient

Client stub representing the remote RetrieverService gRPC service. Delegates call dispatching to Google::gRPC::Client.

target

The endpoint target address. Defaults to ai.googleapis.com:443.

credentials

The authentication credentials provider. Defaults to application default credentials via Google::Auth.

NAME

Google::Ai::Generativelanguage::V1beta::RetrieverService - Compiled Protocol Buffers messages for google/ai/generativelanguage/v1beta/retriever_service.proto

SYNOPSIS

use Google::Ai::Generativelanguage::V1beta::RetrieverService;

my $msg = Google::Ai::Generativelanguage::V1beta::RetrieverService::CreateCorpusRequest->new({
    corpus => $corpus,
});

# Read or update a field
my $val = $msg->corpus();

# Binary wire-format roundtrip
my $bytes   = $msg->serialize();
my $decoded = Google::Ai::Generativelanguage::V1beta::RetrieverService::CreateCorpusRequest->parse($bytes);

# Canonical ProtoJSON
my $json = $msg->to_json();

DESCRIPTION

Auto-generated Protobuf message classes compiled from google/ai/generativelanguage/v1beta/retriever_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::Ai::Generativelanguage::V1beta::RetrieverService::CreateCorpusRequest

Request to create a `Corpus`.

Inherits from Protobuf::Message.

Accessors

Google::Ai::Generativelanguage::V1beta::RetrieverService::GetCorpusRequest

Request for getting information about a specific `Corpus`.

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. The name of the `Corpus`. Example: `corpora/my-corpus-123`

Google::Ai::Generativelanguage::V1beta::RetrieverService::UpdateCorpusRequest

Request to update a `Corpus`.

Inherits from Protobuf::Message.

Accessors

Google::Ai::Generativelanguage::V1beta::RetrieverService::DeleteCorpusRequest

Request to delete a `Corpus`.

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. The resource name of the `Corpus`. Example: `corpora/my-corpus-123`

  • $msg->force() / $msg->force($value)

    Type: Bool

    Optional. If set to true, any `Document`s and objects related to this `Corpus` will also be deleted.

    If false (the default), a `FAILED_PRECONDITION` error will be returned if `Corpus` contains any `Document`s.

Google::Ai::Generativelanguage::V1beta::RetrieverService::ListCorporaRequest

Request for listing `Corpora`.

Inherits from Protobuf::Message.

Accessors

  • $msg->page_size() / $msg->page_size($value)

    Type: Int32

    Optional. The maximum number of `Corpora` to return (per page). The service may return fewer `Corpora`.

    If unspecified, at most 10 `Corpora` will be returned. The maximum size limit is 20 `Corpora` per page.

  • $msg->page_token() / $msg->page_token($value)

    Type: String

    Optional. A page token, received from a previous `ListCorpora` call.

    Provide the `next_page_token` returned in the response as an argument to the next request to retrieve the next page.

    When paginating, all other parameters provided to `ListCorpora` must match the call that provided the page token.

Google::Ai::Generativelanguage::V1beta::RetrieverService::ListCorporaResponse

Response from `ListCorpora` containing a paginated list of `Corpora`. The results are sorted by ascending `corpus.create_time`.

Inherits from Protobuf::Message.

Accessors

  • $msg->corpora() / $msg->corpora($value)

    Type: Message (Google::Ai::Generativelanguage::V1beta::Retriever::Corpus)

    The returned corpora.

  • $msg->next_page_token() / $msg->next_page_token($value)

    Type: String

    A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.

Google::Ai::Generativelanguage::V1beta::RetrieverService::QueryCorpusRequest

Request for querying a `Corpus`.

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. The name of the `Corpus` to query. Example: `corpora/my-corpus-123`

  • $msg->query() / $msg->query($value)

    Type: String

    Required. Query string to perform semantic search.

  • $msg->metadata_filters() / $msg->metadata_filters($value)

    Type: Message (Google::Ai::Generativelanguage::V1beta::Retriever::MetadataFilter)

    Optional. Filter for `Chunk` and `Document` metadata. Each `MetadataFilter` object should correspond to a unique key. Multiple `MetadataFilter` objects are joined by logical "AND"s.

    Example query at document level: (year >= 2020 OR year < 2010) AND (genre = drama OR genre = action)

    `MetadataFilter` object list: metadata_filters = [ {key = "document.custom_metadata.year" conditions = [{int_value = 2020, operation = GREATER_EQUAL}, {int_value = 2010, operation = LESS}]}, {key = "document.custom_metadata.year" conditions = [{int_value = 2020, operation = GREATER_EQUAL}, {int_value = 2010, operation = LESS}]}, {key = "document.custom_metadata.genre" conditions = [{string_value = "drama", operation = EQUAL}, {string_value = "action", operation = EQUAL}]}]

    Example query at chunk level for a numeric range of values: (year > 2015 AND year <= 2020)

    `MetadataFilter` object list: metadata_filters = [ {key = "chunk.custom_metadata.year" conditions = [{int_value = 2015, operation = GREATER}]}, {key = "chunk.custom_metadata.year" conditions = [{int_value = 2020, operation = LESS_EQUAL}]}]

    Note: "AND"s for the same key are only supported for numeric values. String values only support "OR"s for the same key.

  • $msg->results_count() / $msg->results_count($value)

    Type: Int32

    Optional. The maximum number of `Chunk`s to return. The service may return fewer `Chunk`s.

    If unspecified, at most 10 `Chunk`s will be returned. The maximum specified result count is 100.

Google::Ai::Generativelanguage::V1beta::RetrieverService::QueryCorpusResponse

Response from `QueryCorpus` containing a list of relevant chunks.

Inherits from Protobuf::Message.

Accessors

Google::Ai::Generativelanguage::V1beta::RetrieverService::RelevantChunk

The information for a chunk relevant to a query.

Inherits from Protobuf::Message.

Accessors

Google::Ai::Generativelanguage::V1beta::RetrieverService::CreateDocumentRequest

Request to create a `Document`.

Inherits from Protobuf::Message.

Accessors

  • $msg->parent() / $msg->parent($value)

    Type: String

    Required. The name of the `Corpus` where this `Document` will be created. Example: `corpora/my-corpus-123`

  • $msg->document() / $msg->document($value)

    Type: Message (Google::Ai::Generativelanguage::V1beta::Retriever::Document)

    Required. The `Document` to create.

Google::Ai::Generativelanguage::V1beta::RetrieverService::GetDocumentRequest

Request for getting information about a specific `Document`.

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. The name of the `Document` to retrieve. Example: `corpora/my-corpus-123/documents/the-doc-abc`

Google::Ai::Generativelanguage::V1beta::RetrieverService::UpdateDocumentRequest

Request to update a `Document`.

Inherits from Protobuf::Message.

Accessors

Google::Ai::Generativelanguage::V1beta::RetrieverService::DeleteDocumentRequest

Request to delete a `Document`.

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. The resource name of the `Document` to delete. Example: `corpora/my-corpus-123/documents/the-doc-abc`

  • $msg->force() / $msg->force($value)

    Type: Bool

    Optional. If set to true, any `Chunk`s and objects related to this `Document` will also be deleted.

    If false (the default), a `FAILED_PRECONDITION` error will be returned if `Document` contains any `Chunk`s.

Google::Ai::Generativelanguage::V1beta::RetrieverService::ListDocumentsRequest

Request for listing `Document`s.

Inherits from Protobuf::Message.

Accessors

  • $msg->parent() / $msg->parent($value)

    Type: String

    Required. The name of the `Corpus` containing `Document`s. Example: `corpora/my-corpus-123`

  • $msg->page_size() / $msg->page_size($value)

    Type: Int32

    Optional. The maximum number of `Document`s to return (per page). The service may return fewer `Document`s.

    If unspecified, at most 10 `Document`s will be returned. The maximum size limit is 20 `Document`s per page.

  • $msg->page_token() / $msg->page_token($value)

    Type: String

    Optional. A page token, received from a previous `ListDocuments` call.

    Provide the `next_page_token` returned in the response as an argument to the next request to retrieve the next page.

    When paginating, all other parameters provided to `ListDocuments` must match the call that provided the page token.

Google::Ai::Generativelanguage::V1beta::RetrieverService::ListDocumentsResponse

Response from `ListDocuments` containing a paginated list of `Document`s. The `Document`s are sorted by ascending `document.create_time`.

Inherits from Protobuf::Message.

Accessors

  • $msg->documents() / $msg->documents($value)

    Type: Message (Google::Ai::Generativelanguage::V1beta::Retriever::Document)

    The returned `Document`s.

  • $msg->next_page_token() / $msg->next_page_token($value)

    Type: String

    A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.

Google::Ai::Generativelanguage::V1beta::RetrieverService::QueryDocumentRequest

Request for querying a `Document`.

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. The name of the `Document` to query. Example: `corpora/my-corpus-123/documents/the-doc-abc`

  • $msg->query() / $msg->query($value)

    Type: String

    Required. Query string to perform semantic search.

  • $msg->results_count() / $msg->results_count($value)

    Type: Int32

    Optional. The maximum number of `Chunk`s to return. The service may return fewer `Chunk`s.

    If unspecified, at most 10 `Chunk`s will be returned. The maximum specified result count is 100.

  • $msg->metadata_filters() / $msg->metadata_filters($value)

    Type: Message (Google::Ai::Generativelanguage::V1beta::Retriever::MetadataFilter)

    Optional. Filter for `Chunk` metadata. Each `MetadataFilter` object should correspond to a unique key. Multiple `MetadataFilter` objects are joined by logical "AND"s.

    Note: `Document`-level filtering is not supported for this request because a `Document` name is already specified.

    Example query: (year >= 2020 OR year < 2010) AND (genre = drama OR genre = action)

    `MetadataFilter` object list: metadata_filters = [ {key = "chunk.custom_metadata.year" conditions = [{int_value = 2020, operation = GREATER_EQUAL}, {int_value = 2010, operation = LESS}}, {key = "chunk.custom_metadata.genre" conditions = [{string_value = "drama", operation = EQUAL}, {string_value = "action", operation = EQUAL}}]

    Example query for a numeric range of values: (year > 2015 AND year <= 2020)

    `MetadataFilter` object list: metadata_filters = [ {key = "chunk.custom_metadata.year" conditions = [{int_value = 2015, operation = GREATER}]}, {key = "chunk.custom_metadata.year" conditions = [{int_value = 2020, operation = LESS_EQUAL}]}]

    Note: "AND"s for the same key are only supported for numeric values. String values only support "OR"s for the same key.

Google::Ai::Generativelanguage::V1beta::RetrieverService::QueryDocumentResponse

Response from `QueryDocument` containing a list of relevant chunks.

Inherits from Protobuf::Message.

Accessors

Google::Ai::Generativelanguage::V1beta::RetrieverService::CreateChunkRequest

Request to create a `Chunk`.

Inherits from Protobuf::Message.

Accessors

  • $msg->parent() / $msg->parent($value)

    Type: String

    Required. The name of the `Document` where this `Chunk` will be created. Example: `corpora/my-corpus-123/documents/the-doc-abc`

  • $msg->chunk() / $msg->chunk($value)

    Type: Message (Google::Ai::Generativelanguage::V1beta::Retriever::Chunk)

    Required. The `Chunk` to create.

Google::Ai::Generativelanguage::V1beta::RetrieverService::BatchCreateChunksRequest

Request to batch create `Chunk`s.

Inherits from Protobuf::Message.

Accessors

  • $msg->parent() / $msg->parent($value)

    Type: String

    Optional. The name of the `Document` where this batch of `Chunk`s will be created. The parent field in every `CreateChunkRequest` must match this value. Example: `corpora/my-corpus-123/documents/the-doc-abc`

  • $msg->requests() / $msg->requests($value)

    Type: Message (Google::Ai::Generativelanguage::V1beta::RetrieverService::CreateChunkRequest)

    Required. The request messages specifying the `Chunk`s to create. A maximum of 100 `Chunk`s can be created in a batch.

Google::Ai::Generativelanguage::V1beta::RetrieverService::BatchCreateChunksResponse

Response from `BatchCreateChunks` containing a list of created `Chunk`s.

Inherits from Protobuf::Message.

Accessors

Google::Ai::Generativelanguage::V1beta::RetrieverService::GetChunkRequest

Request for getting information about a specific `Chunk`.

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. The name of the `Chunk` to retrieve. Example: `corpora/my-corpus-123/documents/the-doc-abc/chunks/some-chunk`

Google::Ai::Generativelanguage::V1beta::RetrieverService::UpdateChunkRequest

Request to update a `Chunk`.

Inherits from Protobuf::Message.

Accessors

Google::Ai::Generativelanguage::V1beta::RetrieverService::BatchUpdateChunksRequest

Request to batch update `Chunk`s.

Inherits from Protobuf::Message.

Accessors

  • $msg->parent() / $msg->parent($value)

    Type: String

    Optional. The name of the `Document` containing the `Chunk`s to update. The parent field in every `UpdateChunkRequest` must match this value. Example: `corpora/my-corpus-123/documents/the-doc-abc`

  • $msg->requests() / $msg->requests($value)

    Type: Message (Google::Ai::Generativelanguage::V1beta::RetrieverService::UpdateChunkRequest)

    Required. The request messages specifying the `Chunk`s to update. A maximum of 100 `Chunk`s can be updated in a batch.

Google::Ai::Generativelanguage::V1beta::RetrieverService::BatchUpdateChunksResponse

Response from `BatchUpdateChunks` containing a list of updated `Chunk`s.

Inherits from Protobuf::Message.

Accessors

Google::Ai::Generativelanguage::V1beta::RetrieverService::DeleteChunkRequest

Request to delete a `Chunk`.

Inherits from Protobuf::Message.

Accessors

  • $msg->name() / $msg->name($value)

    Type: String

    Required. The resource name of the `Chunk` to delete. Example: `corpora/my-corpus-123/documents/the-doc-abc/chunks/some-chunk`

Google::Ai::Generativelanguage::V1beta::RetrieverService::BatchDeleteChunksRequest

Request to batch delete `Chunk`s.

Inherits from Protobuf::Message.

Accessors

  • $msg->parent() / $msg->parent($value)

    Type: String

    Optional. The name of the `Document` containing the `Chunk`s to delete. The parent field in every `DeleteChunkRequest` must match this value. Example: `corpora/my-corpus-123/documents/the-doc-abc`

  • $msg->requests() / $msg->requests($value)

    Type: Message (Google::Ai::Generativelanguage::V1beta::RetrieverService::DeleteChunkRequest)

    Required. The request messages specifying the `Chunk`s to delete.

Google::Ai::Generativelanguage::V1beta::RetrieverService::ListChunksRequest

Request for listing `Chunk`s.

Inherits from Protobuf::Message.

Accessors

  • $msg->parent() / $msg->parent($value)

    Type: String

    Required. The name of the `Document` containing `Chunk`s. Example: `corpora/my-corpus-123/documents/the-doc-abc`

  • $msg->page_size() / $msg->page_size($value)

    Type: Int32

    Optional. The maximum number of `Chunk`s to return (per page). The service may return fewer `Chunk`s.

    If unspecified, at most 10 `Chunk`s will be returned. The maximum size limit is 100 `Chunk`s per page.

  • $msg->page_token() / $msg->page_token($value)

    Type: String

    Optional. A page token, received from a previous `ListChunks` call.

    Provide the `next_page_token` returned in the response as an argument to the next request to retrieve the next page.

    When paginating, all other parameters provided to `ListChunks` must match the call that provided the page token.

Google::Ai::Generativelanguage::V1beta::RetrieverService::ListChunksResponse

Response from `ListChunks` containing a paginated list of `Chunk`s. The `Chunk`s are sorted by ascending `chunk.create_time`.

Inherits from Protobuf::Message.

Accessors

  • $msg->chunks() / $msg->chunks($value)

    Type: Message (Google::Ai::Generativelanguage::V1beta::Retriever::Chunk)

    The returned `Chunk`s.

  • $msg->next_page_token() / $msg->next_page_token($value)

    Type: String

    A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.

SEE ALSO

Protobuf, Protobuf::Message, Google::Ai::Generativelanguage::V1beta::RetrieverService::Types, https://protobuf.dev/

LICENSE AND COPYRIGHT

Copyright (C) 2026 Google LLC

This program is released under the Apache 2.0 license.