NAME

Google::Ai::Generativelanguage::V1alpha::Content - Compiled Protocol Buffers messages for google/ai/generativelanguage/v1alpha/content.proto

SYNOPSIS

use Google::Ai::Generativelanguage::V1alpha::Content;

my $msg = Google::Ai::Generativelanguage::V1alpha::Content::Content->new({
    parts => $parts,
    role => $role,
});

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

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

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

DESCRIPTION

Auto-generated Protobuf message classes compiled from google/ai/generativelanguage/v1alpha/content.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::V1alpha::Content::Content

The base structured datatype containing multi-part content of a message.

A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn.

Inherits from Protobuf::Message.

Accessors

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

    Type: Message (Google::Ai::Generativelanguage::V1alpha::Content::Part)

    Ordered `Parts` that constitute a single message. Parts may have different MIME types.

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

    Type: String

    Optional. The producer of the content. Must be either 'user' or 'model'.

    Useful to set for multi-turn conversations, otherwise can be left blank or unset.

Google::Ai::Generativelanguage::V1alpha::Content::Part

A datatype containing media that is part of a multi-part `Content` message.

A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`.

A `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.

Inherits from Protobuf::Message.

Accessors

Google::Ai::Generativelanguage::V1alpha::Content::Blob

Raw media bytes.

Text should not be sent as raw bytes, use the 'text' field.

Inherits from Protobuf::Message.

