Service Client: Google::Developers::Knowledge::V1alpha::Developerknowledge::DeveloperKnowledgeClient

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

target

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

credentials

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

NAME

Google::Developers::Knowledge::V1alpha::Developerknowledge - Compiled Protocol Buffers messages for google/developers/knowledge/v1alpha/developerknowledge.proto

SYNOPSIS

use Google::Developers::Knowledge::V1alpha::Developerknowledge;

my $msg = Google::Developers::Knowledge::V1alpha::Developerknowledge::Document->new({
    name => $name,
    uri => $uri,
    content => $content,
    description => $description,
});

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

# Binary wire-format roundtrip
my $bytes   = $msg->serialize();
my $decoded = Google::Developers::Knowledge::V1alpha::Developerknowledge::Document->parse($bytes);

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

DESCRIPTION

Auto-generated Protobuf message classes compiled from google/developers/knowledge/v1alpha/developerknowledge.proto. All message classes inherit from Protobuf::Message and support new(), serialize(), parse(), to_json(), from_json(), to_text(), and to_perl().

MESSAGES

Google::Developers::Knowledge::V1alpha::Developerknowledge::Document

A Document represents a page of documentation in the Developer Knowledge corpus, like the page at https://docs.cloud.google.com/storage/docs/creating-buckets.

Inherits from Protobuf::Message.

Accessors

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

    Type: String

    Identifier. Contains the resource name of the document. Format: `documents/{uri_without_scheme}` Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets`

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

    Type: String

    Output only. Provides the URI of the content, such as `https://docs.cloud.google.com/storage/docs/creating-buckets`.

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

    Type: String

    Output only. Contains the full content of the document in Markdown format.

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

    Type: String

    Output only. Provides a description of the document.

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

    Type: String

    Output only. Specifies the data source of the document. Example data source: `firebase.google.com`

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

    Type: String

    Output only. Provides the title of the document.

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

    Type: Message (Google::Protobuf::Timestamp::Timestamp)

    Output only. Represents the timestamp when the content or metadata of the document was last updated.

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

    Type: Enum (Google::Developers::Knowledge::V1alpha::DocumentView)

    Output only. Specifies the [DocumentView][google.developers.knowledge.v1alpha.DocumentView] of the document.

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

    Type: Int32

    Output only. The length of the `content` field in bytes.

Google::Developers::Knowledge::V1alpha::Developerknowledge::SearchDocumentChunksRequest

Request message for [DeveloperKnowledge.SearchDocumentChunks][google.developers.knowledge.v1alpha.DeveloperKnowledge.SearchDocumentChunks].

Inherits from Protobuf::Message.

Accessors

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

    Type: String

    Required. Provides the raw query string provided by the user, such as "How to create a Cloud Storage bucket?". The query must not exceed 500 characters; values longer than 500 characters will result in an `INVALID_ARGUMENT` error.

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

    Type: Int32

    Optional. Specifies the maximum number of results to return. The service may return fewer than this value.

    If unspecified, at most 5 results will be returned.

    The maximum value is 100; values above 100 will be coerced to 100.

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

    Type: String

    Optional. Contains a page token, received from a previous `SearchDocumentChunks` call. Provide this to retrieve the subsequent page.

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

    Type: String

    Optional. Applies a strict filter to the search results. The expression supports a subset of the syntax described at https://google.aip.dev/160.

    While `SearchDocumentChunks` returns [DocumentChunk][google.developers.knowledge.v1alpha.DocumentChunk]s, the filter is applied to `DocumentChunk.document` fields.

    Supported fields for filtering:

    * `content_length_bytes` (INTEGER): The length of the `Document.content` field in bytes. * `data_source` (STRING): The source of the document, e.g. `docs.cloud.google.com`. See https://developers.google.com/knowledge/reference/corpus-reference for the complete list of data sources in the corpus. * `update_time` (TIMESTAMP): The timestamp of when the document was last meaningfully updated. A meaningful update is one that changes document's markdown content or metadata. * `uri` (STRING): The document URI, e.g. `https://docs.cloud.google.com/bigquery/docs/tables`.

    INTEGER fields support `=`, `<`, `<=`, `>`, and `>=` operators.

    STRING fields support `=` (equals) and `!=` (not equals) operators for exact match on the whole string. Partial match, prefix match, and regexp match are not supported.

    TIMESTAMP fields support `=`, `<`, `<=`, `>`, and `>=` operators. Timestamps must be in RFC-3339 format, e.g., `"2025-01-01T00:00:00Z"`.

    Note: Field names must be in `snake_case` (e.g., `data_source`). Values on the right-hand side of filtering expressions must be string literals enclosed in double quotes (e.g., `"docs.cloud.google.com"`).

    You can combine expressions using `AND`, `OR`, and `NOT` (or `-`) logical operators. `OR` has higher precedence than `AND`. Use parentheses for explicit precedence grouping.

    Examples:

    * Filter by `Document.content_length_bytes`: `content_length_bytes < 50000` * `data_source = "docs.cloud.google.com" OR data_source = "firebase.google.com"` * `data_source != "firebase.google.com"` * `update_time < "2024-01-01T00:00:00Z"` * `update_time >= "2025-01-22T00:00:00Z" AND (data_source = "developer.chrome.com" OR data_source = "web.dev")` * `uri = "https://docs.cloud.google.com/release-notes"`

    The `filter` string must not exceed 500 characters; values longer than 500 characters will result in an `INVALID_ARGUMENT` error.

