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 \ V1betaMethods
__construct
Constructor.
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
↳ update_time
↳ 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.
hasMediaConfig
setMediaConfig
The MediaConfig of the serving configuration.
$this
getGenericConfig
The GenericConfig of the serving configuration.
hasGenericConfig
setGenericConfig
The GenericConfig of the serving configuration.
$this
getName
Immutable. Fully qualified name projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}/servingConfigs/{serving_config_id}
string
setName
Immutable. Fully qualified name projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}/servingConfigs/{serving_config_id}
var
string
$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.
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.
var
string
$this
getSolutionType
Required. Immutable. Specifies the solution type that a serving config can be associated with.
int
setSolutionType
Required. Immutable. Specifies the solution type that a serving config can be associated with.
var
int
$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 .
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 .
var
string
$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 .
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 .
var
string
$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 .
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 .
$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).
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).
var
string
$this
getCreateTime
Output only. ServingConfig created timestamp.
hasCreateTime
clearCreateTime
setCreateTime
Output only. ServingConfig created timestamp.
$this
getUpdateTime
Output only. ServingConfig updated timestamp.
hasUpdateTime
clearUpdateTime
setUpdateTime
Output only. ServingConfig updated timestamp.
$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.
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.
var
string[]
$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.
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.
var
string[]
$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 .
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 .
var
string[]
$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 .
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 .
var
string[]
$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 .
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 .
var
string[]
$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 .
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 .
var
string[]
$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 .
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 .
var
string[]
$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.
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.
var
string[]
$this
getVerticalConfig
string