Class GenerateContentRequest (3.41.0)

public final class GenerateContentRequest extends GeneratedMessageV3 implements GenerateContentRequestOrBuilder

Request message for [PredictionService.GenerateContent].

Protobuf type google.cloud.aiplatform.v1.GenerateContentRequest

Static Fields

CONTENTS_FIELD_NUMBER

public static final int CONTENTS_FIELD_NUMBER
Field Value
TypeDescription
int

GENERATION_CONFIG_FIELD_NUMBER

public static final int GENERATION_CONFIG_FIELD_NUMBER
Field Value
TypeDescription
int

MODEL_FIELD_NUMBER

public static final int MODEL_FIELD_NUMBER
Field Value
TypeDescription
int

SAFETY_SETTINGS_FIELD_NUMBER

public static final int SAFETY_SETTINGS_FIELD_NUMBER
Field Value
TypeDescription
int

TOOLS_FIELD_NUMBER

public static final int TOOLS_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static GenerateContentRequest getDefaultInstance()
Returns
TypeDescription
GenerateContentRequest

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static GenerateContentRequest.Builder newBuilder()
Returns
TypeDescription
GenerateContentRequest.Builder

newBuilder(GenerateContentRequest prototype)

public static GenerateContentRequest.Builder newBuilder(GenerateContentRequest prototype)
Parameter
NameDescription
prototypeGenerateContentRequest
Returns
TypeDescription
GenerateContentRequest.Builder

parseDelimitedFrom(InputStream input)

public static GenerateContentRequest parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
GenerateContentRequest
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static GenerateContentRequest parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
GenerateContentRequest
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static GenerateContentRequest parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
GenerateContentRequest
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static GenerateContentRequest parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
GenerateContentRequest
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static GenerateContentRequest parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
GenerateContentRequest
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static GenerateContentRequest parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
GenerateContentRequest
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static GenerateContentRequest parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
GenerateContentRequest
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static GenerateContentRequest parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
GenerateContentRequest
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static GenerateContentRequest parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
GenerateContentRequest
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static GenerateContentRequest parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
GenerateContentRequest
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static GenerateContentRequest parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
GenerateContentRequest
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static GenerateContentRequest parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
GenerateContentRequest
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<GenerateContentRequest> parser()
Returns
TypeDescription
Parser<GenerateContentRequest>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
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.v1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
indexint
Returns
TypeDescription
Content

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.v1.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.v1.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.v1.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.v1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
List<? extends com.google.cloud.aiplatform.v1.ContentOrBuilder>

getDefaultInstanceForType()

public GenerateContentRequest getDefaultInstanceForType()
Returns
TypeDescription
GenerateContentRequest

getGenerationConfig()

public GenerationConfig getGenerationConfig()

Optional. Generation config.

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

Returns
TypeDescription
GenerationConfig

The generationConfig.

getGenerationConfigOrBuilder()

public GenerationConfigOrBuilder getGenerationConfigOrBuilder()

Optional. Generation config.

.google.cloud.aiplatform.v1.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.

getParserForType()

public Parser<GenerateContentRequest> getParserForType()
Returns
TypeDescription
Parser<GenerateContentRequest>
Overrides

getSafetySettings(int index)

public SafetySetting getSafetySettings(int index)

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

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

Parameter
NameDescription
indexint
Returns
TypeDescription
SafetySetting

getSafetySettingsCount()

public int getSafetySettingsCount()

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

repeated .google.cloud.aiplatform.v1.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.v1.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.v1.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.v1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
List<? extends com.google.cloud.aiplatform.v1.SafetySettingOrBuilder>

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

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.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
indexint
Returns
TypeDescription
Tool

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.v1.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.

repeated .google.cloud.aiplatform.v1.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.

repeated .google.cloud.aiplatform.v1.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.

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

Returns
TypeDescription
List<? extends com.google.cloud.aiplatform.v1.ToolOrBuilder>

hasGenerationConfig()

public boolean hasGenerationConfig()

Optional. Generation config.

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

Returns
TypeDescription
boolean

Whether the generationConfig field is set.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public GenerateContentRequest.Builder newBuilderForType()
Returns
TypeDescription
GenerateContentRequest.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected GenerateContentRequest.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
GenerateContentRequest.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public GenerateContentRequest.Builder toBuilder()
Returns
TypeDescription
GenerateContentRequest.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException