Class GeminiExample.Builder (3.64.0)

public static final class GeminiExample.Builder extends GeneratedMessageV3.Builder<GeminiExample.Builder> implements GeminiExampleOrBuilder

Format for Gemini examples used for Vertex Multimodal datasets.

Protobuf type google.cloud.aiplatform.v1beta1.GeminiExample

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addAllContents(Iterable<? extends Content> values)

public GeminiExample.Builder addAllContents(Iterable<? extends Content> values)

Required. The content of the current conversation with the model.

For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request.

repeated .google.cloud.aiplatform.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
values Iterable<? extends com.google.cloud.aiplatform.v1beta1.Content>
Returns
Type Description
GeminiExample.Builder

addAllSafetySettings(Iterable<? extends SafetySetting> values)

public GeminiExample.Builder addAllSafetySettings(Iterable<? extends SafetySetting> values)

Optional. Per request settings for blocking unsafe content. Enforced on GenerateContentResponse.candidates.

repeated .google.cloud.aiplatform.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
values Iterable<? extends com.google.cloud.aiplatform.v1beta1.SafetySetting>
Returns
Type Description
GeminiExample.Builder

addAllTools(Iterable<? extends Tool> values)

public GeminiExample.Builder addAllTools(Iterable<? extends Tool> values)

Optional. A list of Tools the model may use to generate the next 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.

repeated .google.cloud.aiplatform.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
values Iterable<? extends com.google.cloud.aiplatform.v1beta1.Tool>
Returns
Type Description
GeminiExample.Builder

addContents(Content value)

public GeminiExample.Builder addContents(Content value)

Required. The content of the current conversation with the model.

For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request.

repeated .google.cloud.aiplatform.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value Content
Returns
Type Description
GeminiExample.Builder

addContents(Content.Builder builderForValue)

public GeminiExample.Builder addContents(Content.Builder builderForValue)

Required. The content of the current conversation with the model.

For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request.

repeated .google.cloud.aiplatform.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
builderForValue Content.Builder
Returns
Type Description
GeminiExample.Builder

addContents(int index, Content value)

public GeminiExample.Builder addContents(int index, Content value)

Required. The content of the current conversation with the model.

For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request.

repeated .google.cloud.aiplatform.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED];

Parameters
Name Description
index int
value Content
Returns
Type Description
GeminiExample.Builder

addContents(int index, Content.Builder builderForValue)

public GeminiExample.Builder addContents(int index, Content.Builder builderForValue)

Required. The content of the current conversation with the model.

For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request.

repeated .google.cloud.aiplatform.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED];

Parameters
Name Description
index int
builderForValue Content.Builder
Returns
Type Description
GeminiExample.Builder

addContentsBuilder()

public Content.Builder addContentsBuilder()

Required. The content of the current conversation with the model.

For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request.

repeated .google.cloud.aiplatform.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
Content.Builder

addContentsBuilder(int index)

public Content.Builder addContentsBuilder(int index)

Required. The content of the current conversation with the model.

For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request.

repeated .google.cloud.aiplatform.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int
Returns
Type Description
Content.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public GeminiExample.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
GeminiExample.Builder
Overrides

addSafetySettings(SafetySetting value)

public GeminiExample.Builder addSafetySettings(SafetySetting value)

Optional. Per request settings for blocking unsafe content. Enforced on GenerateContentResponse.candidates.

repeated .google.cloud.aiplatform.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value SafetySetting
Returns
Type Description
GeminiExample.Builder

addSafetySettings(SafetySetting.Builder builderForValue)

public GeminiExample.Builder addSafetySettings(SafetySetting.Builder builderForValue)

Optional. Per request settings for blocking unsafe content. Enforced on GenerateContentResponse.candidates.

repeated .google.cloud.aiplatform.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
builderForValue SafetySetting.Builder
Returns
Type Description
GeminiExample.Builder

addSafetySettings(int index, SafetySetting value)

public GeminiExample.Builder addSafetySettings(int index, SafetySetting value)

Optional. Per request settings for blocking unsafe content. Enforced on GenerateContentResponse.candidates.

repeated .google.cloud.aiplatform.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int
value SafetySetting
Returns
Type Description
GeminiExample.Builder

addSafetySettings(int index, SafetySetting.Builder builderForValue)

public GeminiExample.Builder addSafetySettings(int index, SafetySetting.Builder builderForValue)