Google::Developers::Knowledge::V1alpha::Developerknowledge::SearchDocumentChunksResponse

Response message for [DeveloperKnowledge.SearchDocumentChunks][google.developers.knowledge.v1alpha.DeveloperKnowledge.SearchDocumentChunks].

Inherits from Protobuf::Message.

Accessors

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

    Type: Message (Google::Developers::Knowledge::V1alpha::Developerknowledge::DocumentChunk)

    Contains the search results for the given query. Each [DocumentChunk][google.developers.knowledge.v1alpha.DocumentChunk] in this list contains a snippet of content relevant to the search query. Use the [DocumentChunk.parent][google.developers.knowledge.v1alpha.DocumentChunk.parent] field of each result with [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1alpha.DeveloperKnowledge.GetDocument] or [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1alpha.DeveloperKnowledge.BatchGetDocuments] to retrieve the full document content.

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

    Type: String

    Provides a token that can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.

Google::Developers::Knowledge::V1alpha::Developerknowledge::GetDocumentRequest

Request message for [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1alpha.DeveloperKnowledge.GetDocument].

Inherits from Protobuf::Message.

Accessors

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

    Type: String

    Required. Specifies the name of the document to retrieve. Format: `documents/{uri_without_scheme}` Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets`

    The name must not exceed 500 characters; values longer than 500 characters will result in an `INVALID_ARGUMENT` error.

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

    Type: Enum (Google::Developers::Knowledge::V1alpha::DocumentView)

    Optional. Specifies the [DocumentView][google.developers.knowledge.v1alpha.DocumentView] of the document. If unspecified, [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1alpha.DeveloperKnowledge.GetDocument] defaults to `DOCUMENT_VIEW_CONTENT`.

Google::Developers::Knowledge::V1alpha::Developerknowledge::BatchGetDocumentsRequest

Request message for [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1alpha.DeveloperKnowledge.BatchGetDocuments].

Inherits from Protobuf::Message.

Accessors

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

    Type: String

    Required. Specifies the names of the documents to retrieve. A maximum of 20 documents can be retrieved in a batch. The documents are returned in the same order as the `names` in the request.

    Format: `documents/{uri_without_scheme}` Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets`

    Each name must not exceed 500 characters; values longer than 500 characters will result in an `INVALID_ARGUMENT` error.

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

    Type: Enum (Google::Developers::Knowledge::V1alpha::DocumentView)

    Optional. Specifies the [DocumentView][google.developers.knowledge.v1alpha.DocumentView] of the document. If unspecified, [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1alpha.DeveloperKnowledge.BatchGetDocuments] defaults to `DOCUMENT_VIEW_CONTENT`.

Google::Developers::Knowledge::V1alpha::Developerknowledge::BatchGetDocumentsResponse

Response message for [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1alpha.DeveloperKnowledge.BatchGetDocuments].

Inherits from Protobuf::Message.

Accessors

Google::Developers::Knowledge::V1alpha::Developerknowledge::AnswerQueryRequest

Request message for [DeveloperKnowledge.AnswerQuery][google.developers.knowledge.v1alpha.DeveloperKnowledge.AnswerQuery].

Inherits from Protobuf::Message.

