Class Generator (0.52.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
TypeDescription
int

LLM_MODEL_SETTINGS_FIELD_NUMBER

public static final int LLM_MODEL_SETTINGS_FIELD_NUMBER
Field Value
TypeDescription
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
TypeDescription
int

PLACEHOLDERS_FIELD_NUMBER

public static final int PLACEHOLDERS_FIELD_NUMBER
Field Value
TypeDescription
int

PROMPT_TEXT_FIELD_NUMBER

public static final int PROMPT_TEXT_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static Generator getDefaultInstance()
Returns
TypeDescription
Generator

getDescriptor()

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

newBuilder()

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

newBuilder(Generator prototype)

public static Generator.Builder newBuilder(Generator prototype)
Parameter
NameDescription
prototypeGenerator
Returns
TypeDescription
Generator.Builder

parseDelimitedFrom(InputStream input)

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

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(byte[] data)

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

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteString data)

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

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(CodedInputStream input)

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

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(InputStream input)

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

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteBuffer data)

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

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

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

parser()

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

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getDefaultInstanceForType()

public Generator getDefaultInstanceForType()
Returns
TypeDescription
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
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.

getLlmModelSettings()

public LlmModelSettings getLlmModelSettings()

The LLM model settings.

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

Returns
TypeDescription
LlmModelSettings

The llmModelSettings.

getLlmModelSettingsOrBuilder()

public LlmModelSettingsOrBuilder getLlmModelSettingsOrBuilder()

The LLM model settings.

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

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

getParserForType()

public Parser<Generator> getParserForType()
Returns
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
TypeDescription
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
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.v3beta1.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.v3beta1.Generator.Placeholder placeholders = 5 [(.google.api.field_behavior) = OPTIONAL];

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

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

hasLlmModelSettings()

public boolean hasLlmModelSettings()

The LLM model settings.

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

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

Whether the promptText 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 Generator.Builder newBuilderForType()
Returns
TypeDescription
Generator.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

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

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

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

toBuilder()

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

writeTo(CodedOutputStream output)

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