Optional. Per request settings for blocking unsafe content. Enforced on GenerateContentResponse.candidates.

repeated .google.cloud.aiplatform.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int
builderForValue SafetySetting.Builder
Returns
Type Description
GeminiExample.Builder

addSafetySettingsBuilder()

public SafetySetting.Builder addSafetySettingsBuilder()

Optional. Per request settings for blocking unsafe content. Enforced on GenerateContentResponse.candidates.

repeated .google.cloud.aiplatform.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
SafetySetting.Builder

addSafetySettingsBuilder(int index)

public SafetySetting.Builder addSafetySettingsBuilder(int index)

Optional. Per request settings for blocking unsafe content. Enforced on GenerateContentResponse.candidates.

repeated .google.cloud.aiplatform.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
SafetySetting.Builder

addTools(Tool value)

public GeminiExample.Builder addTools(Tool value)

Optional. A list of Tools the model may use to generate the next 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.

repeated .google.cloud.aiplatform.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value Tool
Returns
Type Description
GeminiExample.Builder

addTools(Tool.Builder builderForValue)

public GeminiExample.Builder addTools(Tool.Builder builderForValue)

Optional. A list of Tools the model may use to generate the next 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.

repeated .google.cloud.aiplatform.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
builderForValue Tool.Builder
Returns
Type Description
GeminiExample.Builder

addTools(int index, Tool value)

public GeminiExample.Builder addTools(int index, Tool value)

Optional. A list of Tools the model may use to generate the next 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.

repeated .google.cloud.aiplatform.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int
value Tool
Returns
Type Description
GeminiExample.Builder

addTools(int index, Tool.Builder builderForValue)

public GeminiExample.Builder addTools(int index, Tool.Builder builderForValue)

Optional. A list of Tools the model may use to generate the next 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.

repeated .google.cloud.aiplatform.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int
builderForValue Tool.Builder
Returns
Type Description
GeminiExample.Builder

addToolsBuilder()

public Tool.Builder addToolsBuilder()

Optional. A list of Tools the model may use to generate the next 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.

repeated .google.cloud.aiplatform.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Tool.Builder

addToolsBuilder(int index)

public Tool.Builder addToolsBuilder(int index)

Optional. A list of Tools the model may use to generate the next 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.

repeated .google.cloud.aiplatform.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
Tool.Builder

build()

public GeminiExample build()
Returns
Type Description
GeminiExample

buildPartial()

public GeminiExample buildPartial()
Returns
Type Description
GeminiExample

clear()

public GeminiExample.Builder clear()
Returns
Type Description
GeminiExample.Builder
Overrides

clearCachedContent()

public GeminiExample.Builder clearCachedContent()

Optional. The name of the cached content used as context to serve the prediction. Note: only used in explicit caching, where users can have control over caching (e.g. what content to cache) and enjoy guaranteed cost savings. Format: projects/{project}/locations/{location}/cachedContents/{cachedContent}

string cached_content = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }

Returns
Type Description
GeminiExample.Builder

This builder for chaining.

clearContents()

public GeminiExample.Builder clearContents()

Required. The content of the current conversation with the model.

For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request.

repeated .google.cloud.aiplatform.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
GeminiExample.Builder

clearField(Descriptors.FieldDescriptor field)

public GeminiExample.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
GeminiExample.Builder
Overrides

clearGenerationConfig()

public GeminiExample.Builder clearGenerationConfig()

Optional. Generation config.

.google.cloud.aiplatform.v1beta1.GenerationConfig generation_config = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
GeminiExample.Builder

clearLabels()

public GeminiExample.Builder clearLabels()
Returns
Type Description
GeminiExample.Builder

clearModel()

public GeminiExample.Builder clearModel()

Optional. The fully qualified name of the publisher model or tuned model endpoint to use.

