Service for making recommendations. v1beta
Package
@google-cloud/discoveryengineConstructors
(constructor)(opts, gaxInstance)
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
Construct an instance of RecommendationServiceClient.
Parameters | |
---|---|
Name | Description |
opts |
ClientOptions
|
gaxInstance |
typeof gax | typeof gax.fallback
: loaded instance of |
Properties
apiEndpoint
static get apiEndpoint(): string;
The DNS address for this API service - same as servicePath(), exists for compatibility reasons.
auth
auth: gax.GoogleAuth;
descriptors
descriptors: Descriptors;
innerApiCalls
innerApiCalls: {
[name: string]: Function;
};
pathTemplates
pathTemplates: {
[name: string]: gax.PathTemplate;
};
port
static get port(): number;
The port for this API service.
recommendationServiceStub
recommendationServiceStub?: Promise<{
[name: string]: Function;
}>;
scopes
static get scopes(): string[];
The scopes needed to make gRPC calls for every method defined in this service.
servicePath
static get servicePath(): string;
The DNS address for this API service.
warn
warn: (code: string, message: string, warnType?: string) => void;
Methods
close()
close(): Promise<void>;
Terminate the gRPC channel and close the client.
The client will no longer be usable and all future behavior is undefined.
Returns | |
---|---|
Type | Description |
Promise<void> | {Promise} A promise that resolves when the client is closed. |
getProjectId()
getProjectId(): Promise<string>;
Returns | |
---|---|
Type | Description |
Promise<string> |
getProjectId(callback)
getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter | |
---|---|
Name | Description |
callback |
Callback<string, undefined, undefined>
|
Returns | |
---|---|
Type | Description |
void |
initialize()
initialize(): Promise<{
[name: string]: Function;
}>;
Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.
You can await on this method if you want to make sure the client is initialized.
Returns | |
---|---|
Type | Description |
Promise<{
[name: string]: Function;
}> | {Promise} A promise that resolves to an authenticated service stub. |
matchBranchFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName)
matchBranchFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName: string): string | number;
Parse the branch from ProjectLocationCollectionDataStoreBranchDocument resource.
Parameter | |
---|---|
Name | Description |
projectLocationCollectionDataStoreBranchDocumentName |
string
A fully-qualified path representing project_location_collection_data_store_branch_document resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the branch. |
matchBranchFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName)
matchBranchFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName: string): string | number;
Parse the branch from ProjectLocationDataStoreBranchDocument resource.
Parameter | |
---|---|
Name | Description |
projectLocationDataStoreBranchDocumentName |
string
A fully-qualified path representing project_location_data_store_branch_document resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the branch. |
matchCollectionFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName)
matchCollectionFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName: string): string | number;
Parse the collection from ProjectLocationCollectionDataStoreBranchDocument resource.
Parameter | |
---|---|
Name | Description |
projectLocationCollectionDataStoreBranchDocumentName |
string
A fully-qualified path representing project_location_collection_data_store_branch_document resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the collection. |
matchCollectionFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName)
matchCollectionFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName: string): string | number;
Parse the collection from ProjectLocationCollectionDataStoreSchema resource.
Parameter | |
---|---|
Name | Description |
projectLocationCollectionDataStoreSchemaName |
string
A fully-qualified path representing project_location_collection_data_store_schema resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the collection. |
matchCollectionFromProjectLocationCollectionDataStoreServingConfigName(projectLocationCollectionDataStoreServingConfigName)
matchCollectionFromProjectLocationCollectionDataStoreServingConfigName(projectLocationCollectionDataStoreServingConfigName: string): string | number;
Parse the collection from ProjectLocationCollectionDataStoreServingConfig resource.
Parameter | |
---|---|
Name | Description |
projectLocationCollectionDataStoreServingConfigName |
string
A fully-qualified path representing project_location_collection_data_store_serving_config resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the collection. |
matchDataStoreFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName)
matchDataStoreFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName: string): string | number;
Parse the data_store from ProjectLocationCollectionDataStoreBranchDocument resource.
Parameter | |
---|---|
Name | Description |
projectLocationCollectionDataStoreBranchDocumentName |
string
A fully-qualified path representing project_location_collection_data_store_branch_document resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the data_store. |
matchDataStoreFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName)
matchDataStoreFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName: string): string | number;
Parse the data_store from ProjectLocationCollectionDataStoreSchema resource.
Parameter | |
---|---|
Name | Description |
projectLocationCollectionDataStoreSchemaName |
string
A fully-qualified path representing project_location_collection_data_store_schema resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the data_store. |
matchDataStoreFromProjectLocationCollectionDataStoreServingConfigName(projectLocationCollectionDataStoreServingConfigName)
matchDataStoreFromProjectLocationCollectionDataStoreServingConfigName(projectLocationCollectionDataStoreServingConfigName: string): string | number;
Parse the data_store from ProjectLocationCollectionDataStoreServingConfig resource.
Parameter | |
---|---|
Name | Description |
projectLocationCollectionDataStoreServingConfigName |
string
A fully-qualified path representing project_location_collection_data_store_serving_config resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the data_store. |
matchDataStoreFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName)
matchDataStoreFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName: string): string | number;
Parse the data_store from ProjectLocationDataStoreBranchDocument resource.
Parameter | |
---|---|
Name | Description |
projectLocationDataStoreBranchDocumentName |
string
A fully-qualified path representing project_location_data_store_branch_document resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the data_store. |
matchDataStoreFromProjectLocationDataStoreSchemaName(projectLocationDataStoreSchemaName)
matchDataStoreFromProjectLocationDataStoreSchemaName(projectLocationDataStoreSchemaName: string): string | number;
Parse the data_store from ProjectLocationDataStoreSchema resource.
Parameter | |
---|---|
Name | Description |
projectLocationDataStoreSchemaName |
string
A fully-qualified path representing project_location_data_store_schema resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the data_store. |
matchDataStoreFromProjectLocationDataStoreServingConfigName(projectLocationDataStoreServingConfigName)
matchDataStoreFromProjectLocationDataStoreServingConfigName(projectLocationDataStoreServingConfigName: string): string | number;
Parse the data_store from ProjectLocationDataStoreServingConfig resource.
Parameter | |
---|---|
Name | Description |
projectLocationDataStoreServingConfigName |
string
A fully-qualified path representing project_location_data_store_serving_config resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the data_store. |
matchDocumentFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName)
matchDocumentFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName: string): string | number;
Parse the document from ProjectLocationCollectionDataStoreBranchDocument resource.
Parameter | |
---|---|
Name | Description |
projectLocationCollectionDataStoreBranchDocumentName |
string
A fully-qualified path representing project_location_collection_data_store_branch_document resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the document. |
matchDocumentFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName)
matchDocumentFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName: string): string | number;
Parse the document from ProjectLocationDataStoreBranchDocument resource.
Parameter | |
---|---|
Name | Description |
projectLocationDataStoreBranchDocumentName |
string
A fully-qualified path representing project_location_data_store_branch_document resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the document. |
matchLocationFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName)
matchLocationFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName: string): string | number;
Parse the location from ProjectLocationCollectionDataStoreBranchDocument resource.
Parameter | |
---|---|
Name | Description |
projectLocationCollectionDataStoreBranchDocumentName |
string
A fully-qualified path representing project_location_collection_data_store_branch_document resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the location. |
matchLocationFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName)
matchLocationFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName: string): string | number;
Parse the location from ProjectLocationCollectionDataStoreSchema resource.
Parameter | |
---|---|
Name | Description |
projectLocationCollectionDataStoreSchemaName |
string
A fully-qualified path representing project_location_collection_data_store_schema resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the location. |
matchLocationFromProjectLocationCollectionDataStoreServingConfigName(projectLocationCollectionDataStoreServingConfigName)
matchLocationFromProjectLocationCollectionDataStoreServingConfigName(projectLocationCollectionDataStoreServingConfigName: string): string | number;
Parse the location from ProjectLocationCollectionDataStoreServingConfig resource.
Parameter | |
---|---|
Name | Description |
projectLocationCollectionDataStoreServingConfigName |
string
A fully-qualified path representing project_location_collection_data_store_serving_config resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the location. |
matchLocationFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName)
matchLocationFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName: string): string | number;
Parse the location from ProjectLocationDataStoreBranchDocument resource.
Parameter | |
---|---|
Name | Description |
projectLocationDataStoreBranchDocumentName |
string
A fully-qualified path representing project_location_data_store_branch_document resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the location. |
matchLocationFromProjectLocationDataStoreSchemaName(projectLocationDataStoreSchemaName)
matchLocationFromProjectLocationDataStoreSchemaName(projectLocationDataStoreSchemaName: string): string | number;
Parse the location from ProjectLocationDataStoreSchema resource.
Parameter | |
---|---|
Name | Description |
projectLocationDataStoreSchemaName |
string
A fully-qualified path representing project_location_data_store_schema resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the location. |
matchLocationFromProjectLocationDataStoreServingConfigName(projectLocationDataStoreServingConfigName)
matchLocationFromProjectLocationDataStoreServingConfigName(projectLocationDataStoreServingConfigName: string): string | number;
Parse the location from ProjectLocationDataStoreServingConfig resource.
Parameter | |
---|---|
Name | Description |
projectLocationDataStoreServingConfigName |
string
A fully-qualified path representing project_location_data_store_serving_config resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the location. |
matchProjectFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName)
matchProjectFromProjectLocationCollectionDataStoreBranchDocumentName(projectLocationCollectionDataStoreBranchDocumentName: string): string | number;
Parse the project from ProjectLocationCollectionDataStoreBranchDocument resource.
Parameter | |
---|---|
Name | Description |
projectLocationCollectionDataStoreBranchDocumentName |
string
A fully-qualified path representing project_location_collection_data_store_branch_document resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the project. |
matchProjectFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName)
matchProjectFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName: string): string | number;
Parse the project from ProjectLocationCollectionDataStoreSchema resource.
Parameter | |
---|---|
Name | Description |
projectLocationCollectionDataStoreSchemaName |
string
A fully-qualified path representing project_location_collection_data_store_schema resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the project. |
matchProjectFromProjectLocationCollectionDataStoreServingConfigName(projectLocationCollectionDataStoreServingConfigName)
matchProjectFromProjectLocationCollectionDataStoreServingConfigName(projectLocationCollectionDataStoreServingConfigName: string): string | number;
Parse the project from ProjectLocationCollectionDataStoreServingConfig resource.
Parameter | |
---|---|
Name | Description |
projectLocationCollectionDataStoreServingConfigName |
string
A fully-qualified path representing project_location_collection_data_store_serving_config resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the project. |
matchProjectFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName)
matchProjectFromProjectLocationDataStoreBranchDocumentName(projectLocationDataStoreBranchDocumentName: string): string | number;
Parse the project from ProjectLocationDataStoreBranchDocument resource.
Parameter | |
---|---|
Name | Description |
projectLocationDataStoreBranchDocumentName |
string
A fully-qualified path representing project_location_data_store_branch_document resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the project. |
matchProjectFromProjectLocationDataStoreSchemaName(projectLocationDataStoreSchemaName)
matchProjectFromProjectLocationDataStoreSchemaName(projectLocationDataStoreSchemaName: string): string | number;
Parse the project from ProjectLocationDataStoreSchema resource.
Parameter | |
---|---|
Name | Description |
projectLocationDataStoreSchemaName |
string
A fully-qualified path representing project_location_data_store_schema resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the project. |
matchProjectFromProjectLocationDataStoreServingConfigName(projectLocationDataStoreServingConfigName)
matchProjectFromProjectLocationDataStoreServingConfigName(projectLocationDataStoreServingConfigName: string): string | number;
Parse the project from ProjectLocationDataStoreServingConfig resource.
Parameter | |
---|---|
Name | Description |
projectLocationDataStoreServingConfigName |
string
A fully-qualified path representing project_location_data_store_serving_config resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the project. |
matchSchemaFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName)
matchSchemaFromProjectLocationCollectionDataStoreSchemaName(projectLocationCollectionDataStoreSchemaName: string): string | number;
Parse the schema from ProjectLocationCollectionDataStoreSchema resource.
Parameter | |
---|---|
Name | Description |
projectLocationCollectionDataStoreSchemaName |
string
A fully-qualified path representing project_location_collection_data_store_schema resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the schema. |
matchSchemaFromProjectLocationDataStoreSchemaName(projectLocationDataStoreSchemaName)
matchSchemaFromProjectLocationDataStoreSchemaName(projectLocationDataStoreSchemaName: string): string | number;
Parse the schema from ProjectLocationDataStoreSchema resource.
Parameter | |
---|---|
Name | Description |
projectLocationDataStoreSchemaName |
string
A fully-qualified path representing project_location_data_store_schema resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the schema. |
matchServingConfigFromProjectLocationCollectionDataStoreServingConfigName(projectLocationCollectionDataStoreServingConfigName)
matchServingConfigFromProjectLocationCollectionDataStoreServingConfigName(projectLocationCollectionDataStoreServingConfigName: string): string | number;
Parse the serving_config from ProjectLocationCollectionDataStoreServingConfig resource.
Parameter | |
---|---|
Name | Description |
projectLocationCollectionDataStoreServingConfigName |
string
A fully-qualified path representing project_location_collection_data_store_serving_config resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the serving_config. |
matchServingConfigFromProjectLocationDataStoreServingConfigName(projectLocationDataStoreServingConfigName)
matchServingConfigFromProjectLocationDataStoreServingConfigName(projectLocationDataStoreServingConfigName: string): string | number;
Parse the serving_config from ProjectLocationDataStoreServingConfig resource.
Parameter | |
---|---|
Name | Description |
projectLocationDataStoreServingConfigName |
string
A fully-qualified path representing project_location_data_store_serving_config resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the serving_config. |
projectLocationCollectionDataStoreBranchDocumentPath(project, location, collection, dataStore, branch, document)
projectLocationCollectionDataStoreBranchDocumentPath(project: string, location: string, collection: string, dataStore: string, branch: string, document: string): string;
Return a fully-qualified projectLocationCollectionDataStoreBranchDocument resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
collection |
string
|
dataStore |
string
|
branch |
string
|
document |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
projectLocationCollectionDataStoreSchemaPath(project, location, collection, dataStore, schema)
projectLocationCollectionDataStoreSchemaPath(project: string, location: string, collection: string, dataStore: string, schema: string): string;
Return a fully-qualified projectLocationCollectionDataStoreSchema resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
collection |
string
|
dataStore |
string
|
schema |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
projectLocationCollectionDataStoreServingConfigPath(project, location, collection, dataStore, servingConfig)
projectLocationCollectionDataStoreServingConfigPath(project: string, location: string, collection: string, dataStore: string, servingConfig: string): string;
Return a fully-qualified projectLocationCollectionDataStoreServingConfig resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
collection |
string
|
dataStore |
string
|
servingConfig |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
projectLocationDataStoreBranchDocumentPath(project, location, dataStore, branch, document)
projectLocationDataStoreBranchDocumentPath(project: string, location: string, dataStore: string, branch: string, document: string): string;
Return a fully-qualified projectLocationDataStoreBranchDocument resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
dataStore |
string
|
branch |
string
|
document |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
projectLocationDataStoreSchemaPath(project, location, dataStore, schema)
projectLocationDataStoreSchemaPath(project: string, location: string, dataStore: string, schema: string): string;
Return a fully-qualified projectLocationDataStoreSchema resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
dataStore |
string
|
schema |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
projectLocationDataStoreServingConfigPath(project, location, dataStore, servingConfig)
projectLocationDataStoreServingConfigPath(project: string, location: string, dataStore: string, servingConfig: string): string;
Return a fully-qualified projectLocationDataStoreServingConfig resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
dataStore |
string
|
servingConfig |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
recommend(request, options)
recommend(request?: protos.google.cloud.discoveryengine.v1beta.IRecommendRequest, options?: CallOptions): Promise<[
protos.google.cloud.discoveryengine.v1beta.IRecommendResponse,
protos.google.cloud.discoveryengine.v1beta.IRecommendRequest | undefined,
{} | undefined
]>;
Makes a recommendation, which requires a contextual user event.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.discoveryengine.v1beta.IRecommendRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.discoveryengine.v1beta.IRecommendResponse,
protos.google.cloud.discoveryengine.v1beta.IRecommendRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Full resource name of the format:
* `projects/* /locations/global/collections/* /dataStores/* /servingConfigs/*`
* Before you can request recommendations from your model, you must create at
* least one serving config for it.
*/
// const servingConfig = 'abc123'
/**
* Required. Context about the user, what they are looking at and what action
* they took to trigger the Recommend request. Note that this user event
* detail won't be ingested to userEvent logs. Thus, a separate userEvent
* write request is required for event logging.
* Don't set
* UserEvent.user_pseudo_id google.cloud.discoveryengine.v1beta.UserEvent.user_pseudo_id
* or
* UserEvent.user_info.user_id google.cloud.discoveryengine.v1beta.UserInfo.user_id
* to the same fixed ID for different users. If you are trying to receive
* non-personalized recommendations (not recommended; this can negatively
* impact model performance), instead set
* UserEvent.user_pseudo_id google.cloud.discoveryengine.v1beta.UserEvent.user_pseudo_id
* to a random unique ID and leave
* UserEvent.user_info.user_id google.cloud.discoveryengine.v1beta.UserInfo.user_id
* unset.
*/
// const userEvent = {}
/**
* Maximum number of results to return. Set this property
* to the number of recommendation results needed. If zero, the service will
* choose a reasonable default. The maximum allowed value is 100. Values
* above 100 will be coerced to 100.
*/
// const pageSize = 1234
/**
* Filter for restricting recommendation results with a length limit of 5,000
* characters. Currently, only filter expressions on the `filter_tags`
* attribute is supported.
* Examples:
* * `(filter_tags: ANY("Red", "Blue") OR filter_tags: ANY("Hot", "Cold"))`
* * `(filter_tags: ANY("Red", "Blue")) AND NOT (filter_tags: ANY("Green"))`
* If your filter blocks all results, the API will return generic
* (unfiltered) popular Documents. If you only want results strictly matching
* the filters, set `strictFiltering` to True in
* RecommendRequest.params google.cloud.discoveryengine.v1beta.RecommendRequest.params
* to receive empty results instead.
* Note that the API will never return
* Document google.cloud.discoveryengine.v1beta.Document s with
* `storageStatus` of `EXPIRED` or `DELETED` regardless of filter choices.
*/
// const filter = 'abc123'
/**
* Use validate only mode for this recommendation query. If set to true, a
* fake model will be used that returns arbitrary Document IDs.
* Note that the validate only mode should only be used for testing the API,
* or if the model is not ready.
*/
// const validateOnly = true
/**
* Additional domain specific parameters for the recommendations.
* Allowed values:
* * `returnDocument`: Boolean. If set to true, the associated Document
* object will be returned in
* RecommendResponse.RecommendationResult.document google.cloud.discoveryengine.v1beta.RecommendResponse.RecommendationResult.document.
* * `returnScore`: Boolean. If set to true, the recommendation 'score'
* corresponding to each returned Document will be set in
* RecommendResponse.RecommendationResult.metadata google.cloud.discoveryengine.v1beta.RecommendResponse.RecommendationResult.metadata.
* The given 'score' indicates the probability of a Document conversion
* given the user's context and history.
* * `strictFiltering`: Boolean. True by default. If set to false, the service
* will return generic (unfiltered) popular Documents instead of empty if
* your filter blocks all recommendation results.
* * `diversityLevel`: String. Default empty. If set to be non-empty, then
* it needs to be one of:
* * `no-diversity`
* * `low-diversity`
* * `medium-diversity`
* * `high-diversity`
* * `auto-diversity`
* This gives request-level control and adjusts recommendation results
* based on Document category.
*/
// const params = 1234
/**
* The user labels applied to a resource must meet the following requirements:
* * Each resource can have multiple labels, up to a maximum of 64.
* * Each label must be a key-value pair.
* * Keys have a minimum length of 1 character and a maximum length of 63
* characters and cannot be empty. Values can be empty and have a maximum
* length of 63 characters.
* * Keys and values can contain only lowercase letters, numeric characters,
* underscores, and dashes. All characters must use UTF-8 encoding, and
* international characters are allowed.
* * The key portion of a label must be unique. However, you can use the same
* key with multiple resources.
* * Keys must start with a lowercase letter or international character.
* See Requirements for
* labels (https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
* for more details.
*/
// const userLabels = 1234
// Imports the Discoveryengine library
const {RecommendationServiceClient} = require('@google-cloud/discoveryengine').v1beta;
// Instantiates a client
const discoveryengineClient = new RecommendationServiceClient();
async function callRecommend() {
// Construct request
const request = {
servingConfig,
userEvent,
};
// Run request
const response = await discoveryengineClient.recommend(request);
console.log(response);
}
callRecommend();
recommend(request, options, callback)
recommend(request: protos.google.cloud.discoveryengine.v1beta.IRecommendRequest, options: CallOptions, callback: Callback<protos.google.cloud.discoveryengine.v1beta.IRecommendResponse, protos.google.cloud.discoveryengine.v1beta.IRecommendRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.discoveryengine.v1beta.IRecommendRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.discoveryengine.v1beta.IRecommendResponse, protos.google.cloud.discoveryengine.v1beta.IRecommendRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
recommend(request, callback)
recommend(request: protos.google.cloud.discoveryengine.v1beta.IRecommendRequest, callback: Callback<protos.google.cloud.discoveryengine.v1beta.IRecommendResponse, protos.google.cloud.discoveryengine.v1beta.IRecommendRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.discoveryengine.v1beta.IRecommendRequest
|
callback |
Callback<protos.google.cloud.discoveryengine.v1beta.IRecommendResponse, protos.google.cloud.discoveryengine.v1beta.IRecommendRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |