Google Cloud Discovery Engine V1beta Client - Class ServingConfig (0.11.3)

Reference documentation and code samples for the Google Cloud Discovery Engine V1beta Client class ServingConfig.

Configures metadata that is used to generate serving time results (e.g.

search results or recommendation predictions). The ServingConfig is passed in the search and predict request and generates results.

Generated from protobuf message google.cloud.discoveryengine.v1beta.ServingConfig

Namespace

Google \ Cloud \ DiscoveryEngine \ V1beta

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ media_config Google\Cloud\DiscoveryEngine\V1beta\ServingConfig\MediaConfig

The MediaConfig of the serving configuration.

↳ generic_config Google\Cloud\DiscoveryEngine\V1beta\ServingConfig\GenericConfig

The GenericConfig of the serving configuration.

↳ name string

Immutable. Fully qualified name projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}/servingConfigs/{serving_config_id}

↳ display_name string

Required. The human readable serving config display name. Used in Discovery UI. This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.

↳ solution_type int

Required. Immutable. Specifies the solution type that a serving config can be associated with.

↳ model_id string

The id of the model to use at serving time. Currently only RecommendationModels are supported. Can be changed but only to a compatible model (e.g. others-you-may-like CTR to others-you-may-like CVR). Required when SolutionType is SOLUTION_TYPE_RECOMMENDATION.

↳ diversity_level string

How much diversity to use in recommendation model results e.g. medium-diversity or high-diversity. Currently supported values: * no-diversity * low-diversity * medium-diversity * high-diversity * auto-diversity If not specified, we choose default based on recommendation model type. Default value: no-diversity. Can only be set if SolutionType is SOLUTION_TYPE_RECOMMENDATION.

↳ embedding_config Google\Cloud\DiscoveryEngine\V1beta\EmbeddingConfig

Bring your own embedding config. The config is used for search semantic retrieval. The retrieval is based on the dot product of SearchRequest.EmbeddingSpec.EmbeddingVector.vector and the document embeddings that are provided by this EmbeddingConfig. If SearchRequest.EmbeddingSpec.EmbeddingVector.vector is provided, it overrides this ServingConfig.embedding_config.

↳ ranking_expression string

The ranking expression controls the customized ranking on retrieval documents. To leverage this, document embedding is required. The ranking expression setting in ServingConfig applies to all search requests served by the serving config. However, if SearchRequest.ranking_expression is specified, it overrides the ServingConfig ranking expression. The ranking expression is a single function or multiple functions that are joined by "+". * ranking_expression = function, { " + ", function }; Supported functions: * double * relevance_score * double * dotProduct(embedding_field_path) Function variables: relevance_score: pre-defined keywords, used for measure relevance between query and document. embedding_field_path: the document embedding field used with query embedding vector. dotProduct: embedding function between embedding_field_path and query embedding vector. Example ranking expression: If document has an embedding field doc_embedding, the ranking expression could be 0.5 * relevance_score + 0.3 * dotProduct(doc_embedding).

↳ create_time Google\Protobuf\Timestamp

Output only. ServingConfig created timestamp.

↳ update_time Google\Protobuf\Timestamp

Output only. ServingConfig updated timestamp.

↳ filter_control_ids array

Filter controls to use in serving path. All triggered filter controls will be applied. Filter controls must be in the same data store as the serving config. Maximum of 20 filter controls.

↳ boost_control_ids array

Boost controls to use in serving path. All triggered boost controls will be applied. Boost controls must be in the same data store as the serving config. Maximum of 20 boost controls.

↳ redirect_control_ids array

IDs of the redirect controls. Only the first triggered redirect action is applied, even if multiple apply. Maximum number of specifications is 100. Can only be set if SolutionType is SOLUTION_TYPE_SEARCH.

↳ synonyms_control_ids array

Condition synonyms specifications. If multiple synonyms conditions match, all matching synonyms controls in the list will execute. Maximum number of specifications is 100. Can only be set if SolutionType is SOLUTION_TYPE_SEARCH.

↳ oneway_synonyms_control_ids array

Condition oneway synonyms specifications. If multiple oneway synonyms conditions match, all matching oneway synonyms controls in the list will execute. Maximum number of specifications is 100. Can only be set if SolutionType is SOLUTION_TYPE_SEARCH.

↳ dissociate_control_ids array

Condition do not associate specifications. If multiple do not associate conditions match, all matching do not associate controls in the list will execute. Order does not matter. Maximum number of specifications is 100. Can only be set if SolutionType is SOLUTION_TYPE_SEARCH.

↳ replacement_control_ids array

Condition replacement specifications. Applied according to the order in the list. A previously replaced term can not be re-replaced. Maximum number of specifications is 100. Can only be set if SolutionType is SOLUTION_TYPE_SEARCH.

↳ ignore_control_ids array

Condition ignore specifications. If multiple ignore conditions match, all matching ignore controls in the list will execute. Order does not matter. Maximum number of specifications is 100.

getMediaConfig

The MediaConfig of the serving configuration.

Returns
Type Description
Google\Cloud\DiscoveryEngine\V1beta\ServingConfig\MediaConfig|null

hasMediaConfig

setMediaConfig

The MediaConfig of the serving configuration.

Parameter
Name Description
var Google\Cloud\DiscoveryEngine\V1beta\ServingConfig\MediaConfig
Returns
Type Description
$this

getGenericConfig

The GenericConfig of the serving configuration.

Returns
Type Description
Google\Cloud\DiscoveryEngine\V1beta\ServingConfig\GenericConfig|null

hasGenericConfig

setGenericConfig

The GenericConfig of the serving configuration.

Parameter
Name Description
var Google\Cloud\DiscoveryEngine\V1beta\ServingConfig\GenericConfig
Returns
Type Description
$this

getName

Immutable. Fully qualified name projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}/servingConfigs/{serving_config_id}

Returns
Type Description
string

setName

Immutable. Fully qualified name projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}/servingConfigs/{serving_config_id}

Parameter
Name Description
var string
Returns
Type Description
$this

getDisplayName

Required. The human readable serving config display name. Used in Discovery UI.

This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.

Returns
Type Description
string

setDisplayName

Required. The human readable serving config display name. Used in Discovery UI.

This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.

Parameter
Name Description
var string
Returns
Type Description
$this

getSolutionType

Required. Immutable. Specifies the solution type that a serving config can be associated with.

Returns
Type Description
int

setSolutionType

Required. Immutable. Specifies the solution type that a serving config can be associated with.

Parameter
Name Description
var int
Returns
Type Description
$this

getModelId

The id of the model to use at serving time.

Currently only RecommendationModels are supported. Can be changed but only to a compatible model (e.g. others-you-may-like CTR to others-you-may-like CVR). Required when SolutionType is SOLUTION_TYPE_RECOMMENDATION.

Returns
Type Description
string

setModelId

The id of the model to use at serving time.

Currently only RecommendationModels are supported. Can be changed but only to a compatible model (e.g. others-you-may-like CTR to others-you-may-like CVR). Required when SolutionType is SOLUTION_TYPE_RECOMMENDATION.

Parameter
Name Description
var string
Returns
Type Description
$this

getDiversityLevel

How much diversity to use in recommendation model results e.g.

medium-diversity or high-diversity. Currently supported values:

  • no-diversity
  • low-diversity
  • medium-diversity
  • high-diversity
  • auto-diversity If not specified, we choose default based on recommendation model type. Default value: no-diversity. Can only be set if SolutionType is SOLUTION_TYPE_RECOMMENDATION.
Returns
Type Description
string

setDiversityLevel

How much diversity to use in recommendation model results e.g.

