Reference documentation and code samples for the Google Cloud Discovery Engine V1 Client class BannedPhrase.
Definition of a customer-defined banned phrase. A banned phrase is not allowed to appear in the user query or the LLM response, or else the answer will be refused.
Generated from protobuf message google.cloud.discoveryengine.v1.Assistant.CustomerPolicy.BannedPhrase
Namespace
Google \ Cloud \ DiscoveryEngine \ V1 \ Assistant \ CustomerPolicyMethods
__construct
Constructor.
| Parameters | |
|---|---|
| Name | Description |
data |
array
Optional. Data for populating the Message object. |
↳ phrase |
string
Required. The raw string content to be banned. |
↳ match_type |
int
Optional. Match type for the banned phrase. |
↳ ignore_diacritics |
bool
Optional. If true, diacritical marks (e.g., accents, umlauts) are ignored when matching banned phrases. For example, "cafe" would match "café". |
getPhrase
Required. The raw string content to be banned.
| Returns | |
|---|---|
| Type | Description |
string |
|
setPhrase
Required. The raw string content to be banned.
| Parameter | |
|---|---|
| Name | Description |
var |
string
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getMatchType
Optional. Match type for the banned phrase.
| Returns | |
|---|---|
| Type | Description |
int |
Enum of type BannedPhraseMatchType. |
setMatchType
Optional. Match type for the banned phrase.
| Parameter | |
|---|---|
| Name | Description |
var |
int
Enum of type BannedPhraseMatchType. |
| Returns | |
|---|---|
| Type | Description |
$this |
|
getIgnoreDiacritics
Optional. If true, diacritical marks (e.g., accents, umlauts) are ignored when matching banned phrases. For example, "cafe" would match "café".
| Returns | |
|---|---|
| Type | Description |
bool |
|
setIgnoreDiacritics
Optional. If true, diacritical marks (e.g., accents, umlauts) are ignored when matching banned phrases. For example, "cafe" would match "café".
| Parameter | |
|---|---|
| Name | Description |
var |
bool
|
| Returns | |
|---|---|
| Type | Description |
$this |
|