Accessors

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

    Type: String

    Required. The query to answer.

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

    Type: String

    Optional. Applies a strict filter to the search results used to ground the answer. The expression supports a subset of the syntax described at https://google.aip.dev/160.

    Supported fields for filtering:

    * `content_length_bytes` (INTEGER): The length of the `Document.content` field in bytes. * `data_source` (STRING): The source of the document, e.g. `docs.cloud.google.com`. See https://developers.google.com/knowledge/reference/corpus-reference for the complete list of data sources in the corpus. * `update_time` (TIMESTAMP): The timestamp of when the document was last meaningfully updated. A meaningful update is one that changes document's markdown content or metadata. * `uri` (STRING): The document URI, e.g. `https://docs.cloud.google.com/bigquery/docs/tables`.

    INTEGER fields support `=`, `<`, `<=`, `>`, and `>=` operators.

    STRING fields support `=` (equals) and `!=` (not equals) operators for exact match on the whole string. Partial match, prefix match, and regexp match are not supported.

    TIMESTAMP fields support `=`, `<`, `<=`, `>`, and `>=` operators. Timestamps must be in RFC-3339 format, e.g., `"2025-01-01T00:00:00Z"`.

    You can combine expressions using `AND`, `OR`, and `NOT` (or `-`) logical operators. `OR` has higher precedence than `AND`. Use parentheses for explicit precedence grouping.

    Examples:

    * Filter by `Document.content_length_bytes`: `content_length_bytes < 50000` * `data_source = "docs.cloud.google.com" OR data_source = "firebase.google.com"` * `data_source != "firebase.google.com"` * `update_time < "2024-01-01T00:00:00Z"` * `update_time >= "2025-01-22T00:00:00Z" AND (data_source = "developer.chrome.com" OR data_source = "web.dev")` * `uri = "https://docs.cloud.google.com/release-notes"`

    The `filter` string must not exceed 500 characters; values longer than 500 characters will result in an `INVALID_ARGUMENT` error.

Google::Developers::Knowledge::V1alpha::Developerknowledge::AnswerQueryResponse

Response message for [DeveloperKnowledge.AnswerQuery][google.developers.knowledge.v1alpha.DeveloperKnowledge.AnswerQuery].

Inherits from Protobuf::Message.

Accessors

Google::Developers::Knowledge::V1alpha::Developerknowledge::Answer

An answer to a query.

Inherits from Protobuf::Message.

Accessors

Google::Developers::Knowledge::V1alpha::Developerknowledge::DocumentChunk

A DocumentChunk represents a piece of content from a [Document][google.developers.knowledge.v1alpha.Document] in the DeveloperKnowledge corpus. To fetch the entire document content, pass the `parent` to [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1alpha.DeveloperKnowledge.GetDocument] or [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1alpha.DeveloperKnowledge.BatchGetDocuments].

Inherits from Protobuf::Message.

Accessors

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

    Type: String

    Output only. Contains the resource name of the document this chunk is from. Format: `documents/{uri_without_scheme}` Example: `documents/docs.cloud.google.com/storage/docs/creating-buckets`

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

    Type: String

    Output only. Specifies the ID of this chunk within the document. The chunk ID is unique within a document, but not globally unique across documents. The chunk ID is not stable and may change over time.

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

    Type: String

    Output only. Contains the content of the document chunk.

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

    Type: Message (Google::Developers::Knowledge::V1alpha::Developerknowledge::Document)

    Output only. Represents metadata about the [Document][google.developers.knowledge.v1alpha.Document] this chunk is from. The [DocumentView][google.developers.knowledge.v1alpha.DocumentView] of this [Document][google.developers.knowledge.v1alpha.Document] message will be set to `DOCUMENT_VIEW_BASIC`. It is included here for convenience so that clients do not need to call [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1alpha.DeveloperKnowledge.GetDocument] or [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1alpha.DeveloperKnowledge.BatchGetDocuments] if they only need the metadata fields. Otherwise, clients should use [DeveloperKnowledge.GetDocument][google.developers.knowledge.v1alpha.DeveloperKnowledge.GetDocument] or [DeveloperKnowledge.BatchGetDocuments][google.developers.knowledge.v1alpha.DeveloperKnowledge.BatchGetDocuments] to fetch the full document content.

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

    Type: Double

    Output only. Represents the relevance score of the chunk to the search query. Higher score indicates higher chunk relevance. The score is in range [0.0, 1.0].

SEE ALSO

Protobuf, Protobuf::Message, Google::Developers::Knowledge::V1alpha::Developerknowledge::Types, https://protobuf.dev/

LICENSE AND COPYRIGHT

Copyright (C) 2026 Google LLC

This program is released under the Apache 2.0 license.