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

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/<ProjectID>/locations/<LocationID>/agents/<AgentID>/generators/<GeneratorID>.

↳ 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 Phrase

Required. Prompt for the LLM model.

↳ placeholders array<Generator\Placeholder>

Optional. List of custom placeholders in the prompt text.

↳ model_parameter Generator\ModelParameter

Parameters passed to the LLM to configure its behavior.

getName

The unique identifier of the generator.

Must be set for the Generators.UpdateGenerator method. Generators.CreateGenerate populates the name automatically. Format: projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/generators/<GeneratorID>.

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/<ProjectID>/locations/<LocationID>/agents/<AgentID>/generators/<GeneratorID>.

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
Phrase|null

hasPromptText

clearPromptText

setPromptText

Required. Prompt for the LLM model.

Parameter
Name Description
var 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<Generator\Placeholder>
Returns
Type Description
$this

getModelParameter

Parameters passed to the LLM to configure its behavior.

Returns
Type Description
Generator\ModelParameter|null

hasModelParameter

clearModelParameter

setModelParameter

Parameters passed to the LLM to configure its behavior.

Parameter
Name Description
var Generator\ModelParameter
Returns
Type Description
$this