Method: projects.generateProductTextAttributes

根據產品資訊生成缺少的屬性。

HTTP 要求

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

這個網址使用 gRPC 轉碼語法。

路徑參數

參數
parent

string

必要欄位。撥打電話的專案。必須參照呼叫端的專案。格式:projects/{project-id}

要求主體

要求主體的資料會採用以下結構:

JSON 表示法
{
  "inputAttributes": [
    {
      object (Attribute)
    }
  ],
  "generativeAttributes": [
    {
      object (Attribute)
    }
  ],
  "offerImage": {
    object (Image)
  },
  "clientRequestContext": {
    object (ClientRequestContext)
  },
  "allowAnyConfidenceSuggestions": boolean
}
欄位
inputAttributes[]

object (Attribute)

(選用步驟) 用於產生建議的輸入屬性。支援的值為:title、description。這些屬性不會納入回應,也不會變更。

generativeAttributes[]

object (Attribute)

必要欄位。要生成的屬性。支援的值包括性別、年齡層、顏色和尺寸,且至少應設定其中一個值。回應中只會包含在此處設定的值。

offerImage

object (Image)

必要欄位。與產品相關的圖片。

clientRequestContext

object (ClientRequestContext)

必要欄位。提出要求的用戶端相關資訊。

allowAnyConfidenceSuggestions

boolean

(選用步驟) 若為 true,回應中會包含所有信賴度的屬性建議。根據預設,系統只會為所有屬性提供可信度高的建議。

回應主體

projects.generateProductTextAttributes 的回應。

如果成功,回應主體會含有以下結構的資料:

JSON 表示法
{
  "suggestions": [
    {
      object (Attribute)
    }
  ]
}
欄位
suggestions[]

object (Attribute)

系統生成的產品屬性建議。如果模型無法建議具有足夠信賴分數的屬性,這個欄位可能會空白。建議可以是性別、年齡層、顏色和尺寸,具體取決於要求中的 attributes_to_generate。

屬性

要求和回應中使用的產品屬性。

JSON 表示法
{
  "key": string,
  "textValue": string,
  "confidenceLevel": enum (ConfidenceLevel)
}
欄位
key

string

必要欄位。商家提供的屬性名稱。

textValue

string

(選用步驟) 儲存屬性的文字值。這項屬性必須在 GenerateProductTextAttributesRequest 中設為 inputAttributes,並在 GenerateProductTextAttributesResponse 中設為建議。此時只會使用/產生文字屬性,因此不會定義 attribute_type(例如:INT、RICH_TEXT) 和其他 format_values(例如:float_value、rich_text_value)。

confidenceLevel

enum (ConfidenceLevel)

(選用步驟) 這項資料只會出現在回應中,並決定所產生屬性建議的信賴度。

ConfidenceLevel

AI 模型生成屬性建議的信賴水準。模型會為每項建議輸出可信度分數,並歸入其中一個可信度等級。各類別的可信度門檻是根據人工評估模型輸出內容的結果而定。

列舉
CONFIDENCE_LEVEL_UNSPECIFIED 未指定信賴水準。
LOW 信賴水準偏低。
MEDIUM 中等信賴水準。
HIGH 高信賴水準。

ClientRequestContext

提出要求的用戶端相關資訊。

JSON 表示法
{
  "partnerProductId": string
}
欄位
partnerProductId

string

必要欄位。合作夥伴定義的產品 ID。