Class Generator.Builder (0.52.0)

public static final class Generator.Builder extends GeneratedMessageV3.Builder<Generator.Builder> implements GeneratorOrBuilder

Generators contain prompt to be sent to the LLM model to generate text. The prompt can contain parameters which will be resolved before calling the model. It can optionally contain banned phrases to ensure the model responses are safe.

Protobuf type google.cloud.dialogflow.cx.v3.Generator

Implements

GeneratorOrBuilder

Static Methods

getDescriptor()

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

Methods

addAllPlaceholders(Iterable<? extends Generator.Placeholder> values)

public Generator.Builder addAllPlaceholders(Iterable<? extends Generator.Placeholder> values)

Optional. List of custom placeholders in the prompt text.

repeated .google.cloud.dialogflow.cx.v3.Generator.Placeholder placeholders = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valuesIterable<? extends com.google.cloud.dialogflow.cx.v3.Generator.Placeholder>
Returns
TypeDescription
Generator.Builder

addPlaceholders(Generator.Placeholder value)

public Generator.Builder addPlaceholders(Generator.Placeholder value)

Optional. List of custom placeholders in the prompt text.

repeated .google.cloud.dialogflow.cx.v3.Generator.Placeholder placeholders = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valueGenerator.Placeholder
Returns
TypeDescription
Generator.Builder

addPlaceholders(Generator.Placeholder.Builder builderForValue)

public Generator.Builder addPlaceholders(Generator.Placeholder.Builder builderForValue)

Optional. List of custom placeholders in the prompt text.

repeated .google.cloud.dialogflow.cx.v3.Generator.Placeholder placeholders = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
builderForValueGenerator.Placeholder.Builder
Returns
TypeDescription
Generator.Builder

addPlaceholders(int index, Generator.Placeholder value)

public Generator.Builder addPlaceholders(int index, Generator.Placeholder value)

Optional. List of custom placeholders in the prompt text.

repeated .google.cloud.dialogflow.cx.v3.Generator.Placeholder placeholders = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameters
NameDescription
indexint
valueGenerator.Placeholder
Returns
TypeDescription
Generator.Builder

addPlaceholders(int index, Generator.Placeholder.Builder builderForValue)

public Generator.Builder addPlaceholders(int index, Generator.Placeholder.Builder builderForValue)

Optional. List of custom placeholders in the prompt text.

repeated .google.cloud.dialogflow.cx.v3.Generator.Placeholder placeholders = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameters
NameDescription
indexint
builderForValueGenerator.Placeholder.Builder
Returns
TypeDescription
Generator.Builder

addPlaceholdersBuilder()

public Generator.Placeholder.Builder addPlaceholdersBuilder()

Optional. List of custom placeholders in the prompt text.

repeated .google.cloud.dialogflow.cx.v3.Generator.Placeholder placeholders = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
Generator.Placeholder.Builder

addPlaceholdersBuilder(int index)

public Generator.Placeholder.Builder addPlaceholdersBuilder(int index)

Optional. List of custom placeholders in the prompt text.

repeated .google.cloud.dialogflow.cx.v3.Generator.Placeholder placeholders = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
indexint
Returns
TypeDescription
Generator.Placeholder.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Generator.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Generator.Builder
Overrides

build()

public Generator build()
Returns
TypeDescription
Generator

buildPartial()

public Generator buildPartial()
Returns
TypeDescription
Generator

clear()

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

clearDisplayName()

public Generator.Builder clearDisplayName()

Required. The human-readable name of the generator, unique within the agent. The prompt contains pre-defined parameters such as $conversation, $last-user-utterance, etc. populated by Dialogflow. It can also contain custom placeholders which will be resolved during fulfillment.

string display_name = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
Generator.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public Generator.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
Generator.Builder
Overrides

clearName()

public Generator.Builder clearName()

The unique identifier of the generator. Must be set for the Generators.UpdateGenerator method. [Generators.CreateGenerate][] populates the name automatically. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/generators/<Generator ID>.

string name = 1;

Returns
TypeDescription
Generator.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public Generator.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
Generator.Builder
Overrides

clearPlaceholders()

public Generator.Builder clearPlaceholders()

Optional. List of custom placeholders in the prompt text.

repeated .google.cloud.dialogflow.cx.v3.Generator.Placeholder placeholders = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
Generator.Builder

clearPromptText()

public Generator.Builder clearPromptText()

Required. Prompt for the LLM model.

.google.cloud.dialogflow.cx.v3.Phrase prompt_text = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
Generator.Builder

clone()

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

getDefaultInstanceForType()

public Generator getDefaultInstanceForType()
Returns
TypeDescription
Generator

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getDisplayName()

public String getDisplayName()

Required. The human-readable name of the generator, unique within the agent. The prompt contains pre-defined parameters such as $conversation, $last-user-utterance, etc. populated by Dialogflow. It can also contain custom placeholders which will be resolved during fulfillment.

string display_name = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
String

The displayName.

getDisplayNameBytes()

public ByteString getDisplayNameBytes()

Required. The human-readable name of the generator, unique within the agent. The prompt contains pre-defined parameters such as $conversation, $last-user-utterance, etc. populated by Dialogflow. It can also contain custom placeholders which will be resolved during fulfillment.

string display_name = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
ByteString

The bytes for displayName.

getName()

public String getName()

The unique identifier of the generator. Must be set for the Generators.UpdateGenerator method. [Generators.CreateGenerate][] populates the name automatically. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/generators/<Generator ID>.

string name = 1;

Returns
TypeDescription
String

The name.

getNameBytes()

public ByteString getNameBytes()

The unique identifier of the generator. Must be set for the Generators.UpdateGenerator method. [Generators.CreateGenerate][] populates the name automatically. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/generators/<Generator ID>.

string name = 1;

Returns
TypeDescription
ByteString

The bytes for name.

getPlaceholders(int index)

public Generator.Placeholder getPlaceholders(int index)

Optional. List of custom placeholders in the prompt text.

repeated .google.cloud.dialogflow.cx.v3.Generator.Placeholder placeholders = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
indexint
Returns
TypeDescription
Generator.Placeholder

getPlaceholdersBuilder(int index)

public Generator.Placeholder.Builder getPlaceholdersBuilder(int index)

Optional. List of custom placeholders in the prompt text.

repeated .google.cloud.dialogflow.cx.v3.Generator.Placeholder placeholders = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
indexint
Returns
TypeDescription
Generator.Placeholder.Builder

getPlaceholdersBuilderList()

public List<Generator.Placeholder.Builder> getPlaceholdersBuilderList()

Optional. List of custom placeholders in the prompt text.

repeated .google.cloud.dialogflow.cx.v3.Generator.Placeholder placeholders = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
List<Builder>

getPlaceholdersCount()

public int getPlaceholdersCount()

Optional. List of custom placeholders in the prompt text.

repeated .google.cloud.dialogflow.cx.v3.Generator.Placeholder placeholders = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
int

getPlaceholdersList()

public List<Generator.Placeholder> getPlaceholdersList()

Optional. List of custom placeholders in the prompt text.

repeated .google.cloud.dialogflow.cx.v3.Generator.Placeholder placeholders = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
List<Placeholder>

getPlaceholdersOrBuilder(int index)

public Generator.PlaceholderOrBuilder getPlaceholdersOrBuilder(int index)

Optional. List of custom placeholders in the prompt text.

repeated .google.cloud.dialogflow.cx.v3.Generator.Placeholder placeholders = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
indexint
Returns
TypeDescription
Generator.PlaceholderOrBuilder

getPlaceholdersOrBuilderList()

public List<? extends Generator.PlaceholderOrBuilder> getPlaceholdersOrBuilderList()

Optional. List of custom placeholders in the prompt text.

repeated .google.cloud.dialogflow.cx.v3.Generator.Placeholder placeholders = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
List<? extends com.google.cloud.dialogflow.cx.v3.Generator.PlaceholderOrBuilder>

getPromptText()

public Phrase getPromptText()

Required. Prompt for the LLM model.

.google.cloud.dialogflow.cx.v3.Phrase prompt_text = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
Phrase

The promptText.

getPromptTextBuilder()

public Phrase.Builder getPromptTextBuilder()

Required. Prompt for the LLM model.

.google.cloud.dialogflow.cx.v3.Phrase prompt_text = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
Phrase.Builder

getPromptTextOrBuilder()

public PhraseOrBuilder getPromptTextOrBuilder()

