Class Generator.Builder (0.60.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
Type Description
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
Name Description
values Iterable<? extends com.google.cloud.dialogflow.cx.v3.Generator.Placeholder>
Returns
Type Description
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
Name Description
value Generator.Placeholder
Returns
Type Description
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
Name Description
builderForValue Generator.Placeholder.Builder
Returns
Type Description
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
Name Description
index int
value Generator.Placeholder
Returns
Type Description
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
Name Description
index int
builderForValue Generator.Placeholder.Builder
Returns
Type Description
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
Type Description
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
Name Description
index int
Returns
Type Description
Generator.Placeholder.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public Generator build()
Returns
Type Description
Generator

buildPartial()

public Generator buildPartial()
Returns
Type Description
Generator

clear()

public Generator.Builder clear()
Returns
Type Description
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
Type Description
Generator.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public Generator.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
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
Type Description
Generator.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public Generator.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
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
Type Description
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
Type Description
Generator.Builder

clone()

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

getDefaultInstanceForType()

public Generator getDefaultInstanceForType()
Returns
Type Description
Generator

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Name Description
index int
Returns
Type Description
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
Name Description
index int
Returns
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Name Description
index int
Returns
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
boolean

Whether the promptText field is set.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(Generator other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

public Generator.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
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
Name Description
value Phrase
Returns
Type Description
Generator.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Generator.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
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
Name Description
index int
Returns
Type Description
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
Name Description
value String

The displayName to set.

Returns
Type Description
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
Name Description
value ByteString

The bytes for displayName to set.

Returns
Type Description
Generator.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

The name to set.

Returns
Type Description
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
Name Description
value ByteString

The bytes for name to set.

Returns
Type Description
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
Name Description
index int
value Generator.Placeholder
Returns
Type Description
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
Name Description
index int
builderForValue Generator.Placeholder.Builder
Returns
Type Description
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
Name Description
value Phrase
Returns
Type Description
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
Name Description
builderForValue Phrase.Builder
Returns
Type Description
Generator.Builder

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

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

setUnknownFields(UnknownFieldSet unknownFields)

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