medium-diversity or high-diversity. Currently supported values:

  • no-diversity
  • low-diversity
  • medium-diversity
  • high-diversity
  • auto-diversity If not specified, we choose default based on recommendation model type. Default value: no-diversity. Can only be set if SolutionType is SOLUTION_TYPE_RECOMMENDATION.
Parameter
Name Description
var string
Returns
Type Description
$this

getEmbeddingConfig

Bring your own embedding config. The config is used for search semantic retrieval. The retrieval is based on the dot product of SearchRequest.EmbeddingSpec.EmbeddingVector.vector and the document embeddings that are provided by this EmbeddingConfig. If SearchRequest.EmbeddingSpec.EmbeddingVector.vector is provided, it overrides this ServingConfig.embedding_config.

Returns
Type Description
Google\Cloud\DiscoveryEngine\V1beta\EmbeddingConfig|null

hasEmbeddingConfig

clearEmbeddingConfig

setEmbeddingConfig

Bring your own embedding config. The config is used for search semantic retrieval. The retrieval is based on the dot product of SearchRequest.EmbeddingSpec.EmbeddingVector.vector and the document embeddings that are provided by this EmbeddingConfig. If SearchRequest.EmbeddingSpec.EmbeddingVector.vector is provided, it overrides this ServingConfig.embedding_config.

Parameter
Name Description
var Google\Cloud\DiscoveryEngine\V1beta\EmbeddingConfig
Returns
Type Description
$this

getRankingExpression

The ranking expression controls the customized ranking on retrieval documents. To leverage this, document embedding is required. The ranking expression setting in ServingConfig applies to all search requests served by the serving config. However, if SearchRequest.ranking_expression is specified, it overrides the ServingConfig ranking expression.

The ranking expression is a single function or multiple functions that are joined by "+".

  • ranking_expression = function, { " + ", function }; Supported functions:
  • double * relevance_score
  • double * dotProduct(embedding_field_path) Function variables: relevance_score: pre-defined keywords, used for measure relevance between query and document. embedding_field_path: the document embedding field used with query embedding vector. dotProduct: embedding function between embedding_field_path and query embedding vector. Example ranking expression: If document has an embedding field doc_embedding, the ranking expression could be 0.5 * relevance_score + 0.3 * dotProduct(doc_embedding).
Returns
Type Description
string

setRankingExpression

The ranking expression controls the customized ranking on retrieval documents. To leverage this, document embedding is required. The ranking expression setting in ServingConfig applies to all search requests served by the serving config. However, if SearchRequest.ranking_expression is specified, it overrides the ServingConfig ranking expression.

The ranking expression is a single function or multiple functions that are joined by "+".

  • ranking_expression = function, { " + ", function }; Supported functions:
  • double * relevance_score
  • double * dotProduct(embedding_field_path) Function variables: relevance_score: pre-defined keywords, used for measure relevance between query and document. embedding_field_path: the document embedding field used with query embedding vector. dotProduct: embedding function between embedding_field_path and query embedding vector. Example ranking expression: If document has an embedding field doc_embedding, the ranking expression could be 0.5 * relevance_score + 0.3 * dotProduct(doc_embedding).
Parameter
Name Description
var string
Returns
Type Description
$this

getCreateTime

Output only. ServingConfig created timestamp.

Returns
Type Description
Google\Protobuf\Timestamp|null

hasCreateTime

clearCreateTime

setCreateTime

Output only. ServingConfig created timestamp.

Parameter
Name Description
var Google\Protobuf\Timestamp
Returns
Type Description
$this

getUpdateTime

Output only. ServingConfig updated timestamp.

Returns
Type Description
Google\Protobuf\Timestamp|null

hasUpdateTime

clearUpdateTime

setUpdateTime

Output only. ServingConfig updated timestamp.

Parameter
Name Description
var Google\Protobuf\Timestamp
Returns
Type Description
$this

getFilterControlIds

Filter controls to use in serving path.

All triggered filter controls will be applied. Filter controls must be in the same data store as the serving config. Maximum of 20 filter controls.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setFilterControlIds