Publisher model format: projects/{project}/locations/{location}/publishers/*/models/*

Tuned model endpoint format: projects/{project}/locations/{location}/endpoints/{endpoint}

string model = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }

Returns
Type Description
GeminiExample.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public GeminiExample.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
GeminiExample.Builder
Overrides

clearSafetySettings()

public GeminiExample.Builder clearSafetySettings()

Optional. Per request settings for blocking unsafe content. Enforced on GenerateContentResponse.candidates.

repeated .google.cloud.aiplatform.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
GeminiExample.Builder

clearSystemInstruction()

public GeminiExample.Builder clearSystemInstruction()

Optional. The user provided system instructions for the model. Note: only text should be used in parts and content in each part will be in a separate paragraph.

optional .google.cloud.aiplatform.v1beta1.Content system_instruction = 8 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
GeminiExample.Builder

clearToolConfig()

public GeminiExample.Builder clearToolConfig()

Optional. Tool config. This config is shared for all tools provided in the request.

.google.cloud.aiplatform.v1beta1.ToolConfig tool_config = 7 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
GeminiExample.Builder

clearTools()

public GeminiExample.Builder clearTools()

Optional. A list of Tools the model may use to generate the next 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.

repeated .google.cloud.aiplatform.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
GeminiExample.Builder

clone()

public GeminiExample.Builder clone()
Returns
Type Description
GeminiExample.Builder
Overrides

containsLabels(String key)

public boolean containsLabels(String key)

Optional. The labels with user-defined metadata for the request. It is used for billing and reporting only.

Label keys and values can be no longer than 63 characters (Unicode codepoints) and can only contain lowercase letters, numeric characters, underscores, and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter.

map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
key String
Returns
Type Description
boolean

getCachedContent()

public String getCachedContent()

Optional. The name of the cached content used as context to serve the prediction. Note: only used in explicit caching, where users can have control over caching (e.g. what content to cache) and enjoy guaranteed cost savings. Format: projects/{project}/locations/{location}/cachedContents/{cachedContent}

string cached_content = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }

Returns
Type Description
String

The cachedContent.

getCachedContentBytes()

public ByteString getCachedContentBytes()

Optional. The name of the cached content used as context to serve the prediction. Note: only used in explicit caching, where users can have control over caching (e.g. what content to cache) and enjoy guaranteed cost savings. Format: projects/{project}/locations/{location}/cachedContents/{cachedContent}

string cached_content = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }

Returns
Type Description
ByteString

The bytes for cachedContent.

getContents(int index)

public Content getContents(int index)

Required. The content of the current conversation with the model.

For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request.

repeated .google.cloud.aiplatform.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int
Returns
Type Description
Content

getContentsBuilder(int index)

public Content.Builder getContentsBuilder(int index)

Required. The content of the current conversation with the model.

For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request.

repeated .google.cloud.aiplatform.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int
Returns
Type Description
Content.Builder

getContentsBuilderList()

public List<Content.Builder> getContentsBuilderList()

Required. The content of the current conversation with the model.

For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request.

repeated .google.cloud.aiplatform.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
List<Builder>

getContentsCount()

public int getContentsCount()

Required. The content of the current conversation with the model.

For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request.

repeated .google.cloud.aiplatform.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
int

getContentsList()

public List<Content> getContentsList()

Required. The content of the current conversation with the model.

For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request.

repeated .google.cloud.aiplatform.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
List<Content>

getContentsOrBuilder(int index)

public ContentOrBuilder getContentsOrBuilder(int index)

Required. The content of the current conversation with the model.

For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request.

repeated .google.cloud.aiplatform.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int
Returns
Type Description
ContentOrBuilder

getContentsOrBuilderList()

public List<? extends ContentOrBuilder> getContentsOrBuilderList()

Required. The content of the current conversation with the model.

For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request.

repeated .google.cloud.aiplatform.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
List<? extends com.google.cloud.aiplatform.v1beta1.ContentOrBuilder>

getDefaultInstanceForType()

public GeminiExample getDefaultInstanceForType()
Returns
Type Description
GeminiExample

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getGenerationConfig()

public GenerationConfig getGenerationConfig()

Optional. Generation config.

.google.cloud.aiplatform.v1beta1.GenerationConfig generation_config = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
GenerationConfig

The generationConfig.

getGenerationConfigBuilder()

public GenerationConfig.Builder getGenerationConfigBuilder()

Optional. Generation config.

.google.cloud.aiplatform.v1beta1.GenerationConfig generation_config = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
GenerationConfig.Builder

getGenerationConfigOrBuilder()

public GenerationConfigOrBuilder getGenerationConfigOrBuilder()

Optional. Generation config.

.google.cloud.aiplatform.v1beta1.GenerationConfig generation_config = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
GenerationConfigOrBuilder

getLabels() (deprecated)

public Map<String,String> getLabels()

Use #getLabelsMap() instead.

Returns
Type Description
Map<String,String>

getLabelsCount()

public int getLabelsCount()

Optional. The labels with user-defined metadata for the request. It is used for billing and reporting only.

Label keys and values can be no longer than 63 characters (Unicode codepoints) and can only contain lowercase letters, numeric characters, underscores, and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter.

map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

getLabelsMap()

public Map<String,String> getLabelsMap()

Optional. The labels with user-defined metadata for the request. It is used for billing and reporting only.

Label keys and values can be no longer than 63 characters (Unicode codepoints) and can only contain lowercase letters, numeric characters, underscores, and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter.

map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Map<String,String>

getLabelsOrDefault(String key, String defaultValue)

public String getLabelsOrDefault(String key, String defaultValue)

Optional. The labels with user-defined metadata for the request. It is used for billing and reporting only.

Label keys and values can be no longer than 63 characters (Unicode codepoints) and can only contain lowercase letters, numeric characters, underscores, and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter.

map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
key String
defaultValue String
Returns
Type Description
String

getLabelsOrThrow(String key)

public String getLabelsOrThrow(String key)

Optional. The labels with user-defined metadata for the request. It is used for billing and reporting only.

Label keys and values can be no longer than 63 characters (Unicode codepoints) and can only contain lowercase letters, numeric characters, underscores, and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter.

map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
key String
Returns
Type Description
String

getModel()

public String getModel()

Optional. The fully qualified name of the publisher model or tuned model endpoint to use.

Publisher model format: projects/{project}/locations/{location}/publishers/*/models/*

Tuned model endpoint format: projects/{project}/locations/{location}/endpoints/{endpoint}

string model = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }

Returns
Type Description
String

The model.

getModelBytes()

public ByteString getModelBytes()

Optional. The fully qualified name of the publisher model or tuned model endpoint to use.

Publisher model format: projects/{project}/locations/{location}/publishers/*/models/*

Tuned model endpoint format: projects/{project}/locations/{location}/endpoints/{endpoint}

string model = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }

Returns
Type Description
ByteString

The bytes for model.

getMutableLabels() (deprecated)

public Map<String,String> getMutableLabels()

Use alternate mutation accessors instead.

Returns
Type Description
Map<String,String>

getSafetySettings(int index)

public SafetySetting getSafetySettings(int index)

Optional. Per request settings for blocking unsafe content. Enforced on GenerateContentResponse.candidates.

repeated .google.cloud.aiplatform.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
SafetySetting

getSafetySettingsBuilder(int index)

public SafetySetting.Builder getSafetySettingsBuilder(int index)

Optional. Per request settings for blocking unsafe content. Enforced on GenerateContentResponse.candidates.

repeated .google.cloud.aiplatform.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
SafetySetting.Builder

getSafetySettingsBuilderList()

public List<SafetySetting.Builder> getSafetySettingsBuilderList()

Optional. Per request settings for blocking unsafe content. Enforced on GenerateContentResponse.candidates.

repeated .google.cloud.aiplatform.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
List<Builder>

getSafetySettingsCount()

public int getSafetySettingsCount()

Optional. Per request settings for blocking unsafe content. Enforced on GenerateContentResponse.candidates.

repeated .google.cloud.aiplatform.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

getSafetySettingsList()

public List<SafetySetting> getSafetySettingsList()

Optional. Per request settings for blocking unsafe content. Enforced on GenerateContentResponse.candidates.

repeated .google.cloud.aiplatform.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
List<SafetySetting>

getSafetySettingsOrBuilder(int index)

public SafetySettingOrBuilder getSafetySettingsOrBuilder(int index)

Optional. Per request settings for blocking unsafe content. Enforced on GenerateContentResponse.candidates.

repeated .google.cloud.aiplatform.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
SafetySettingOrBuilder

getSafetySettingsOrBuilderList()

public List<? extends SafetySettingOrBuilder> getSafetySettingsOrBuilderList()

Optional. Per request settings for blocking unsafe content. Enforced on GenerateContentResponse.candidates.

repeated .google.cloud.aiplatform.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
List<? extends com.google.cloud.aiplatform.v1beta1.SafetySettingOrBuilder>

getSystemInstruction()

public Content getSystemInstruction()

Optional. The user provided system instructions for the model. Note: only text should be used in parts and content in each part will be in a separate paragraph.

optional .google.cloud.aiplatform.v1beta1.Content system_instruction = 8 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Content

The systemInstruction.

getSystemInstructionBuilder()

public Content.Builder getSystemInstructionBuilder()

Optional. The user provided system instructions for the model. Note: only text should be used in parts and content in each part will be in a separate paragraph.

optional .google.cloud.aiplatform.v1beta1.Content system_instruction = 8 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Content.Builder

getSystemInstructionOrBuilder()

public ContentOrBuilder getSystemInstructionOrBuilder()

Optional. The user provided system instructions for the model. Note: only text should be used in parts and content in each part will be in a separate paragraph.

optional .google.cloud.aiplatform.v1beta1.Content system_instruction = 8 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ContentOrBuilder

getToolConfig()

public ToolConfig getToolConfig()

Optional. Tool config. This config is shared for all tools provided in the request.

.google.cloud.aiplatform.v1beta1.ToolConfig tool_config = 7 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ToolConfig

The toolConfig.

getToolConfigBuilder()

public ToolConfig.Builder getToolConfigBuilder()

Optional. Tool config. This config is shared for all tools provided in the request.

.google.cloud.aiplatform.v1beta1.ToolConfig tool_config = 7 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ToolConfig.Builder

getToolConfigOrBuilder()

public ToolConfigOrBuilder getToolConfigOrBuilder()

Optional. Tool config. This config is shared for all tools provided in the request.

.google.cloud.aiplatform.v1beta1.ToolConfig tool_config = 7 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ToolConfigOrBuilder

getTools(int index)

public Tool getTools(int index)

Optional. A list of Tools the model may use to generate the next 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.

repeated .google.cloud.aiplatform.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
Tool

getToolsBuilder(int index)

public Tool.Builder getToolsBuilder(int index)

Optional. A list of Tools the model may use to generate the next 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.

repeated .google.cloud.aiplatform.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
Tool.Builder

getToolsBuilderList()

public List<Tool.Builder> getToolsBuilderList()

Optional. A list of Tools the model may use to generate the next 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.

repeated .google.cloud.aiplatform.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
List<Builder>

getToolsCount()

public int getToolsCount()

Optional. A list of Tools the model may use to generate the next 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.

repeated .google.cloud.aiplatform.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

getToolsList()

public List<Tool> getToolsList()

Optional. A list of Tools the model may use to generate the next 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.

repeated .google.cloud.aiplatform.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
List<Tool>

getToolsOrBuilder(int index)

public ToolOrBuilder getToolsOrBuilder(int index)

Optional. A list of Tools the model may use to generate the next 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.

repeated .google.cloud.aiplatform.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
ToolOrBuilder

getToolsOrBuilderList()

public List<? extends ToolOrBuilder> getToolsOrBuilderList()

Optional. A list of Tools the model may use to generate the next 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.

repeated .google.cloud.aiplatform.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
List<? extends com.google.cloud.aiplatform.v1beta1.ToolOrBuilder>

hasGenerationConfig()

public boolean hasGenerationConfig()

Optional. Generation config.

.google.cloud.aiplatform.v1beta1.GenerationConfig generation_config = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the generationConfig field is set.

hasSystemInstruction()

public boolean hasSystemInstruction()

Optional. The user provided system instructions for the model. Note: only text should be used in parts and content in each part will be in a separate paragraph.

optional .google.cloud.aiplatform.v1beta1.Content system_instruction = 8 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the systemInstruction field is set.

hasToolConfig()

public boolean hasToolConfig()

Optional. Tool config. This config is shared for all tools provided in the request.

.google.cloud.aiplatform.v1beta1.ToolConfig tool_config = 7 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the toolConfig field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)

internalGetMutableMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(GeminiExample other)

public GeminiExample.Builder mergeFrom(GeminiExample other)
Parameter
Name Description
other GeminiExample
Returns
Type Description
GeminiExample.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public GeminiExample.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
GeminiExample.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public GeminiExample.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
GeminiExample.Builder
Overrides

mergeGenerationConfig(GenerationConfig value)

public GeminiExample.Builder mergeGenerationConfig(GenerationConfig value)

Optional. Generation config.

.google.cloud.aiplatform.v1beta1.GenerationConfig generation_config = 4 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value GenerationConfig
Returns
Type Description
GeminiExample.Builder

mergeSystemInstruction(Content value)

public GeminiExample.Builder mergeSystemInstruction(Content value)

Optional. The user provided system instructions for the model. Note: only text should be used in parts and content in each part will be in a separate paragraph.

optional .google.cloud.aiplatform.v1beta1.Content system_instruction = 8 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value Content
Returns
Type Description
GeminiExample.Builder

mergeToolConfig(ToolConfig value)

public GeminiExample.Builder mergeToolConfig(ToolConfig value)

Optional. Tool config. This config is shared for all tools provided in the request.

.google.cloud.aiplatform.v1beta1.ToolConfig tool_config = 7 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value ToolConfig
Returns
Type Description
GeminiExample.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final GeminiExample.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
GeminiExample.Builder
Overrides

putAllLabels(Map<String,String> values)

public GeminiExample.Builder putAllLabels(Map<String,String> values)

Optional. The labels with user-defined metadata for the request. It is used for billing and reporting only.

Label keys and values can be no longer than 63 characters (Unicode codepoints) and can only contain lowercase letters, numeric characters, underscores, and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter.

map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
values Map<String,String>
Returns
Type Description
GeminiExample.Builder

putLabels(String key, String value)

public GeminiExample.Builder putLabels(String key, String value)

Optional. The labels with user-defined metadata for the request. It is used for billing and reporting only.

Label keys and values can be no longer than 63 characters (Unicode codepoints) and can only contain lowercase letters, numeric characters, underscores, and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter.

map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
key String
value String
Returns
Type Description
GeminiExample.Builder

removeContents(int index)

public GeminiExample.Builder removeContents(int index)

Required. The content of the current conversation with the model.

For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request.

repeated .google.cloud.aiplatform.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int
Returns
Type Description
GeminiExample.Builder

removeLabels(String key)

public GeminiExample.Builder removeLabels(String key)

Optional. The labels with user-defined metadata for the request. It is used for billing and reporting only.

Label keys and values can be no longer than 63 characters (Unicode codepoints) and can only contain lowercase letters, numeric characters, underscores, and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter.

map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
key String
Returns
Type Description
GeminiExample.Builder

removeSafetySettings(int index)

public GeminiExample.Builder removeSafetySettings(int index)

Optional. Per request settings for blocking unsafe content. Enforced on GenerateContentResponse.candidates.

repeated .google.cloud.aiplatform.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
GeminiExample.Builder

removeTools(int index)

public GeminiExample.Builder removeTools(int index)

Optional. A list of Tools the model may use to generate the next 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.

repeated .google.cloud.aiplatform.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
GeminiExample.Builder

setCachedContent(String value)

public GeminiExample.Builder setCachedContent(String value)

Optional. The name of the cached content used as context to serve the prediction. Note: only used in explicit caching, where users can have control over caching (e.g. what content to cache) and enjoy guaranteed cost savings. Format: projects/{project}/locations/{location}/cachedContents/{cachedContent}

string cached_content = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }

Parameter
Name Description
value String

The cachedContent to set.

Returns
Type Description
GeminiExample.Builder

This builder for chaining.

setCachedContentBytes(ByteString value)

public GeminiExample.Builder setCachedContentBytes(ByteString value)

Optional. The name of the cached content used as context to serve the prediction. Note: only used in explicit caching, where users can have control over caching (e.g. what content to cache) and enjoy guaranteed cost savings. Format: projects/{project}/locations/{location}/cachedContents/{cachedContent}

string cached_content = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }

Parameter
Name Description
value ByteString

The bytes for cachedContent to set.

Returns
Type Description
GeminiExample.Builder

This builder for chaining.

setContents(int index, Content value)

public GeminiExample.Builder setContents(int index, Content value)

Required. The content of the current conversation with the model.

For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request.

repeated .google.cloud.aiplatform.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED];

Parameters
Name Description
index int
value Content
Returns
Type Description
GeminiExample.Builder

setContents(int index, Content.Builder builderForValue)

public GeminiExample.Builder setContents(int index, Content.Builder builderForValue)

Required. The content of the current conversation with the model.

For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request.

repeated .google.cloud.aiplatform.v1beta1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED];

Parameters
Name Description
index int
builderForValue Content.Builder
Returns
Type Description
GeminiExample.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public GeminiExample.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
GeminiExample.Builder
Overrides

setGenerationConfig(GenerationConfig value)

public GeminiExample.Builder setGenerationConfig(GenerationConfig value)

Optional. Generation config.

.google.cloud.aiplatform.v1beta1.GenerationConfig generation_config = 4 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value GenerationConfig
Returns
Type Description
GeminiExample.Builder

setGenerationConfig(GenerationConfig.Builder builderForValue)

public GeminiExample.Builder setGenerationConfig(GenerationConfig.Builder builderForValue)

Optional. Generation config.

.google.cloud.aiplatform.v1beta1.GenerationConfig generation_config = 4 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
builderForValue GenerationConfig.Builder
Returns
Type Description
GeminiExample.Builder

setModel(String value)

public GeminiExample.Builder setModel(String value)

Optional. The fully qualified name of the publisher model or tuned model endpoint to use.

Publisher model format: projects/{project}/locations/{location}/publishers/*/models/*

Tuned model endpoint format: projects/{project}/locations/{location}/endpoints/{endpoint}

string model = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }

Parameter
Name Description
value String

The model to set.

Returns
Type Description
GeminiExample.Builder

This builder for chaining.

setModelBytes(ByteString value)

public GeminiExample.Builder setModelBytes(ByteString value)

Optional. The fully qualified name of the publisher model or tuned model endpoint to use.

Publisher model format: projects/{project}/locations/{location}/publishers/*/models/*

Tuned model endpoint format: projects/{project}/locations/{location}/endpoints/{endpoint}

string model = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }

Parameter
Name Description
value ByteString

The bytes for model to set.

Returns
Type Description
GeminiExample.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public GeminiExample.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
GeminiExample.Builder
Overrides

setSafetySettings(int index, SafetySetting value)

public GeminiExample.Builder setSafetySettings(int index, SafetySetting value)

Optional. Per request settings for blocking unsafe content. Enforced on GenerateContentResponse.candidates.

repeated .google.cloud.aiplatform.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int
value SafetySetting
Returns
Type Description
GeminiExample.Builder

setSafetySettings(int index, SafetySetting.Builder builderForValue)

public GeminiExample.Builder setSafetySettings(int index, SafetySetting.Builder builderForValue)

Optional. Per request settings for blocking unsafe content. Enforced on GenerateContentResponse.candidates.

repeated .google.cloud.aiplatform.v1beta1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int
builderForValue SafetySetting.Builder
Returns
Type Description
GeminiExample.Builder

setSystemInstruction(Content value)

public GeminiExample.Builder setSystemInstruction(Content value)

Optional. The user provided system instructions for the model. Note: only text should be used in parts and content in each part will be in a separate paragraph.

optional .google.cloud.aiplatform.v1beta1.Content system_instruction = 8 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value Content
Returns
Type Description
GeminiExample.Builder

setSystemInstruction(Content.Builder builderForValue)

public GeminiExample.Builder setSystemInstruction(Content.Builder builderForValue)

Optional. The user provided system instructions for the model. Note: only text should be used in parts and content in each part will be in a separate paragraph.

optional .google.cloud.aiplatform.v1beta1.Content system_instruction = 8 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
builderForValue Content.Builder
Returns
Type Description
GeminiExample.Builder

setToolConfig(ToolConfig value)

public GeminiExample.Builder setToolConfig(ToolConfig value)

Optional. Tool config. This config is shared for all tools provided in the request.

.google.cloud.aiplatform.v1beta1.ToolConfig tool_config = 7 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value ToolConfig
Returns
Type Description
GeminiExample.Builder

setToolConfig(ToolConfig.Builder builderForValue)

public GeminiExample.Builder setToolConfig(ToolConfig.Builder builderForValue)

Optional. Tool config. This config is shared for all tools provided in the request.

.google.cloud.aiplatform.v1beta1.ToolConfig tool_config = 7 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
builderForValue ToolConfig.Builder
Returns
Type Description
GeminiExample.Builder

setTools(int index, Tool value)

public GeminiExample.Builder setTools(int index, Tool value)

Optional. A list of Tools the model may use to generate the next 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.

repeated .google.cloud.aiplatform.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int
value Tool
Returns
Type Description
GeminiExample.Builder

setTools(int index, Tool.Builder builderForValue)

public GeminiExample.Builder setTools(int index, Tool.Builder builderForValue)

Optional. A list of Tools the model may use to generate the next 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.

repeated .google.cloud.aiplatform.v1beta1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int
builderForValue Tool.Builder
Returns
Type Description
GeminiExample.Builder

setUnknownFields(UnknownFieldSet unknownFields)

public final GeminiExample.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
GeminiExample.Builder
Overrides