Google Cloud Discovery Engine V1 Client - Class AnswerGenerationSpec (1.2.0)

Reference documentation and code samples for the Google Cloud Discovery Engine V1 Client class AnswerGenerationSpec.

Answer generation specification.

Generated from protobuf message google.cloud.discoveryengine.v1.AnswerQueryRequest.AnswerGenerationSpec

Namespace

Google \ Cloud \ DiscoveryEngine \ V1 \ AnswerQueryRequest

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ model_spec Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\AnswerGenerationSpec\ModelSpec

Answer generation model specification.

↳ prompt_spec Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\AnswerGenerationSpec\PromptSpec

Answer generation prompt specification.

↳ include_citations bool

Specifies whether to include citation metadata in the answer. The default value is false.

↳ answer_language_code string

Language code for Answer. Use language tags defined by BCP47. Note: This is an experimental feature.

↳ ignore_adversarial_query bool

Specifies whether to filter out adversarial queries. The default value is false. Google employs search-query classification to detect adversarial queries. No answer is returned if the search query is classified as an adversarial query. For example, a user might ask a question regarding negative comments about the company or submit a query designed to generate unsafe, policy-violating output. If this field is set to true, we skip generating answers for adversarial queries and return fallback messages instead.

↳ ignore_non_answer_seeking_query bool

Specifies whether to filter out queries that are not answer-seeking. The default value is false. Google employs search-query classification to detect answer-seeking queries. 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.

↳ ignore_low_relevant_content bool

Specifies whether to filter out queries that have low relevance. If this field is set to false, all search results are used regardless of relevance to generate answers. If set to true or unset, the behavior will be determined automatically by the service.

↳ ignore_jail_breaking_query bool

Optional. Specifies whether to filter out jail-breaking queries. The default value is false. Google employs search-query classification to detect jail-breaking queries. No summary is returned if the search query is classified as a jail-breaking query. A user might add instructions to the query to change the tone, style, language, content of the answer, or ask the model to act as a different entity, e.g. "Reply in the tone of a competing company's CEO". If this field is set to true, we skip generating summaries for jail-breaking queries and return fallback messages instead.

getModelSpec

Answer generation model specification.

Returns
Type Description
Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\AnswerGenerationSpec\ModelSpec|null

hasModelSpec

clearModelSpec

setModelSpec

Answer generation model specification.

Parameter
Name Description
var Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\AnswerGenerationSpec\ModelSpec
Returns
Type Description
$this

getPromptSpec

Answer generation prompt specification.

Returns
Type Description
Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\AnswerGenerationSpec\PromptSpec|null

hasPromptSpec

clearPromptSpec

setPromptSpec

Answer generation prompt specification.

Parameter
Name Description
var Google\Cloud\DiscoveryEngine\V1\AnswerQueryRequest\AnswerGenerationSpec\PromptSpec
Returns
Type Description
$this

getIncludeCitations

Specifies whether to include citation metadata in the answer. The default value is false.

Returns
Type Description
bool

setIncludeCitations

Specifies whether to include citation metadata in the answer. The default value is false.

Parameter
Name Description
var bool
Returns
Type Description
$this

getAnswerLanguageCode

Language code for Answer. Use language tags defined by BCP47.

Note: This is an experimental feature.

Returns
Type Description
string

setAnswerLanguageCode

Language code for Answer. Use language tags defined by BCP47.

Note: This is an experimental feature.

Parameter
Name Description
var string
Returns
Type Description
$this

getIgnoreAdversarialQuery

Specifies whether to filter out adversarial queries. The default value is false.

Google employs search-query classification to detect adversarial queries. No answer is returned if the search query is classified as an adversarial query. For example, a user might ask a question regarding negative comments about the company or submit a query designed to generate unsafe, policy-violating output. If this field is set to true, we skip generating answers for adversarial queries and return fallback messages instead.

Returns
Type Description
bool

setIgnoreAdversarialQuery

Specifies whether to filter out adversarial queries. The default value is false.

Google employs search-query classification to detect adversarial queries. No answer is returned if the search query is classified as an adversarial query. For example, a user might ask a question regarding negative comments about the company or submit a query designed to generate unsafe, policy-violating output. If this field is set to true, we skip generating answers for adversarial queries and return fallback messages instead.

Parameter
Name Description
var bool
Returns
Type Description
$this

getIgnoreNonAnswerSeekingQuery

Specifies whether to filter out queries that are not answer-seeking.

The default value is false. Google employs search-query classification to detect answer-seeking queries. 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

Specifies whether to filter out queries that are not answer-seeking.

The default value is false. Google employs search-query classification to detect answer-seeking queries. 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

getIgnoreLowRelevantContent

Specifies whether to filter out queries that have low relevance.

If this field is set to false, all search results are used regardless of relevance to generate answers. If set to true or unset, the behavior will be determined automatically by the service.

Returns
Type Description
bool

hasIgnoreLowRelevantContent

clearIgnoreLowRelevantContent

setIgnoreLowRelevantContent

Specifies whether to filter out queries that have low relevance.

If this field is set to false, all search results are used regardless of relevance to generate answers. If set to true or unset, the behavior will be determined automatically by the service.

Parameter
Name Description
var bool
Returns
Type Description
$this

getIgnoreJailBreakingQuery

Optional. Specifies whether to filter out jail-breaking queries. The default value is false.

Google employs search-query classification to detect jail-breaking queries. No summary is returned if the search query is classified as a jail-breaking query. A user might add instructions to the query to change the tone, style, language, content of the answer, or ask the model to act as a different entity, e.g. "Reply in the tone of a competing company's CEO". If this field is set to true, we skip generating summaries for jail-breaking queries and return fallback messages instead.

Returns
Type Description
bool

setIgnoreJailBreakingQuery

Optional. Specifies whether to filter out jail-breaking queries. The default value is false.

Google employs search-query classification to detect jail-breaking queries. No summary is returned if the search query is classified as a jail-breaking query. A user might add instructions to the query to change the tone, style, language, content of the answer, or ask the model to act as a different entity, e.g. "Reply in the tone of a competing company's CEO". If this field is set to true, we skip generating summaries for jail-breaking queries and return fallback messages instead.

Parameter
Name Description
var bool
Returns
Type Description
$this