Filter controls to use in serving path.

All triggered filter controls will be applied. Filter controls must be in the same data store as the serving config. Maximum of 20 filter controls.

Parameter
Name Description
var string[]
Returns
Type Description
$this

getBoostControlIds

Boost controls to use in serving path.

All triggered boost controls will be applied. Boost controls must be in the same data store as the serving config. Maximum of 20 boost controls.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setBoostControlIds

Boost controls to use in serving path.

All triggered boost controls will be applied. Boost controls must be in the same data store as the serving config. Maximum of 20 boost controls.

Parameter
Name Description
var string[]
Returns
Type Description
$this

getRedirectControlIds

IDs of the redirect controls. Only the first triggered redirect action is applied, even if multiple apply. Maximum number of specifications is 100.

Can only be set if SolutionType is SOLUTION_TYPE_SEARCH.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setRedirectControlIds

IDs of the redirect controls. Only the first triggered redirect action is applied, even if multiple apply. Maximum number of specifications is 100.

Can only be set if SolutionType is SOLUTION_TYPE_SEARCH.

Parameter
Name Description
var string[]
Returns
Type Description
$this

getSynonymsControlIds

Condition synonyms specifications. If multiple synonyms conditions match, all matching synonyms controls in the list will execute.

Maximum number of specifications is 100. Can only be set if SolutionType is SOLUTION_TYPE_SEARCH.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setSynonymsControlIds

Condition synonyms specifications. If multiple synonyms conditions match, all matching synonyms controls in the list will execute.

Maximum number of specifications is 100. Can only be set if SolutionType is SOLUTION_TYPE_SEARCH.

Parameter
Name Description
var string[]
Returns
Type Description
$this

getOnewaySynonymsControlIds

Condition oneway synonyms specifications. If multiple oneway synonyms conditions match, all matching oneway synonyms controls in the list will execute. Maximum number of specifications is 100.

Can only be set if SolutionType is SOLUTION_TYPE_SEARCH.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setOnewaySynonymsControlIds

Condition oneway synonyms specifications. If multiple oneway synonyms conditions match, all matching oneway synonyms controls in the list will execute. Maximum number of specifications is 100.

Can only be set if SolutionType is SOLUTION_TYPE_SEARCH.

Parameter
Name Description
var string[]
Returns
Type Description
$this

getDissociateControlIds

Condition do not associate specifications. If multiple do not associate conditions match, all matching do not associate controls in the list will execute.

Order does not matter. Maximum number of specifications is 100. Can only be set if SolutionType is SOLUTION_TYPE_SEARCH.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setDissociateControlIds

Condition do not associate specifications. If multiple do not associate conditions match, all matching do not associate controls in the list will execute.

Order does not matter. Maximum number of specifications is 100. Can only be set if SolutionType is SOLUTION_TYPE_SEARCH.

Parameter
Name Description
var string[]
Returns
Type Description
$this

getReplacementControlIds

Condition replacement specifications.

Applied according to the order in the list. A previously replaced term can not be re-replaced. Maximum number of specifications is 100. Can only be set if SolutionType is SOLUTION_TYPE_SEARCH.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setReplacementControlIds

Condition replacement specifications.

Applied according to the order in the list. A previously replaced term can not be re-replaced. Maximum number of specifications is 100. Can only be set if SolutionType is SOLUTION_TYPE_SEARCH.

Parameter
Name Description
var string[]
Returns
Type Description
$this

getIgnoreControlIds

Condition ignore specifications. If multiple ignore conditions match, all matching ignore controls in the list will execute.

Order does not matter. Maximum number of specifications is 100.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setIgnoreControlIds

Condition ignore specifications. If multiple ignore conditions match, all matching ignore controls in the list will execute.

Order does not matter. Maximum number of specifications is 100.

Parameter
Name Description
var string[]
Returns
Type Description
$this

getVerticalConfig

Returns
Type Description
string