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:
StringOptional. 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
$msg->text()/$msg->text($value)Type:
StringInline text.
$msg->inline_data()/$msg->inline_data($value)Type:
Message(Google::Ai::Generativelanguage::V1alpha::Content::Blob)Inline media bytes.
$msg->function_call()/$msg->function_call($value)Type:
Message(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.
$msg->function_response()/$msg->function_response($value)Type:
Message(Google::Ai::Generativelanguage::V1alpha::Content::FunctionResponse)The result output of 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.
$msg->file_data()/$msg->file_data($value)Type:
Message(Google::Ai::Generativelanguage::V1alpha::Content::FileData)URI based data.
$msg->executable_code()/$msg->executable_code($value)Type:
Message(Google::Ai::Generativelanguage::V1alpha::Content::ExecutableCode)Code generated by the model that is meant to be executed.
$msg->code_execution_result()/$msg->code_execution_result($value)Type:
Message(Google::Ai::Generativelanguage::V1alpha::Content::CodeExecutionResult)Result of executing the `ExecutableCode`.
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:
StringThe 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:
BytesRaw 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:
StringOptional. The IANA standard MIME type of the source data.
$msg->file_uri()/$msg->file_uri($value)Type:
StringRequired. 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
$msg->language()/$msg->language($value)Type:
Enum(Google::Ai::Generativelanguage::V1alpha::ExecutableCode::Language)Required. Programming language of the `code`.
$msg->code()/$msg->code($value)Type:
StringRequired. The code to be executed.
Enum: ExecutableCode::Language
LANGUAGE_UNSPECIFIED=>0PYTHON=>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
$msg->outcome()/$msg->outcome($value)Type:
Enum(Google::Ai::Generativelanguage::V1alpha::CodeExecutionResult::Outcome)Required. Outcome of the code execution.
$msg->output()/$msg->output($value)Type:
StringOptional. Contains stdout when code execution is successful, stderr or other description otherwise.
Enum: CodeExecutionResult::Outcome
OUTCOME_UNSPECIFIED=>0OUTCOME_OK=>1OUTCOME_FAILED=>2OUTCOME_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
$msg->dynamic_retrieval_config()/$msg->dynamic_retrieval_config($value)Type:
Message(Google::Ai::Generativelanguage::V1alpha::Content::DynamicRetrievalConfig)Specifies the dynamic retrieval configuration for the given source.
Google::Ai::Generativelanguage::V1alpha::Content::DynamicRetrievalConfig
Describes the options to customize dynamic retrieval.
Inherits from Protobuf::Message.
Accessors
$msg->mode()/$msg->mode($value)Type:
Enum(Google::Ai::Generativelanguage::V1alpha::DynamicRetrievalConfig::Mode)The mode of the predictor to be used in dynamic retrieval.
$msg->dynamic_threshold()/$msg->dynamic_threshold($value)Type:
FloatThe threshold to be used in dynamic retrieval. If not set, a system default value is used.
Enum: DynamicRetrievalConfig::Mode
MODE_UNSPECIFIED=>0MODE_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
$msg->function_calling_config()/$msg->function_calling_config($value)Type:
Message(Google::Ai::Generativelanguage::V1alpha::Content::FunctionCallingConfig)Optional. Function calling config.
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:
StringOptional. 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=>0AUTO=>1ANY=>2NONE=>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:
StringRequired. 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:
StringRequired. 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:
StringOptional. 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:
StringRequired. 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:
StringOptional. 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:
StringRequired. 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:
StringOptional. 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:
StringOptional. 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:
BoolOptional. Indicates if the value may be null.
$msg->enum()/$msg->enum($value)Type:
StringOptional. 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:
Int64Optional. Maximum number of the elements for Type.ARRAY.
$msg->min_items()/$msg->min_items($value)Type:
Int64Optional. 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:
StringOptional. Required properties of Type.OBJECT.
Google::Ai::Generativelanguage::V1alpha::Content::GroundingPassage
Passage included inline with a grounding configuration.
Inherits from Protobuf::Message.
Accessors
$msg->id()/$msg->id($value)Type:
StringIdentifier for the passage for attributing this passage in grounded answers.
$msg->content()/$msg->content($value)Type:
Message(Google::Ai::Generativelanguage::V1alpha::Content::Content)Content of the passage.
Google::Ai::Generativelanguage::V1alpha::Content::GroundingPassages
A repeated list of passages.
Inherits from Protobuf::Message.
Accessors
$msg->passages()/$msg->passages($value)Type:
Message(Google::Ai::Generativelanguage::V1alpha::Content::GroundingPassage)List of passages.
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.