Skip to main content

serving_configs

Creates, updates, deletes, gets or lists a serving_configs resource.

Overview

Nameserving_configs
TypeResource
Idgoogle.discoveryengine.serving_configs

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringImmutable. Fully qualified name projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}/servingConfigs/{serving_config_id}
answerGenerationSpecobjectOptional. The specification for answer generation. (id: GoogleCloudDiscoveryengineV1AnswerGenerationSpec)
boostControlIdsarrayBoost 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.
createTimestring (google-datetime)Output only. ServingConfig created timestamp.
displayNamestringRequired. 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.
dissociateControlIdsarrayCondition 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.
diversityLevelstringHow 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.
filterControlIdsarrayFilter 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.
genericConfigobjectThe GenericConfig of the serving configuration. (id: GoogleCloudDiscoveryengineV1ServingConfigGenericConfig)
ignoreControlIdsarrayCondition 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.
mediaConfigobjectThe MediaConfig of the serving configuration. (id: GoogleCloudDiscoveryengineV1ServingConfigMediaConfig)
modelIdstringThe 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.
onewaySynonymsControlIdsarrayCondition 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.
promoteControlIdsarrayCondition promote specifications. Maximum number of specifications is 100.
rankingExpressionstringThe 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).
redirectControlIdsarrayIDs 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.
replacementControlIdsarrayCondition 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.
solutionTypestringRequired. Immutable. Specifies the solution type that a serving config can be associated with.
synonymsControlIdsarrayCondition 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.
updateTimestring (google-datetime)Output only. ServingConfig updated timestamp.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_collections_engines_serving_configs_getselectprojectsId, locationsId, collectionsId, enginesId, servingConfigsIdGets a ServingConfig. Returns a NotFound error if the ServingConfig does not exist.
projects_locations_collections_data_stores_serving_configs_getselectprojectsId, locationsId, collectionsId, dataStoresId, servingConfigsIdGets a ServingConfig. Returns a NotFound error if the ServingConfig does not exist.
projects_locations_collections_engines_serving_configs_listselectprojectsId, locationsId, collectionsId, enginesIdpageToken, pageSizeLists all ServingConfigs linked to this dataStore.
projects_locations_collections_data_stores_serving_configs_listselectprojectsId, locationsId, collectionsId, dataStoresIdpageToken, pageSizeLists all ServingConfigs linked to this dataStore.
projects_locations_data_stores_serving_configs_getselectprojectsId, locationsId, dataStoresId, servingConfigsIdGets a ServingConfig. Returns a NotFound error if the ServingConfig does not exist.
projects_locations_data_stores_serving_configs_listselectprojectsId, locationsId, dataStoresIdpageSize, pageTokenLists all ServingConfigs linked to this dataStore.
projects_locations_collections_engines_serving_configs_patchupdateprojectsId, locationsId, collectionsId, enginesId, servingConfigsIdupdateMaskUpdates a ServingConfig. Returns a NOT_FOUND error if the ServingConfig does not exist.
projects_locations_collections_data_stores_serving_configs_patchupdateprojectsId, locationsId, collectionsId, dataStoresId, servingConfigsIdupdateMaskUpdates a ServingConfig. Returns a NOT_FOUND error if the ServingConfig does not exist.
projects_locations_data_stores_serving_configs_patchupdateprojectsId, locationsId, dataStoresId, servingConfigsIdupdateMaskUpdates a ServingConfig. Returns a NOT_FOUND error if the ServingConfig does not exist.
projects_locations_collections_engines_serving_configs_deletedeleteprojectsId, locationsId, collectionsId, enginesId, servingConfigsIdDeletes a ServingConfig. Returns a NOT_FOUND error if the ServingConfig does not exist.
projects_locations_collections_data_stores_serving_configs_deletedeleteprojectsId, locationsId, collectionsId, dataStoresId, servingConfigsIdDeletes a ServingConfig. Returns a NOT_FOUND error if the ServingConfig does not exist.
projects_locations_data_stores_serving_configs_deletedeleteprojectsId, locationsId, dataStoresId, servingConfigsIdDeletes a ServingConfig. Returns a NOT_FOUND error if the ServingConfig does not exist.
projects_locations_collections_engines_serving_configs_searchexecprojectsId, locationsId, collectionsId, enginesId, servingConfigsIdPerforms a search.
projects_locations_collections_engines_serving_configs_stream_answerexecprojectsId, locationsId, collectionsId, enginesId, servingConfigsIdAnswer query method (streaming). It takes one AnswerQueryRequest and returns multiple AnswerQueryResponse messages in a stream.
projects_locations_collections_engines_serving_configs_answerexecprojectsId, locationsId, collectionsId, enginesId, servingConfigsIdAnswer query method.
projects_locations_collections_engines_serving_configs_search_liteexecprojectsId, locationsId, collectionsId, enginesId, servingConfigsIdPerforms a search. Similar to the SearchService.Search method, but a lite version that allows API key for authentication, where OAuth and IAM checks are not required. Only public website search is supported by this method. If data stores and engines not associated with public website search are specified, a FAILED_PRECONDITION error is returned. This method can be used for easy onboarding without having to implement an authentication backend. However, it is strongly recommended to use SearchService.Search instead with required OAuth and IAM checks to provide better data security.
projects_locations_collections_engines_serving_configs_recommendexecprojectsId, locationsId, collectionsId, enginesId, servingConfigsIdMakes a recommendation, which requires a contextual user event.
projects_locations_collections_data_stores_serving_configs_recommendexecprojectsId, locationsId, collectionsId, dataStoresId, servingConfigsIdMakes a recommendation, which requires a contextual user event.
projects_locations_collections_data_stores_serving_configs_searchexecprojectsId, locationsId, collectionsId, dataStoresId, servingConfigsIdPerforms a search.
projects_locations_collections_data_stores_serving_configs_answerexecprojectsId, locationsId, collectionsId, dataStoresId, servingConfigsIdAnswer query method.
projects_locations_collections_data_stores_serving_configs_stream_answerexecprojectsId, locationsId, collectionsId, dataStoresId, servingConfigsIdAnswer query method (streaming). It takes one AnswerQueryRequest and returns multiple AnswerQueryResponse messages in a stream.
projects_locations_collections_data_stores_serving_configs_search_liteexecprojectsId, locationsId, collectionsId, dataStoresId, servingConfigsIdPerforms a search. Similar to the SearchService.Search method, but a lite version that allows API key for authentication, where OAuth and IAM checks are not required. Only public website search is supported by this method. If data stores and engines not associated with public website search are specified, a FAILED_PRECONDITION error is returned. This method can be used for easy onboarding without having to implement an authentication backend. However, it is strongly recommended to use SearchService.Search instead with required OAuth and IAM checks to provide better data security.
projects_locations_data_stores_serving_configs_searchexecprojectsId, locationsId, dataStoresId, servingConfigsIdPerforms a search.
projects_locations_data_stores_serving_configs_recommendexecprojectsId, locationsId, dataStoresId, servingConfigsIdMakes a recommendation, which requires a contextual user event.
projects_locations_data_stores_serving_configs_stream_answerexecprojectsId, locationsId, dataStoresId, servingConfigsIdAnswer query method (streaming). It takes one AnswerQueryRequest and returns multiple AnswerQueryResponse messages in a stream.
projects_locations_data_stores_serving_configs_answerexecprojectsId, locationsId, dataStoresId, servingConfigsIdAnswer query method.
projects_locations_data_stores_serving_configs_search_liteexecprojectsId, locationsId, dataStoresId, servingConfigsIdPerforms a search. Similar to the SearchService.Search method, but a lite version that allows API key for authentication, where OAuth and IAM checks are not required. Only public website search is supported by this method. If data stores and engines not associated with public website search are specified, a FAILED_PRECONDITION error is returned. This method can be used for easy onboarding without having to implement an authentication backend. However, it is strongly recommended to use SearchService.Search instead with required OAuth and IAM checks to provide better data security.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
collectionsIdstring
dataStoresIdstring
enginesIdstring
locationsIdstring
projectsIdstring
servingConfigsIdstring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets a ServingConfig. Returns a NotFound error if the ServingConfig does not exist.

SELECT
name,
answerGenerationSpec,
boostControlIds,
createTime,
displayName,
dissociateControlIds,
diversityLevel,
filterControlIds,
genericConfig,
ignoreControlIds,
mediaConfig,
modelId,
onewaySynonymsControlIds,
promoteControlIds,
rankingExpression,
redirectControlIds,
replacementControlIds,
solutionType,
synonymsControlIds,
updateTime
FROM google.discoveryengine.serving_configs
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND collectionsId = '{{ collectionsId }}' -- required
AND enginesId = '{{ enginesId }}' -- required
AND servingConfigsId = '{{ servingConfigsId }}' -- required
;

UPDATE examples

Updates a ServingConfig. Returns a NOT_FOUND error if the ServingConfig does not exist.

UPDATE google.discoveryengine.serving_configs
SET
data__name = '{{ name }}',
data__redirectControlIds = '{{ redirectControlIds }}',
data__synonymsControlIds = '{{ synonymsControlIds }}',
data__genericConfig = '{{ genericConfig }}',
data__mediaConfig = '{{ mediaConfig }}',
data__boostControlIds = '{{ boostControlIds }}',
data__ignoreControlIds = '{{ ignoreControlIds }}',
data__onewaySynonymsControlIds = '{{ onewaySynonymsControlIds }}',
data__solutionType = '{{ solutionType }}',
data__dissociateControlIds = '{{ dissociateControlIds }}',
data__rankingExpression = '{{ rankingExpression }}',
data__promoteControlIds = '{{ promoteControlIds }}',
data__diversityLevel = '{{ diversityLevel }}',
data__displayName = '{{ displayName }}',
data__modelId = '{{ modelId }}',
data__filterControlIds = '{{ filterControlIds }}',
data__answerGenerationSpec = '{{ answerGenerationSpec }}',
data__replacementControlIds = '{{ replacementControlIds }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND collectionsId = '{{ collectionsId }}' --required
AND enginesId = '{{ enginesId }}' --required
AND servingConfigsId = '{{ servingConfigsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
answerGenerationSpec,
boostControlIds,
createTime,
displayName,
dissociateControlIds,
diversityLevel,
filterControlIds,
genericConfig,
ignoreControlIds,
mediaConfig,
modelId,
onewaySynonymsControlIds,
promoteControlIds,
rankingExpression,
redirectControlIds,
replacementControlIds,
solutionType,
synonymsControlIds,
updateTime;