Required. Prompt for the LLM model.

.google.cloud.dialogflow.cx.v3.Phrase prompt_text = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
PhraseOrBuilder

hasPromptText()

public boolean hasPromptText()

Required. Prompt for the LLM model.

.google.cloud.dialogflow.cx.v3.Phrase prompt_text = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
boolean

Whether the promptText field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(Generator other)

public Generator.Builder mergeFrom(Generator other)
Parameter
NameDescription
otherGenerator
Returns
TypeDescription
Generator.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

public Generator.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
Generator.Builder
Overrides

mergePromptText(Phrase value)

public Generator.Builder mergePromptText(Phrase value)

Required. Prompt for the LLM model.

.google.cloud.dialogflow.cx.v3.Phrase prompt_text = 3 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valuePhrase
Returns
TypeDescription
Generator.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

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

removePlaceholders(int index)

public Generator.Builder removePlaceholders(int index)

Optional. List of custom placeholders in the prompt text.

repeated .google.cloud.dialogflow.cx.v3.Generator.Placeholder placeholders = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
indexint
Returns
TypeDescription
Generator.Builder

setDisplayName(String value)

public Generator.Builder setDisplayName(String value)

Required. The human-readable name of the generator, unique within the agent. The prompt contains pre-defined parameters such as $conversation, $last-user-utterance, etc. populated by Dialogflow. It can also contain custom placeholders which will be resolved during fulfillment.

string display_name = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueString

The displayName to set.

Returns
TypeDescription
Generator.Builder

This builder for chaining.

setDisplayNameBytes(ByteString value)

public Generator.Builder setDisplayNameBytes(ByteString value)

Required. The human-readable name of the generator, unique within the agent. The prompt contains pre-defined parameters such as $conversation, $last-user-utterance, etc. populated by Dialogflow. It can also contain custom placeholders which will be resolved during fulfillment.

string display_name = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valueByteString

The bytes for displayName to set.

Returns
TypeDescription
Generator.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public Generator.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Generator.Builder
Overrides

setName(String value)

public Generator.Builder setName(String value)

The unique identifier of the generator. Must be set for the Generators.UpdateGenerator method. [Generators.CreateGenerate][] populates the name automatically. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/generators/<Generator ID>.

string name = 1;

Parameter
NameDescription
valueString

The name to set.

Returns
TypeDescription
Generator.Builder

This builder for chaining.

setNameBytes(ByteString value)

public Generator.Builder setNameBytes(ByteString value)

The unique identifier of the generator. Must be set for the Generators.UpdateGenerator method. [Generators.CreateGenerate][] populates the name automatically. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/generators/<Generator ID>.

string name = 1;

Parameter
NameDescription
valueByteString

The bytes for name to set.

Returns
TypeDescription
Generator.Builder

This builder for chaining.

setPlaceholders(int index, Generator.Placeholder value)

public Generator.Builder setPlaceholders(int index, Generator.Placeholder value)

Optional. List of custom placeholders in the prompt text.

repeated .google.cloud.dialogflow.cx.v3.Generator.Placeholder placeholders = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameters
NameDescription
indexint
valueGenerator.Placeholder
Returns
TypeDescription
Generator.Builder

setPlaceholders(int index, Generator.Placeholder.Builder builderForValue)

public Generator.Builder setPlaceholders(int index, Generator.Placeholder.Builder builderForValue)

Optional. List of custom placeholders in the prompt text.

repeated .google.cloud.dialogflow.cx.v3.Generator.Placeholder placeholders = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameters
NameDescription
indexint
builderForValueGenerator.Placeholder.Builder
Returns
TypeDescription
Generator.Builder

setPromptText(Phrase value)

public Generator.Builder setPromptText(Phrase value)

Required. Prompt for the LLM model.

.google.cloud.dialogflow.cx.v3.Phrase prompt_text = 3 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
valuePhrase
Returns
TypeDescription
Generator.Builder

setPromptText(Phrase.Builder builderForValue)

public Generator.Builder setPromptText(Phrase.Builder builderForValue)

Required. Prompt for the LLM model.

.google.cloud.dialogflow.cx.v3.Phrase prompt_text = 3 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
builderForValuePhrase.Builder
Returns
TypeDescription
Generator.Builder

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

public Generator.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
Generator.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

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