Method: projects.generateProductTextAttributes

Generates missing attributes from product information.

HTTP request

POST https://productstudio.googleapis.com/v1/{parent=projects/*}:generateProductTextAttributes

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
parent

string

Required. Project to make a call. Must refer to a caller's project. Format: projects/{project-id}.

Request body

The request body contains data with the following structure:

JSON representation
{
  "inputAttributes": [
    {
      object (Attribute)
    }
  ],
  "generativeAttributes": [
    {
      object (Attribute)
    }
  ],
  "offerImage": {
    object (Image)
  },
  "clientRequestContext": {
    object (ClientRequestContext)
  },
  "allowAnyConfidenceSuggestions": boolean
}
Fields
inputAttributes[]

object (Attribute)

Optional. The input attributes used to generate the suggestions. The supported values are: title, description. These attributes will not be included in the response and will not change.

generativeAttributes[]

object (Attribute)

Required. Attributes to be generated. The supported values are gender, age_group, color and size and at least one of those values should be set. Only the values set here will be included in the response.

offerImage

object (Image)

Required. Image associated with the product.

clientRequestContext

object (ClientRequestContext)

Required. Info about the client making the request.

allowAnyConfidenceSuggestions

boolean

Optional. If true, attribute suggestions with all confidence levels will be included in the response. By default, only high confidence suggestions are included for all attributes.

Response body

Response for projects.generateProductTextAttributes.

If successful, the response body contains data with the following structure:

JSON representation
{
  "suggestions": [
    {
      object (Attribute)
    }
  ]
}
Fields
suggestions[]

object (Attribute)

The generated product attribute suggestions. This can be empty if the model is not able to suggest attributes with enough confidence scores. The suggestions can be any of gender, age_group, color and size based on the attributes_to_generate in the requuest.

Attribute

A product attribute which is used in the request and response.

JSON representation
{
  "key": string,
  "textValue": string,
  "confidenceLevel": enum (ConfidenceLevel)
}
Fields
key

string

Required. Attribute name as provided by the merchant.

textValue

string

Optional. Stores the text value of attribute. This must be set for inputAttributes in GenerateProductTextAttributesRequest and for suggestions in GenerateProductTextAttributesResponse. Only text attributes are used/generated at this point and so, attribute_type(eg: INT, RICH_TEXT) and other format_values(eg: float_value, rich_text_value) are not defined.

confidenceLevel

enum (ConfidenceLevel)

Optional. This is present only in the response and will determine the confidence level of the generated attribute suggestion.

ConfidenceLevel

The confidence level of the attribute suggestion generated by the AI model. The model outputs a confidence score for each suggestion and it is bucketed into one of the confidence levels. The confidence thresholds for each buckets were determined based on human evaluations of the model outputs.

Enums
CONFIDENCE_LEVEL_UNSPECIFIED Unspecified confidence level.
LOW Low confidence level.
MEDIUM Medium confidence level.
HIGH High confidence level.

ClientRequestContext

Information about the client making the request.

JSON representation
{
  "partnerProductId": string
}
Fields
partnerProductId

string

Required. The product id defined by the partner.