Class Generator (0.60.0)

public final class Generator extends GeneratedMessageV3 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.v3beta1.Generator

Implements

GeneratorOrBuilder

Static Fields

DISPLAY_NAME_FIELD_NUMBER

public static final int DISPLAY_NAME_FIELD_NUMBER
Field Value
Type Description
int

LLM_MODEL_SETTINGS_FIELD_NUMBER

public static final int LLM_MODEL_SETTINGS_FIELD_NUMBER
Field Value
Type Description
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
Type Description
int

PLACEHOLDERS_FIELD_NUMBER

public static final int PLACEHOLDERS_FIELD_NUMBER
Field Value
Type Description
int

PROMPT_TEXT_FIELD_NUMBER

public static final int PROMPT_TEXT_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static Generator getDefaultInstance()
Returns
Type Description
Generator

getDescriptor()

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

newBuilder()

public static Generator.Builder newBuilder()
Returns
Type Description
Generator.Builder

newBuilder(Generator prototype)

public static Generator.Builder newBuilder(Generator prototype)
Parameter
Name Description
prototype Generator
Returns
Type Description
Generator.Builder

parseDelimitedFrom(InputStream input)

public static Generator parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Generator
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Generator parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Generator
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static Generator parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
Generator
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Generator parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Generator
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Generator parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
Generator
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Generator parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Generator
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Generator parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Generator
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Generator parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Generator
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static Generator parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Generator
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Generator parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Generator
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static Generator parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Generator
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Generator parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Generator
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<Generator> parser()
Returns
Type Description
Parser<Generator>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getDefaultInstanceForType()

public Generator getDefaultInstanceForType()
Returns
Type Description
Generator

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.

getLlmModelSettings()

public LlmModelSettings getLlmModelSettings()

The LLM model settings.

.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings llm_model_settings = 9;

Returns
Type Description
LlmModelSettings

The llmModelSettings.

getLlmModelSettingsOrBuilder()

public LlmModelSettingsOrBuilder getLlmModelSettingsOrBuilder()

The LLM model settings.

.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings llm_model_settings = 9;

Returns
Type Description
LlmModelSettingsOrBuilder

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.

getParserForType()

public Parser<Generator> getParserForType()
Returns
Type Description
Parser<Generator>
Overrides

getPlaceholders(int index)

public Generator.Placeholder getPlaceholders(int index)

Optional. List of custom placeholders in the prompt text.

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

Parameter
Name Description
index int
Returns
Type Description
Generator.Placeholder

getPlaceholdersCount()

public int getPlaceholdersCount()

Optional. List of custom placeholders in the prompt text.

repeated .google.cloud.dialogflow.cx.v3beta1.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.v3beta1.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.v3beta1.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.v3beta1.Generator.Placeholder placeholders = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
List<? extends com.google.cloud.dialogflow.cx.v3beta1.Generator.PlaceholderOrBuilder>

getPromptText()

public Phrase getPromptText()

Required. Prompt for the LLM model.

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

Returns
Type Description
Phrase

The promptText.

getPromptTextOrBuilder()

public PhraseOrBuilder getPromptTextOrBuilder()

Required. Prompt for the LLM model.

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

Returns
Type Description
PhraseOrBuilder

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

hasLlmModelSettings()

public boolean hasLlmModelSettings()

The LLM model settings.

.google.cloud.dialogflow.cx.v3beta1.LlmModelSettings llm_model_settings = 9;

Returns
Type Description
boolean

Whether the llmModelSettings field is set.

hasPromptText()

public boolean hasPromptText()

Required. Prompt for the LLM model.

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

Returns
Type Description
boolean

Whether the promptText field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public Generator.Builder newBuilderForType()
Returns
Type Description
Generator.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Generator.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Generator.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public Generator.Builder toBuilder()
Returns
Type Description
Generator.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException