Class GenerateContentRequest.Builder (3.54.0)

public static final class GenerateContentRequest.Builder extends GeneratedMessageV3.Builder<GenerateContentRequest.Builder> implements GenerateContentRequestOrBuilder

Request message for [PredictionService.GenerateContent].

Protobuf type google.cloud.aiplatform.v1beta1.GenerateContentRequest

Static Methods

getDescriptor()

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

Methods

addAllContents(Iterable<? extends Content> values)

public GenerateContentRequest.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
GenerateContentRequest.Builder

addAllSafetySettings(Iterable<? extends SafetySetting> values)

public GenerateContentRequest.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
GenerateContentRequest.Builder

addAllTools(Iterable<? extends Tool> values)

public GenerateContentRequest.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
GenerateContentRequest.Builder

addContents(Content value)

public GenerateContentRequest.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
GenerateContentRequest.Builder

addContents(Content.Builder builderForValue)

public GenerateContentRequest.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
GenerateContentRequest.Builder

addContents(int index, Content value)

public GenerateContentRequest.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
GenerateContentRequest.Builder

addContents(int index, Content.Builder builderForValue)

public GenerateContentRequest.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
GenerateContentRequest.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 GenerateContentRequest.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
GenerateContentRequest.Builder
Overrides

addSafetySettings(SafetySetting value)

public GenerateContentRequest.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
GenerateContentRequest.Builder

addSafetySettings(SafetySetting.Builder builderForValue)

public GenerateContentRequest.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
GenerateContentRequest.Builder

addSafetySettings(int index, SafetySetting value)

public GenerateContentRequest.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
GenerateContentRequest.Builder

addSafetySettings(int index, SafetySetting.Builder builderForValue)

public GenerateContentRequest.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
GenerateContentRequest.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 GenerateContentRequest.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
GenerateContentRequest.Builder

addTools(Tool.Builder builderForValue)

public GenerateContentRequest.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
GenerateContentRequest.Builder

addTools(int index, Tool value)

public GenerateContentRequest.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
GenerateContentRequest.Builder

addTools(int index, Tool.Builder builderForValue)

public GenerateContentRequest.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
GenerateContentRequest.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 GenerateContentRequest build()
Returns
Type Description
GenerateContentRequest

buildPartial()

public GenerateContentRequest buildPartial()
Returns
Type Description
GenerateContentRequest

clear()

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

clearCachedContent()

public GenerateContentRequest.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
GenerateContentRequest.Builder

This builder for chaining.

clearContents()

public GenerateContentRequest.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
GenerateContentRequest.Builder

clearField(Descriptors.FieldDescriptor field)

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

clearGenerationConfig()

public GenerateContentRequest.Builder clearGenerationConfig()

Optional. Generation config.

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

Returns
Type Description
GenerateContentRequest.Builder

clearLabels()

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

clearModel()

public GenerateContentRequest.Builder clearModel()

Required. 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 = 5 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
GenerateContentRequest.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearSafetySettings()

public GenerateContentRequest.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
GenerateContentRequest.Builder

clearSystemInstruction()

public GenerateContentRequest.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
GenerateContentRequest.Builder

clearToolConfig()

public GenerateContentRequest.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
GenerateContentRequest.Builder

clearTools()

public GenerateContentRequest.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
GenerateContentRequest.Builder

clone()

public GenerateContentRequest.Builder clone()
Returns
Type Description
GenerateContentRequest.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 GenerateContentRequest getDefaultInstanceForType()
Returns
Type Description
GenerateContentRequest

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()

Required. 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 = 5 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
String

The model.

getModelBytes()

public ByteString getModelBytes()

Required. 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 = 5 [(.google.api.field_behavior) = REQUIRED];

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(GenerateContentRequest other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeGenerationConfig(GenerationConfig value)

public GenerateContentRequest.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
GenerateContentRequest.Builder

mergeSystemInstruction(Content value)

public GenerateContentRequest.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
GenerateContentRequest.Builder

mergeToolConfig(ToolConfig value)

public GenerateContentRequest.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
GenerateContentRequest.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

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

putAllLabels(Map<String,String> values)

public GenerateContentRequest.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
GenerateContentRequest.Builder

putLabels(String key, String value)

public GenerateContentRequest.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
GenerateContentRequest.Builder

removeContents(int index)

public GenerateContentRequest.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
GenerateContentRequest.Builder

removeLabels(String key)

public GenerateContentRequest.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
GenerateContentRequest.Builder

removeSafetySettings(int index)

public GenerateContentRequest.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
GenerateContentRequest.Builder

removeTools(int index)

public GenerateContentRequest.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
GenerateContentRequest.Builder

setCachedContent(String value)

public GenerateContentRequest.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
GenerateContentRequest.Builder

This builder for chaining.

setCachedContentBytes(ByteString value)

public GenerateContentRequest.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
GenerateContentRequest.Builder

This builder for chaining.

setContents(int index, Content value)

public GenerateContentRequest.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
GenerateContentRequest.Builder

setContents(int index, Content.Builder builderForValue)

public GenerateContentRequest.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
GenerateContentRequest.Builder

setField(Descriptors.FieldDescriptor field, Object value)

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

setGenerationConfig(GenerationConfig value)

public GenerateContentRequest.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
GenerateContentRequest.Builder

setGenerationConfig(GenerationConfig.Builder builderForValue)

public GenerateContentRequest.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
GenerateContentRequest.Builder

setModel(String value)

public GenerateContentRequest.Builder setModel(String value)

Required. 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 = 5 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value String

The model to set.

Returns
Type Description
GenerateContentRequest.Builder

This builder for chaining.

setModelBytes(ByteString value)

public GenerateContentRequest.Builder setModelBytes(ByteString value)

Required. 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 = 5 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value ByteString

The bytes for model to set.

Returns
Type Description
GenerateContentRequest.Builder

This builder for chaining.

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

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

setSafetySettings(int index, SafetySetting value)

public GenerateContentRequest.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
GenerateContentRequest.Builder

setSafetySettings(int index, SafetySetting.Builder builderForValue)

public GenerateContentRequest.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
GenerateContentRequest.Builder

setSystemInstruction(Content value)

public GenerateContentRequest.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
GenerateContentRequest.Builder

setSystemInstruction(Content.Builder builderForValue)

public GenerateContentRequest.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
GenerateContentRequest.Builder

setToolConfig(ToolConfig value)

public GenerateContentRequest.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
GenerateContentRequest.Builder

setToolConfig(ToolConfig.Builder builderForValue)

public GenerateContentRequest.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
GenerateContentRequest.Builder

setTools(int index, Tool value)

public GenerateContentRequest.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
GenerateContentRequest.Builder

setTools(int index, Tool.Builder builderForValue)

public GenerateContentRequest.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
GenerateContentRequest.Builder

setUnknownFields(UnknownFieldSet unknownFields)

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