Reference documentation and code samples for the Google Cloud Discovery Engine V1 Client class GenerativeAnswerConfig.
Describes configuration for generative answer.
Generated from protobuf message google.cloud.discoveryengine.v1.WidgetConfig.UiSettings.GenerativeAnswerConfig
Namespace
Google \ Cloud \ DiscoveryEngine \ V1 \ WidgetConfig \ UiSettingsMethods
__construct
Constructor.
| Parameters | |
|---|---|
| Name | Description |
data |
array
Optional. Data for populating the Message object. |
↳ result_count |
int
The number of top results to generate the answer from. Up to 10. |
↳ model_version |
string
The model version used to generate the answer. |
↳ model_prompt_preamble |
string
Text at the beginning of the prompt that instructs the model that generates the answer. |
↳ max_rephrase_steps |
int
Max rephrase steps. The max number is 5 steps. If not set or set to < 1, it will be set to 1 by default. |
↳ language_code |
string
Language code for Summary. Use language tags defined by BCP47. Note: This is an experimental feature. |
↳ disable_related_questions |
bool
Whether generated answer contains suggested related questions. |
↳ ignore_non_answer_seeking_query |
bool
Optional. Specifies whether to filter out queries that are not answer-seeking. The default value is |
↳ ignore_adversarial_query |
bool
Optional. Specifies whether to filter out queries that are adversarial. |
↳ ignore_low_relevant_content |
bool
Optional. Specifies whether to filter out queries that are not relevant to the content. |
↳ image_source |
int
Optional. Source of image returned in the answer. |
getResultCount
The number of top results to generate the answer from. Up to 10.
| Returns | |
|---|---|
| Type | Description |
int |
|
setResultCount
The number of top results to generate the answer from. Up to 10.
| Parameter | |
|---|---|
| Name | Description |
var |
int
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getModelVersion
The model version used to generate the answer.
| Returns | |
|---|---|
| Type | Description |
string |
|
setModelVersion
The model version used to generate the answer.
| Parameter | |
|---|---|
| Name | Description |
var |
string
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getModelPromptPreamble
Text at the beginning of the prompt that instructs the model that generates the answer.
| Returns | |
|---|---|
| Type | Description |
string |
|
setModelPromptPreamble
Text at the beginning of the prompt that instructs the model that generates the answer.
| Parameter | |
|---|---|
| Name | Description |
var |
string
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getMaxRephraseSteps
Max rephrase steps.
The max number is 5 steps. If not set or set to < 1, it will be set to 1 by default.
| Returns | |
|---|---|
| Type | Description |
int |
|
setMaxRephraseSteps
Max rephrase steps.
The max number is 5 steps. If not set or set to < 1, it will be set to 1 by default.
| Parameter | |
|---|---|
| Name | Description |
var |
int
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getLanguageCode
Language code for Summary. Use language tags defined by BCP47.
Note: This is an experimental feature.
| Returns | |
|---|---|
| Type | Description |
string |
|
setLanguageCode
Language code for Summary. Use language tags defined by BCP47.
Note: This is an experimental feature.
| Parameter | |
|---|---|
| Name | Description |
var |
string
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getDisableRelatedQuestions
Whether generated answer contains suggested related questions.
| Returns | |
|---|---|
| Type | Description |
bool |
|
setDisableRelatedQuestions
Whether generated answer contains suggested related questions.
| Parameter | |
|---|---|
| Name | Description |
var |
bool
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getIgnoreNonAnswerSeekingQuery
Optional. Specifies whether to filter out queries that are not
answer-seeking. The default value is false.
No answer is returned if the search query is classified as a
non-answer seeking query. If this field is set to true, we skip
generating answers for non-answer seeking queries and return
fallback messages instead.
| Returns | |
|---|---|
| Type | Description |
bool |
|
setIgnoreNonAnswerSeekingQuery
Optional. Specifies whether to filter out queries that are not
answer-seeking. The default value is false.
No answer is returned if the search query is classified as a
non-answer seeking query. If this field is set to true, we skip
generating answers for non-answer seeking queries and return
fallback messages instead.
| Parameter | |
|---|---|
| Name | Description |
var |
bool
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getIgnoreAdversarialQuery
Optional. Specifies whether to filter out queries that are adversarial.
| Returns | |
|---|---|
| Type | Description |
bool |
|
setIgnoreAdversarialQuery
Optional. Specifies whether to filter out queries that are adversarial.
| Parameter | |
|---|---|
| Name | Description |
var |
bool
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getIgnoreLowRelevantContent
Optional. Specifies whether to filter out queries that are not relevant to the content.
| Returns | |
|---|---|
| Type | Description |
bool |
|
setIgnoreLowRelevantContent
Optional. Specifies whether to filter out queries that are not relevant to the content.
| Parameter | |
|---|---|
| Name | Description |
var |
bool
|
| Returns | |
|---|---|
| Type | Description |
$this |
|
getImageSource
Optional. Source of image returned in the answer.
| Returns | |
|---|---|
| Type | Description |
int |
Enum of type ImageSource. |
setImageSource
Optional. Source of image returned in the answer.
| Parameter | |
|---|---|
| Name | Description |
var |
int
Enum of type ImageSource. |
| Returns | |
|---|---|
| Type | Description |
$this |
|