Class GenerateContentRequest.Builder (3.33.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
TypeDescription
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
NameDescription
valuesIterable<? extends com.google.cloud.aiplatform.v1beta1.Content>
Returns
TypeDescription
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
NameDescription
valuesIterable<? extends com.google.cloud.aiplatform.v1beta1.SafetySetting>
Returns
TypeDescription
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. The only supported tool is currently Function

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

Parameter
NameDescription
valuesIterable<? extends com.google.cloud.aiplatform.v1beta1.Tool>
Returns
TypeDescription
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
NameDescription
valueContent
Returns
TypeDescription
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
NameDescription
builderForValueContent.Builder
Returns
TypeDescription
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
NameDescription
indexint
valueContent
Returns
TypeDescription
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
NameDescription
indexint
builderForValueContent.Builder
Returns
TypeDescription
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
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
Content.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public GenerateContentRequest.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
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
NameDescription
valueSafetySetting
Returns
TypeDescription
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
NameDescription
builderForValueSafetySetting.Builder
Returns
TypeDescription
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
NameDescription
indexint
valueSafetySetting
Returns
TypeDescription
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
NameDescription
indexint
builderForValueSafetySetting.Builder
Returns
TypeDescription
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
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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. The only supported tool is currently Function

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

Parameter
NameDescription
valueTool
Returns
TypeDescription
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. The only supported tool is currently Function

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

Parameter
NameDescription
builderForValueTool.Builder
Returns
TypeDescription
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. The only supported tool is currently Function

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

Parameters
NameDescription
indexint
valueTool
Returns
TypeDescription
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. The only supported tool is currently Function

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

Parameters
NameDescription
indexint
builderForValueTool.Builder
Returns
TypeDescription
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. The only supported tool is currently Function

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

Returns
TypeDescription
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. The only supported tool is currently Function

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

Parameter
NameDescription
indexint
Returns
TypeDescription
Tool.Builder

build()

public GenerateContentRequest build()
Returns
TypeDescription
GenerateContentRequest

buildPartial()

public GenerateContentRequest buildPartial()
Returns
TypeDescription
GenerateContentRequest

clear()

public GenerateContentRequest.Builder clear()
Returns
TypeDescription
GenerateContentRequest.Builder
Overrides

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

clearField(Descriptors.FieldDescriptor field)

public GenerateContentRequest.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
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
TypeDescription
GenerateContentRequest.Builder

clearModel()

public GenerateContentRequest.Builder clearModel()

Required. The name of the publisher model requested to serve the prediction. Format: projects/{project}/locations/{location}/publishers/*/models/*

string model = 5 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
GenerateContentRequest.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public GenerateContentRequest.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
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
TypeDescription
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. The only supported tool is currently Function

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

Returns
TypeDescription
GenerateContentRequest.Builder

clone()

public GenerateContentRequest.Builder clone()
Returns
TypeDescription
GenerateContentRequest.Builder
Overrides

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
NameDescription
indexint
Returns
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
TypeDescription
List<? extends com.google.cloud.aiplatform.v1beta1.ContentOrBuilder>

getDefaultInstanceForType()

public GenerateContentRequest getDefaultInstanceForType()
Returns
TypeDescription
GenerateContentRequest

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getGenerationConfig()

public GenerationConfig getGenerationConfig()

Optional. Generation config.

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

Returns
TypeDescription
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
TypeDescription
GenerationConfig.Builder

getGenerationConfigOrBuilder()

public GenerationConfigOrBuilder getGenerationConfigOrBuilder()

Optional. Generation config.

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

Returns
TypeDescription
GenerationConfigOrBuilder

getModel()

public String getModel()

Required. The name of the publisher model requested to serve the prediction. Format: projects/{project}/locations/{location}/publishers/*/models/*

string model = 5 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
String

The model.

getModelBytes()

public ByteString getModelBytes()

Required. The name of the publisher model requested to serve the prediction. Format: projects/{project}/locations/{location}/publishers/*/models/*

string model = 5 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
ByteString

The bytes for model.

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
NameDescription
indexint
Returns
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
TypeDescription
List<? extends com.google.cloud.aiplatform.v1beta1.SafetySettingOrBuilder>

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. The only supported tool is currently Function

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

Parameter
NameDescription
indexint
Returns
TypeDescription
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. The only supported tool is currently Function

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

Parameter
NameDescription
indexint
Returns
TypeDescription
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. The only supported tool is currently Function

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

Returns
TypeDescription
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. The only supported tool is currently Function

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

Returns
TypeDescription
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. The only supported tool is currently Function

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

Returns
TypeDescription
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. The only supported tool is currently Function

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

Parameter
NameDescription
indexint
Returns
TypeDescription
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. The only supported tool is currently Function

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

Returns
TypeDescription
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
TypeDescription
boolean

Whether the generationConfig field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(GenerateContentRequest other)

public GenerateContentRequest.Builder mergeFrom(GenerateContentRequest other)
Parameter
NameDescription
otherGenerateContentRequest
Returns
TypeDescription
GenerateContentRequest.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public GenerateContentRequest.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
GenerateContentRequest.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public GenerateContentRequest.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
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
NameDescription
valueGenerationConfig
Returns
TypeDescription
GenerateContentRequest.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final GenerateContentRequest.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
GenerateContentRequest.Builder
Overrides

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
NameDescription
indexint
Returns
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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. The only supported tool is currently Function

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

Parameter
NameDescription
indexint
Returns
TypeDescription
GenerateContentRequest.Builder

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
NameDescription
indexint
valueContent
Returns
TypeDescription
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
NameDescription
indexint
builderForValueContent.Builder
Returns
TypeDescription
GenerateContentRequest.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public GenerateContentRequest.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
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
NameDescription
valueGenerationConfig
Returns
TypeDescription
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
NameDescription
builderForValueGenerationConfig.Builder
Returns
TypeDescription
GenerateContentRequest.Builder

setModel(String value)

public GenerateContentRequest.Builder setModel(String value)

Required. The name of the publisher model requested to serve the prediction. Format: projects/{project}/locations/{location}/publishers/*/models/*

string model = 5 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueString

The model to set.

Returns
TypeDescription
GenerateContentRequest.Builder

This builder for chaining.

setModelBytes(ByteString value)

public GenerateContentRequest.Builder setModelBytes(ByteString value)

Required. The name of the publisher model requested to serve the prediction. Format: projects/{project}/locations/{location}/publishers/*/models/*

string model = 5 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueByteString

The bytes for model to set.

Returns
TypeDescription
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
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
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
NameDescription
indexint
valueSafetySetting
Returns
TypeDescription
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
NameDescription
indexint
builderForValueSafetySetting.Builder
Returns
TypeDescription
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. The only supported tool is currently Function

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

Parameters
NameDescription
indexint
valueTool
Returns
TypeDescription
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. The only supported tool is currently Function

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

Parameters
NameDescription
indexint
builderForValueTool.Builder
Returns
TypeDescription
GenerateContentRequest.Builder

setUnknownFields(UnknownFieldSet unknownFields)

public final GenerateContentRequest.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
GenerateContentRequest.Builder
Overrides