Required. The ordered list of training phrase parts. The parts are concatenated in order to form the training phrase. Note: The API does not automatically annotate training phrases like the Dialogflow Console does. Note: Do not forget to include whitespace at part boundaries, so the training phrase is well formatted when the parts are concatenated. If the training phrase does not need to be annotated with parameters, you just need a single part with only the Part.text field set. If you want to annotate the training phrase, you must create multiple parts, where the fields of each part are populated in one of two ways: - Part.text is set to a part of the phrase that has no parameters. - Part.text is set to a part of the phrase that you want to annotate, and the entity_type, alias, and user_defined fields are all set.
↳ times_added_count
int
Optional. Indicates how many times this example was added to the intent. Each time a developer adds an existing sample by editing an intent or training, this counter is increased.
getName
Output only. The unique identifier of this training phrase.
Returns
Type
Description
string
setName
Output only. The unique identifier of this training phrase.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getType
Required. The type of the training phrase.
Returns
Type
Description
int
setType
Required. The type of the training phrase.
Parameter
Name
Description
var
int
Returns
Type
Description
$this
getParts
Required. The ordered list of training phrase parts.
The parts are concatenated in order to form the training phrase.
Note: The API does not automatically annotate training phrases like the
Dialogflow Console does.
Note: Do not forget to include whitespace at part boundaries,
so the training phrase is well formatted when the parts are concatenated.
If the training phrase does not need to be annotated with parameters,
you just need a single part with only the
Part.text
field set.
If you want to annotate the training phrase, you must create multiple
parts, where the fields of each part are populated in one of two ways:
Part.text is set to a part of the phrase that has no parameters.
Part.text is set to a part of the phrase that you want to annotate,
and the entity_type, alias, and user_defined fields are all
set.
Required. The ordered list of training phrase parts.
The parts are concatenated in order to form the training phrase.
Note: The API does not automatically annotate training phrases like the
Dialogflow Console does.
Note: Do not forget to include whitespace at part boundaries,
so the training phrase is well formatted when the parts are concatenated.
If the training phrase does not need to be annotated with parameters,
you just need a single part with only the
Part.text
field set.
If you want to annotate the training phrase, you must create multiple
parts, where the fields of each part are populated in one of two ways:
Part.text is set to a part of the phrase that has no parameters.
Part.text is set to a part of the phrase that you want to annotate,
and the entity_type, alias, and user_defined fields are all
set.
Optional. Indicates how many times this example was added to
the intent. Each time a developer adds an existing sample by editing an
intent or training, this counter is increased.
Returns
Type
Description
int
setTimesAddedCount
Optional. Indicates how many times this example was added to
the intent. Each time a developer adds an existing sample by editing an
intent or training, this counter is increased.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud Dialogflow V2 Client - Class TrainingPhrase (2.1.2)\n\nVersion latestkeyboard_arrow_down\n\n- [2.1.2 (latest)](/php/docs/reference/cloud-dialogflow/latest/V2.Intent.TrainingPhrase)\n- [2.1.1](/php/docs/reference/cloud-dialogflow/2.1.1/V2.Intent.TrainingPhrase)\n- [2.0.1](/php/docs/reference/cloud-dialogflow/2.0.1/V2.Intent.TrainingPhrase)\n- [1.17.2](/php/docs/reference/cloud-dialogflow/1.17.2/V2.Intent.TrainingPhrase)\n- [1.16.0](/php/docs/reference/cloud-dialogflow/1.16.0/V2.Intent.TrainingPhrase)\n- [1.15.1](/php/docs/reference/cloud-dialogflow/1.15.1/V2.Intent.TrainingPhrase)\n- [1.14.0](/php/docs/reference/cloud-dialogflow/1.14.0/V2.Intent.TrainingPhrase)\n- [1.13.0](/php/docs/reference/cloud-dialogflow/1.13.0/V2.Intent.TrainingPhrase)\n- [1.12.3](/php/docs/reference/cloud-dialogflow/1.12.3/V2.Intent.TrainingPhrase)\n- [1.11.0](/php/docs/reference/cloud-dialogflow/1.11.0/V2.Intent.TrainingPhrase)\n- [1.10.2](/php/docs/reference/cloud-dialogflow/1.10.2/V2.Intent.TrainingPhrase)\n- [1.9.0](/php/docs/reference/cloud-dialogflow/1.9.0/V2.Intent.TrainingPhrase)\n- [1.8.0](/php/docs/reference/cloud-dialogflow/1.8.0/V2.Intent.TrainingPhrase)\n- [1.7.2](/php/docs/reference/cloud-dialogflow/1.7.2/V2.Intent.TrainingPhrase)\n- [1.6.0](/php/docs/reference/cloud-dialogflow/1.6.0/V2.Intent.TrainingPhrase)\n- [1.5.0](/php/docs/reference/cloud-dialogflow/1.5.0/V2.Intent.TrainingPhrase)\n- [1.4.0](/php/docs/reference/cloud-dialogflow/1.4.0/V2.Intent.TrainingPhrase)\n- [1.3.2](/php/docs/reference/cloud-dialogflow/1.3.2/V2.Intent.TrainingPhrase)\n- [1.2.0](/php/docs/reference/cloud-dialogflow/1.2.0/V2.Intent.TrainingPhrase)\n- [1.1.1](/php/docs/reference/cloud-dialogflow/1.1.1/V2.Intent.TrainingPhrase)\n- [1.0.1](/php/docs/reference/cloud-dialogflow/1.0.1/V2.Intent.TrainingPhrase) \nReference documentation and code samples for the Google Cloud Dialogflow V2 Client class TrainingPhrase.\n\nRepresents an example that the agent is trained on.\n\nGenerated from protobuf message `google.cloud.dialogflow.v2.Intent.TrainingPhrase`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Dialogflow \\\\ V2 \\\\ Intent\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getName\n\nOutput only. The unique identifier of this training phrase.\n\n### setName\n\nOutput only. The unique identifier of this training phrase.\n\n### getType\n\nRequired. The type of the training phrase.\n\n### setType\n\nRequired. The type of the training phrase.\n\n### getParts\n\nRequired. The ordered list of training phrase parts.\n\nThe parts are concatenated in order to form the training phrase.\nNote: The API does not automatically annotate training phrases like the\nDialogflow Console does.\nNote: Do not forget to include whitespace at part boundaries,\nso the training phrase is well formatted when the parts are concatenated.\nIf the training phrase does not need to be annotated with parameters,\nyou just need a single part with only the\n[Part.text](/php/docs/reference/cloud-dialogflow/latest/V2.Intent.TrainingPhrase.Part#_Google_Cloud_Dialogflow_V2_Intent_TrainingPhrase_Part__getText__)\nfield set.\nIf you want to annotate the training phrase, you must create multiple\nparts, where the fields of each part are populated in one of two ways:\n\n- `Part.text` is set to a part of the phrase that has no parameters.\n- `Part.text` is set to a part of the phrase that you want to annotate, and the `entity_type`, `alias`, and `user_defined` fields are all set.\n\n### setParts\n\nRequired. The ordered list of training phrase parts.\n\nThe parts are concatenated in order to form the training phrase.\nNote: The API does not automatically annotate training phrases like the\nDialogflow Console does.\nNote: Do not forget to include whitespace at part boundaries,\nso the training phrase is well formatted when the parts are concatenated.\nIf the training phrase does not need to be annotated with parameters,\nyou just need a single part with only the\n[Part.text](/php/docs/reference/cloud-dialogflow/latest/V2.Intent.TrainingPhrase.Part#_Google_Cloud_Dialogflow_V2_Intent_TrainingPhrase_Part__getText__)\nfield set.\nIf you want to annotate the training phrase, you must create multiple\nparts, where the fields of each part are populated in one of two ways:\n\n- `Part.text` is set to a part of the phrase that has no parameters.\n- `Part.text` is set to a part of the phrase that you want to annotate, and the `entity_type`, `alias`, and `user_defined` fields are all set.\n\n### getTimesAddedCount\n\nOptional. Indicates how many times this example was added to\nthe intent. Each time a developer adds an existing sample by editing an\nintent or training, this counter is increased.\n\n### setTimesAddedCount\n\nOptional. Indicates how many times this example was added to\nthe intent. Each time a developer adds an existing sample by editing an\nintent or training, this counter is increased."]]