Accessors

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

    Type: String

    The IANA standard MIME type of the source data. Examples: - image/png - image/jpeg If an unsupported MIME type is provided, an error will be returned. For a complete list of supported types, see [Supported file formats](https://ai.google.dev/gemini-api/docs/prompting_with_media#supported_file_formats).

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

    Type: Bytes

    Raw bytes for media formats.

Google::Ai::Generativelanguage::V1alpha::Content::FileData

URI based data.

Inherits from Protobuf::Message.

Accessors

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

    Type: String

    Optional. The IANA standard MIME type of the source data.

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

    Type: String

    Required. URI.

Google::Ai::Generativelanguage::V1alpha::Content::ExecutableCode

Code generated by the model that is meant to be executed, and the result returned to the model.

Only generated when using the `CodeExecution` tool, in which the code will be automatically executed, and a corresponding `CodeExecutionResult` will also be generated.

Inherits from Protobuf::Message.

Accessors

Enum: ExecutableCode::Language

  • LANGUAGE_UNSPECIFIED => 0

  • PYTHON => 1

Google::Ai::Generativelanguage::V1alpha::Content::CodeExecutionResult

Result of executing the `ExecutableCode`.

Only generated when using the `CodeExecution`, and always follows a `part` containing the `ExecutableCode`.

Inherits from Protobuf::Message.

Accessors

Enum: CodeExecutionResult::Outcome

  • OUTCOME_UNSPECIFIED => 0

  • OUTCOME_OK => 1

  • OUTCOME_FAILED => 2

  • OUTCOME_DEADLINE_EXCEEDED => 3

Google::Ai::Generativelanguage::V1alpha::Content::Tool

Tool details that the model may use to generate response.

A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model.

Inherits from Protobuf::Message.

Accessors

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

    Type: Message (Google::Ai::Generativelanguage::V1alpha::Content::FunctionDeclaration)

    Optional. A list of `FunctionDeclarations` available to the model that can be used for function calling.

    The model or system does not execute the function. Instead the defined function may be returned as a [FunctionCall][google.ai.generativelanguage.v1alpha.Part.function_call] with arguments to the client side for execution. The model may decide to call a subset of these functions by populating [FunctionCall][google.ai.generativelanguage.v1alpha.Part.function_call] in the response. The next conversation turn may contain a [FunctionResponse][google.ai.generativelanguage.v1alpha.Part.function_response] with the [Content.role][google.ai.generativelanguage.v1alpha.Content.role] "function" generation context for the next model turn.

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

    Type: Message (Google::Ai::Generativelanguage::V1alpha::Content::GoogleSearchRetrieval)

    Optional. Retrieval tool that is powered by Google search.

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

    Type: Message (Google::Ai::Generativelanguage::V1alpha::Content::CodeExecution)

    Optional. Enables the model to execute code as part of generation.

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

    Type: Message (Google::Ai::Generativelanguage::V1alpha::Content::Tool::GoogleSearch)

    Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.

Google::Ai::Generativelanguage::V1alpha::Content::GoogleSearchRetrieval

Tool to retrieve public web data for grounding, powered by Google.

Inherits from Protobuf::Message.

Accessors

Google::Ai::Generativelanguage::V1alpha::Content::DynamicRetrievalConfig

Describes the options to customize dynamic retrieval.

Inherits from Protobuf::Message.

Accessors

Enum: DynamicRetrievalConfig::Mode

  • MODE_UNSPECIFIED => 0

  • MODE_DYNAMIC => 1

Google::Ai::Generativelanguage::V1alpha::Content::CodeExecution

Tool that executes code generated by the model, and automatically returns the result to the model.

See also `ExecutableCode` and `CodeExecutionResult` which are only generated when using this tool.

Inherits from Protobuf::Message.

Google::Ai::Generativelanguage::V1alpha::Content::ToolConfig

The Tool configuration containing parameters for specifying `Tool` use in the request.

Inherits from Protobuf::Message.

Accessors

Google::Ai::Generativelanguage::V1alpha::Content::FunctionCallingConfig

Configuration for specifying function calling behavior.

Inherits from Protobuf::Message.

Accessors

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

    Type: Enum (Google::Ai::Generativelanguage::V1alpha::FunctionCallingConfig::Mode)

    Optional. Specifies the mode in which function calling should execute. If unspecified, the default value will be set to AUTO.

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

    Type: String

    Optional. A set of function names that, when provided, limits the functions the model will call.

    This should only be set when the Mode is ANY. Function names should match [FunctionDeclaration.name]. With mode set to ANY, model will predict a function call from the set of function names provided.

Enum: FunctionCallingConfig::Mode

  • MODE_UNSPECIFIED => 0

  • AUTO => 1

  • ANY => 2

  • NONE => 3

Google::Ai::Generativelanguage::V1alpha::Content::FunctionDeclaration

Structured representation of a function declaration as defined by the [OpenAPI 3.03 specification](https://spec.openapis.org/oas/v3.0.3). Included in this declaration are the function name and parameters. This FunctionDeclaration is a representation of a block of code that can be used as a `Tool` by the model and executed by the client.

Inherits from Protobuf::Message.

Accessors

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

    Type: String

    Required. The name of the function. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 63.

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

    Type: String

    Required. A brief description of the function.

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

    Type: Message (Google::Ai::Generativelanguage::V1alpha::Content::Schema)

    Optional. Describes the parameters to this function. Reflects the Open API 3.03 Parameter Object string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter.

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

    Type: Message (Google::Ai::Generativelanguage::V1alpha::Content::Schema)

    Optional. Describes the output from this function in JSON Schema format. Reflects the Open API 3.03 Response Object. The Schema defines the type used for the response value of the function.

Google::Ai::Generativelanguage::V1alpha::Content::FunctionCall

A predicted `FunctionCall` returned from the model that contains a string representing the `FunctionDeclaration.name` with the arguments and their values.

Inherits from Protobuf::Message.

Accessors

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

    Type: String

    Optional. The unique id of the function call. If populated, the client to execute the `function_call` and return the response with the matching `id`.

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

    Type: String

    Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 63.

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

    Type: Message (Google::Protobuf::Struct::Struct)

    Optional. The function parameters and values in JSON object format.

Google::Ai::Generativelanguage::V1alpha::Content::FunctionResponse

The result output from a `FunctionCall` that contains a string representing the `FunctionDeclaration.name` and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a`FunctionCall` made based on model prediction.

Inherits from Protobuf::Message.

Accessors

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

    Type: String

    Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.

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

    Type: String

    Required. The name of the function to call. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 63.

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

    Type: Message (Google::Protobuf::Struct::Struct)

    Required. The function response in JSON object format.

Google::Ai::Generativelanguage::V1alpha::Content::Schema

The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema).

Inherits from Protobuf::Message.

Accessors

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

    Type: Enum (Google::Ai::Generativelanguage::V1alpha::Type)

    Required. Data type.

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

    Type: String

    Optional. The format of the data. This is used only for primitive datatypes. Supported formats: for NUMBER type: float, double for INTEGER type: int32, int64 for STRING type: enum

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

    Type: String

    Optional. A brief description of the parameter. This could contain examples of use. Parameter description may be formatted as Markdown.

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

    Type: Bool

    Optional. Indicates if the value may be null.

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

    Type: String

    Optional. Possible values of the element of Type.STRING with enum format. For example we can define an Enum Direction as : {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]}

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

    Type: Message (Google::Ai::Generativelanguage::V1alpha::Content::Schema)

    Optional. Schema of the elements of Type.ARRAY.

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

    Type: Int64

    Optional. Maximum number of the elements for Type.ARRAY.

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

    Type: Int64

    Optional. Minimum number of the elements for Type.ARRAY.

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

    Type: Message (Google::Ai::Generativelanguage::V1alpha::Content::Schema::PropertiesEntry)

    Optional. Properties of Type.OBJECT.

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

    Type: String

    Optional. Required properties of Type.OBJECT.

Google::Ai::Generativelanguage::V1alpha::Content::GroundingPassage

Passage included inline with a grounding configuration.

Inherits from Protobuf::Message.

Accessors

Google::Ai::Generativelanguage::V1alpha::Content::GroundingPassages

A repeated list of passages.

Inherits from Protobuf::Message.

Accessors

SEE ALSO

Protobuf, Protobuf::Message, Google::Ai::Generativelanguage::V1alpha::Content::Types, https://protobuf.dev/

LICENSE AND COPYRIGHT

Copyright (C) 2026 Google LLC

This program is released under the Apache 2.0 license.