DELETE examples

Deletes a ServingConfig. Returns a NOT_FOUND error if the ServingConfig does not exist.

DELETE FROM google.discoveryengine.serving_configs
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND collectionsId = '{{ collectionsId }}' --required
AND enginesId = '{{ enginesId }}' --required
AND servingConfigsId = '{{ servingConfigsId }}' --required
;

Lifecycle Methods

Performs a search.

EXEC google.discoveryengine.serving_configs.projects_locations_collections_engines_serving_configs_search 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@collectionsId='{{ collectionsId }}' --required,
@enginesId='{{ enginesId }}' --required,
@servingConfigsId='{{ servingConfigsId }}' --required
@@json=
'{
"displaySpec": "{{ displaySpec }}",
"relevanceThreshold": "{{ relevanceThreshold }}",
"imageQuery": "{{ imageQuery }}",
"spellCorrectionSpec": "{{ spellCorrectionSpec }}",
"safeSearch": {{ safeSearch }},
"queryExpansionSpec": "{{ queryExpansionSpec }}",
"userPseudoId": "{{ userPseudoId }}",
"rankingExpressionBackend": "{{ rankingExpressionBackend }}",
"relevanceScoreSpec": "{{ relevanceScoreSpec }}",
"session": "{{ session }}",
"searchAsYouTypeSpec": "{{ searchAsYouTypeSpec }}",
"dataStoreSpecs": "{{ dataStoreSpecs }}",
"filter": "{{ filter }}",
"boostSpec": "{{ boostSpec }}",
"canonicalFilter": "{{ canonicalFilter }}",
"params": "{{ params }}",
"crowdingSpecs": "{{ crowdingSpecs }}",
"userLabels": "{{ userLabels }}",
"userInfo": "{{ userInfo }}",
"contentSearchSpec": "{{ contentSearchSpec }}",
"naturalLanguageQueryUnderstandingSpec": "{{ naturalLanguageQueryUnderstandingSpec }}",
"query": "{{ query }}",
"orderBy": "{{ orderBy }}",
"oneBoxPageSize": {{ oneBoxPageSize }},
"pageToken": "{{ pageToken }}",
"sessionSpec": "{{ sessionSpec }}",
"rankingExpression": "{{ rankingExpression }}",
"pageSize": {{ pageSize }},
"offset": {{ offset }},
"branch": "{{ branch }}",
"pageCategories": "{{ pageCategories }}",
"facetSpecs": "{{ facetSpecs }}",
"languageCode": "{{ languageCode }}"
}'
;