Google Cloud Dialogflow Cx V3 Client - Class Generator (0.3.4)

Reference documentation and code samples for the Google Cloud Dialogflow Cx V3 Client class Generator.

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.

Generated from protobuf message google.cloud.dialogflow.cx.v3.Generator

Namespace

Google \ Cloud \ Dialogflow \ Cx \ V3

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ name string

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

↳ display_name string

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.

↳ prompt_text Google\Cloud\Dialogflow\Cx\V3\Phrase

Required. Prompt for the LLM model.

↳ placeholders array<Google\Cloud\Dialogflow\Cx\V3\Generator\Placeholder>

Optional. List of custom placeholders in the prompt text.

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

Returns
Type Description
string

setName

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

Parameter
Name Description
var string
Returns
Type Description
$this

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.

Returns
Type Description
string

setDisplayName

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.

Parameter
Name Description
var string
Returns
Type Description
$this

getPromptText

Required. Prompt for the LLM model.

Returns
Type Description
Google\Cloud\Dialogflow\Cx\V3\Phrase|null

hasPromptText

clearPromptText

setPromptText

Required. Prompt for the LLM model.

Parameter
Name Description
var Google\Cloud\Dialogflow\Cx\V3\Phrase
Returns
Type Description
$this

getPlaceholders

Optional. List of custom placeholders in the prompt text.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setPlaceholders

Optional. List of custom placeholders in the prompt text.

Parameter
Name Description
var array<Google\Cloud\Dialogflow\Cx\V3\Generator\Placeholder>
Returns
Type Description
$this