NAME

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

SYNOPSIS

use Google::Ai::Generativelanguage::V1beta::Content;

my $msg = Google::Ai::Generativelanguage::V1beta::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::V1beta::Content::Content->parse($bytes);

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

DESCRIPTION

Auto-generated Protobuf message classes compiled from google/ai/generativelanguage/v1beta/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::V1beta::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::V1beta::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::V1beta::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::V1beta::Content::FunctionResponsePart

A datatype containing media that is part of a `FunctionResponse` message.

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

A `FunctionResponsePart` 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::V1beta::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::V1beta::Content::FunctionResponseBlob

Raw media bytes for function response.

Text should not be sent as raw bytes, use the 'FunctionResponse.response' 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::V1beta::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::V1beta::Content::VideoMetadata

Metadata describes the input video content.

Inherits from Protobuf::Message.

Accessors

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

    Type: Message (Google::Protobuf::Duration::Duration)

    Optional. The start offset of the video.

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

    Type: Message (Google::Protobuf::Duration::Duration)

    Optional. The end offset of the video.

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

    Type: Double

    Optional. The frame rate of the video sent to the model. If not specified, the default value will be 1.0. The fps range is (0.0, 24.0].

Google::Ai::Generativelanguage::V1beta::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::V1beta::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::V1beta::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.

Next ID: 12

Inherits from Protobuf::Message.

Accessors

Google::Ai::Generativelanguage::V1beta::Content::GoogleMaps

The GoogleMaps Tool that provides geospatial context for the user's query.

Inherits from Protobuf::Message.

Accessors

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

    Type: Bool

    Optional. Whether to return a widget context token in the GroundingMetadata of the response. Developers can use the widget context token to render a Google Maps widget with geospatial context related to the places that the model references in the response.

Google::Ai::Generativelanguage::V1beta::Content::UrlContext

Tool to support URL context retrieval.

Inherits from Protobuf::Message.

Google::Ai::Generativelanguage::V1beta::Content::FileSearch

The FileSearch tool that retrieves knowledge from Semantic Retrieval corpora. Files are imported to Semantic Retrieval corpora using the ImportFile API.

Inherits from Protobuf::Message.

Accessors

Google::Ai::Generativelanguage::V1beta::Content::GoogleSearchRetrieval

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

Inherits from Protobuf::Message.

Accessors

Google::Ai::Generativelanguage::V1beta::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::V1beta::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::V1beta::Content::ToolConfig

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

Inherits from Protobuf::Message.

Accessors

Google::Ai::Generativelanguage::V1beta::Content::RetrievalConfig

Retrieval config.

Inherits from Protobuf::Message.

Accessors

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

    Type: Message (Google::Type::Latlng::LatLng)

    Optional. The location of the user.

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

    Type: String

    Optional. The language code of the user. Language code for content. Use language tags defined by [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).

Google::Ai::Generativelanguage::V1beta::Content::FunctionCallingConfig

Configuration for specifying function calling behavior.

Inherits from Protobuf::Message.

Accessors

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

    Type: Enum (Google::Ai::Generativelanguage::V1beta::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 or VALIDATED. Function names should match [FunctionDeclaration.name]. When set, model will predict a function call from only allowed function names.

Enum: FunctionCallingConfig::Mode

  • MODE_UNSPECIFIED => 0

  • AUTO => 1

  • ANY => 2

  • NONE => 3

  • VALIDATED => 4

Google::Ai::Generativelanguage::V1beta::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, colons, dots, and dashes, with a maximum length of 64.

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

    Type: String

    Required. A brief description of the function.

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

    Type: Message (Google::Ai::Generativelanguage::V1beta::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->parameters_json_schema() / $msg->parameters_json_schema($value)

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

    Optional. Describes the parameters to the function in JSON Schema format. The schema must describe an object where the properties are the parameters to the function. For example:

    ``` { "type": "object", "properties": { "name": { "type": "string" }, "age": { "type": "integer" } }, "additionalProperties": false, "required": ["name", "age"], "propertyOrdering": ["name", "age"] } ```

    This field is mutually exclusive with `parameters`.

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

    Type: Message (Google::Ai::Generativelanguage::V1beta::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.

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

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

    Optional. Describes the output from this function in JSON Schema format. The value specified by the schema is the response value of the function.

    This field is mutually exclusive with `response`.

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

    Type: Enum (Google::Ai::Generativelanguage::V1beta::FunctionDeclaration::Behavior)

    Optional. Specifies the function Behavior. Currently only supported by the BidiGenerateContent method.

Enum: FunctionDeclaration::Behavior

  • UNSPECIFIED => 0

  • BLOCKING => 1

  • NON_BLOCKING => 2

Google::Ai::Generativelanguage::V1beta::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 64.

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

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

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

Google::Ai::Generativelanguage::V1beta::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 64.

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

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

    Required. The function response in JSON object format. Callers can use any keys of their choice that fit the function's syntax to return the function output, e.g. "output", "result", etc. In particular, if the function call failed to execute, the response can have an "error" key to return error details to the model.

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

    Type: Message (Google::Ai::Generativelanguage::V1beta::Content::FunctionResponsePart)

    Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.

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

    Type: Bool

    Optional. Signals that function call continues, and more responses will be returned, turning the function call into a generator. Is only applicable to NON_BLOCKING function calls, is ignored otherwise. If set to false, future responses will not be considered. It is allowed to return empty `response` with `will_continue=False` to signal that the function call is finished. This may still trigger the model generation. To avoid triggering the generation and finish the function call, additionally set `scheduling` to `SILENT`.

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

    Type: Enum (Google::Ai::Generativelanguage::V1beta::FunctionResponse::Scheduling)

    Optional. Specifies how the response should be scheduled in the conversation. Only applicable to NON_BLOCKING function calls, is ignored otherwise. Defaults to WHEN_IDLE.

Enum: FunctionResponse::Scheduling

  • SCHEDULING_UNSPECIFIED => 0

  • SILENT => 1

  • WHEN_IDLE => 2

  • INTERRUPT => 3

Google::Ai::Generativelanguage::V1beta::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::V1beta::Type)

    Required. Data type.

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

    Type: String

    Optional. The format of the data. Any value is allowed, but most do not trigger any special functionality.

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

    Type: String

    Optional. The title of the schema.

  • $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::V1beta::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::V1beta::Content::Schema::PropertiesEntry)

    Optional. Properties of Type.OBJECT.

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

    Type: String

    Optional. Required properties of Type.OBJECT.

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

    Type: Int64

    Optional. Minimum number of the properties for Type.OBJECT.

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

    Type: Int64

    Optional. Maximum number of the properties for Type.OBJECT.

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

    Type: Double

    Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER

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

    Type: Double

    Optional. Maximum value of the Type.INTEGER and Type.NUMBER

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

    Type: Int64

    Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING

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

    Type: Int64

    Optional. Maximum length of the Type.STRING

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

    Type: String

    Optional. Pattern of the Type.STRING to restrict a string to a regular expression.

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

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

    Optional. Example of the object. Will only populated when the object is the root.

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

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

    Optional. The value should be validated against any (one or more) of the subschemas in the list.

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

    Type: String

    Optional. The order of the properties. Not a standard field in open api spec. Used to determine the order of the properties in the response.

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

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

    Optional. Default value of the field. Per JSON Schema, this field is intended for documentation generators and doesn't affect validation. Thus it's included here and ignored so that developers who send schemas with a `default` field don't get unknown-field errors.

Google::Ai::Generativelanguage::V1beta::Content::GroundingPassage

Passage included inline with a grounding configuration.

Inherits from Protobuf::Message.

Accessors

Google::Ai::Generativelanguage::V1beta::Content::GroundingPassages

A repeated list of passages.

Inherits from Protobuf::Message.

Accessors

Google::Ai::Generativelanguage::V1beta::Content::ModalityTokenCount

Represents token counting info for a single modality.

Inherits from Protobuf::Message.

Accessors

SEE ALSO

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

LICENSE AND COPYRIGHT

Copyright (C) 2026 Google LLC

This program is released under the Apache 2.0 license.