टेक्स्ट के सुझाव जनरेट करना

टेक्स्ट के सुझाव देने वाले API, प्रॉडक्ट के टाइटल और ब्यौरे जनरेट करने और उन्हें ऑप्टिमाइज़ करने के लिए, Product Studio API के जनरेटिव एआई टूल का इस्तेमाल करते हैं. इसका इस्तेमाल करके, खरीदार की दिलचस्पी और कन्वर्ज़न को बेहतर बनाया जा सकता है. साथ ही, प्रॉडक्ट की जानकारी को मैनेज और अपडेट करने की प्रोसेस को आसान बनाया जा सकता है. Product Studio API की सुविधाओं की मदद से, खुदरा दुकान की परफ़ॉर्मेंस को ऑप्टिमाइज़ किया जा सकता है.

एपीआई का इस्तेमाल करके क्या-क्या जनरेट किया जा सकता है?

टेक्स्ट के सुझाव देने वाले एपीआई की मदद से ये काम किए जा सकते हैं:

  • प्रॉडक्ट की इमेज और/या प्रॉडक्ट एट्रिब्यूट के आधार पर, प्रॉडक्ट के टाइटल और ब्यौरे के सुझाव.
  • आपके प्रॉडक्ट के लिए एसईओ के हिसाब से ऑप्टिमाइज़ किए गए टाइटल
  • आपके प्रॉडक्ट के लिए पसंद के मुताबिक फ़ॉर्मैट किए गए टाइटल
  • आपके प्रॉडक्ट फ़ीड में मौजूद प्रॉडक्ट के ब्यौरे

ब्यौरे के लिए आवाज़ की टोन भी तय की जा सकती है. साथ ही, अपनी सभी प्रॉडक्ट लिस्टिंग में एक जैसी आवाज़ का इस्तेमाल किया जा सकता है.

क्विकस्टार्ट

GenerateProductTextSuggestions वाले तरीके से, प्रॉडक्ट की जानकारी का इस्तेमाल करके, प्रॉडक्ट के टाइटल और ब्यौरे जनरेट किए जा सकते हैं या उन्हें ऑप्टिमाइज़ किया जा सकता है.

एपीआई ये स्वीकार करता है:

  • प्रॉडक्ट एट्रिब्यूट (JSON डिक्शनरी): प्रॉडक्ट एट्रिब्यूट (जैसे, {"title": "White Tee", "brand": "MyBrand", "size": "XL"}) वाला JSON ऑब्जेक्ट
  • प्रॉडक्ट की इमेज: प्रॉडक्ट की इमेज पर ले जाने वाला यूआरआई (जैसे, {"uri": "https://my-store.com/img/1.png"})
  • टाइटल फ़ॉर्मैट करने के विकल्प: टाइटल जनरेट करने के तरीके को पसंद के मुताबिक बनाने के लिए पैरामीटर. इनमें ये शामिल हैं:
    • attribute_separator: एट्रिब्यूट के बीच सेपरेटर तय करता है.
    • target_language: आउटपुट भाषा सेट करता है.
    • attribute_order: जनरेट किए गए टाइटल में एट्रिब्यूट के क्रम को तय करता है.
  • डेटा लेबल करने के उदाहरण: ब्यौरे से टाइटल जनरेट करने का उदाहरण देखें.
  • वर्कफ़्लो आईडी (output_spec.workflow_id): output_spec ऑब्जेक्ट में मौजूद workflow_id फ़ील्ड से, टेक्स्ट जनरेशन का टाइप तय होता है:
    • title: प्रॉडक्ट का टाइटल जनरेट या ऑप्टिमाइज़ करता है.
    • description: प्रॉडक्ट की जानकारी जनरेट या ऑप्टिमाइज़ करता है.
    • tide: प्रॉडक्ट का टाइटल और ब्यौरा, दोनों जनरेट या ऑप्टिमाइज़ करता है.

उदाहरण

यहां अलग-अलग प्रॉडक्ट डेटा इनपुट से टाइटल या ब्यौरा या दोनों को जनरेट या ऑप्टिमाइज़ करने के लिए, एपीआई का इस्तेमाल करने के उदाहरण दिए गए हैं. हम आम तौर पर होने वाली गलतियां और समस्याएं और उनके समाधान भी बताते हैं.

ऑप्टिमाइज़ किया गया टाइटल जनरेशन

इस उदाहरण में, सबसे सही टाइटल जनरेट करने का तरीका बताया गया है.

अनुरोध

अनुरोध के मुख्य हिस्से में, प्रॉडक्ट की वह जानकारी होती है जिसका इस्तेमाल टाइटल ऑप्टिमाइज़ेशन के लिए किया जाता है. अनुरोध के स्ट्रक्चर का उदाहरण यहां दिया गया है:

POST https://merchantapi.googleapis.com/productstudio/v1alpha/accounts/{ACCOUNT_ID}:generateProductTextSuggestions

{
   "product_info": {
      "product_attributes": {
         "title": "Nike Mens shoes",
         "description": "Give strength to your step with the Nike Air Zoom Pegasus 38 shoe for Men with shoe size 12. Ensuring the fit is loved by the runners. This shoes comes in Blue color.",
         "brand": "Nike"
      }
   },
   "output_spec": {
      "workflow_id": "title"
   }
}

जवाब

आपको इस तरह का जवाब मिल सकता है

{
  "title": {
    "text": "Nike Mens shoes Air Zoom Pegasus 38 Running Shoes, Blue, Size 12"
  },
  "metadata": {
    "metadata": {
      "attributes": {
        "color": "Blue",
        "size": "12",
        "product": "Running shoes",
        "model": "Air Zoom Pegasus 38"
      },
    }
  }
}

सिर्फ़ इमेज से टाइटल जनरेट करना

इस उदाहरण में, प्रॉडक्ट की इमेज देने और सही टाइटल जनरेट करने का तरीका बताया गया है.

अनुरोध

POST https://merchantapi.googleapis.com/productstudio/v1alpha/accounts/{ACCOUNT_ID}:generateProductTextSuggestions

{
   "product_info": {
      "product_image":{
         "uri": "https://cdn.shopify.com/s/files/1/0653/5879/0892/products/1672082339438_550x825.jpg?v=1672082415"
      }
   },
   "output_spec": {
      "workflow_id": "title",
      "attribute_separator": "-"
   }
}

जवाब

{
  "title": {
    "text": "Rustic Ceramic & Leather Leaves Necklace"
  },
  "metadata": {
    "metadata": {
      "attributes": {
        "material": "Rustic Ceramic & Leather",
        "pattern": "Leaves",
        "product": "Necklace"
      },
    }
  }
}

ब्यौरे से टाइटल जनरेट करना

इस उदाहरण में, प्रॉडक्ट का ब्यौरा देने और सबसे सही टाइटल जनरेट करने का तरीका बताया गया है.

अनुरोध

POST https://merchantapi.googleapis.com/productstudio/v1alpha/accounts/{ACCOUNT_ID}:generateProductTextSuggestions

{
   "product_info": {
      "product_attributes": {
         "description": "selling size 12 nike dunks. oh they are red by the way!"
      }
   },
   "output_spec": {
      "workflow_id": "title",
   }
}

जवाब

{
  "title": {
    "text": "Nike Dunks Red Size 12"
  },
  "metadata": {
    "metadata": {
      "attributes": {
        "brand": "Nike",
        "color": "Red",
        "size": "12",
        "product": "Dunks"
      },
    }
  }
}

टाइटल और ब्यौरे से टाइटल ऑप्टिमाइज़ करना (पसंद के मुताबिक उदाहरण के साथ)

इस उदाहरण में, हम उन प्रॉडक्ट एट्रिब्यूट को साफ़ तौर पर लेबल करते हैं जिनकी पहचान एआई से कराने के लिए हम चाहते हैं. साथ ही, आउटपुट में एट्रिब्यूट के क्रम को भी लेबल करते हैं.

अनुरोध

POST https://merchantapi.googleapis.com/productstudio/v1alpha/accounts/{ACCOUNT_ID}:generateProductTextSuggestions

{
   "product_info": {
      "product_attributes": {
         "title": "Volumizing & Lengthening Mascara - Dark Brown",
         "description": "This high-impact mascara delivers both voluptuous volume and dramatic length without clumping or smudging.",
         "brand": "Luxe Beauty"
      }
   },
   "output_spec": {
      "workflow_id": "title"
   }
   "title_examples": [
    {
      "product_info": {
        "title": "Lash Paradise Volumizing & Lengthening Mascara - Waterproof - Blackest Black",
        "colour": "Black"
      },
      "title_format": "product",
      "category": "mascara",
      "final_product_info": {
        "product": "Mascara",
        "brand": "Lash Paradise",
        "mascara_type": "Volumizing & Lengthening",
        "colour": "Blackest Black",
        "waterproof": "Waterproof",
      }
    },
    {
      "product_info": {
        "title": "Hypnose Drama Instant Full Body Volume Mascara - Black",
        "colour": "Black"
      },
      "title_format": "product",
      "category": "mascara",
      "final_product_info": {
        "product": "Mascara",
        "brand": "Hypnose",
        "sub_brand": "Drama",
        "mascara_type": "Full Body Volume",
        "colour": "Black",
        "eye_lash_type": "All lash types"
      }
    }
  ]
}

जवाब

{
  "title": {
    "text": "Luxe Beauty Dark Brown Volumizing & Lengthening Mascara"
  },
  "metadata": {
    "metadata": {
      "attributes": {
        "brand": "Luxe Beauty",
        "colour": "Dark Brown",
        "mascara_type": "Volumizing & Lengthening",
        "product": "Mascara"
      },
    }
  }
}

टाइटल से ब्यौरा जनरेट करना

इस उदाहरण में, प्रॉडक्ट का टाइटल देने और एपीआई से प्रॉडक्ट का ब्यौरा जनरेट करने के लिए कहने का तरीका बताया गया है.

अनुरोध

POST https://merchantapi.googleapis.com/productstudio/v1alpha/accounts/{ACCOUNT_ID}:generateProductTextSuggestions

{
   "product_info": {
      "product_attributes": {
         "title": "Rustic Ceramic & Leather Leaves Necklace",
      }
   },
   "output_spec": {
      "workflow_id": "description"
   }
}

जवाब

{
  "description": {
    "text": "Rustic Ceramic & Leather Leaves Necklace is a beautiful necklace made from high-quality ceramic and leather. It features a unique design that is sure to turn heads.
"
  },
}

प्रॉडक्ट के एट्रिब्यूट (जैसे, ब्रैंड और रंग) से टाइटल और ब्यौरा जनरेट करना

इस उदाहरण में, प्रॉडक्ट का सबसे सही टाइटल और ब्यौरा जनरेट करने के लिए, प्रॉडक्ट एट्रिब्यूट की जानकारी देने का तरीका बताया गया है.

अनुरोध

POST https://merchantapi.googleapis.com/productstudio/v1alpha/accounts/{ACCOUNT_ID}:generateProductTextSuggestions

{
   "product_info": {
      "product_attributes": {
         "brand": "Mr. Beast",
         "color": "purple",
      },
      "product_image":{
         "uri": "https://mrbeast.store/cdn/shop/files/0015dlv_0000_327.jpg?v=1702754475&width=500"
       }
   },
   "output_spec": {
      "workflow_id": "description"
   }
}

जवाब

{
  "title": {
    "text": "Pajamas - Mr. Beast | Purple"
  },
  "description": {
    "text": "Slip into the ultimate comfort and style with these Mr. Beast pajamas in a vibrant shade of purple. Crafted from the softest materials, these pajamas will envelop you in a cozy embrace, ensuring a restful night's sleep. The shorts feature a relaxed fit, allowing for easy movement, while the top boasts a classic design with a comfortable neckline. Whether you're lounging at home or drifting off to dreamland, these Mr. Beast pajamas are the perfect choice for a peaceful and stylish slumber."
  },
}

टारगेट की गई भाषा के लिए सहायता

इस फ़ील्ड से, एपीआई रिस्पॉन्स में जनरेट किए गए ब्यौरे के टेक्स्ट की भाषा के बारे में पता चलता है. target_language को output_spec पैरामीटर के हिस्से के तौर पर जोड़ा जा सकता है:

{
    "output_spec": {
        "target_language": "language"
    }
}

वैल्यू के उदाहरण:

"korean" (Korean)
"english" (English)
"spanish" (Spanish)
"french" (French)

अनुरोध का उदाहरण

POST https://merchantapi.googleapis.com/productstudio/v1alpha/accounts/{ACCOUNT_ID}:generateProductTextSuggestions

{
   "product_info": {
      "product_attributes": {
         "title": "Granos de café negro",
         "description": "Los granos de café negro en California",
         "brand": "Parfums de Paris",
         "scent": "Floral",
      },
      "product_image":{
         "uri": "https://mrbeast.store/cdn/shop/files/0015dlv_0000_327.jpg?v=1702754475&width=500"
       }
   },
   "output_spec": {
      "workflow_id": "description",
      "target_language": "japanese",
      "attribute_order": ["scent", "product"],
      "tone": "playful",
   }
}

जवाब

{
  "description": {
    "text": "カリフォルニアの黒いコーヒー豆は、あなたの鼻をくすぐる、甘く、フローラルな香りです。この香りは、コーヒー豆の豊かな香りと、ジャスミンとバラの繊細な花の香りをブレンドしたものです。カリフォルニアの黒いコーヒー豆は、あなたの家を居心地の良いカフェに変え、あなたをリラックスした気分にさせてくれるでしょう。この香りは、コーヒー好きにも、フローラルな香り好きにも最適です。カリフォルニアの黒いコーヒー豆で、あなたの家を幸せな香りで満たしましょう!."
  },
}

ब्यौरा जनरेट करने के लिए, अपनी पसंद के हिसाब से आवाज़ का लहजा तय करना

अपने ब्रैंड को स्थापित करने और अपने ऑनलाइन स्टोर को दूसरों से अलग करने के लिए, जनरेट किए गए ब्यौरे की टोन को अपने हिसाब से बनाया जा सकता है. Text API के दो विकल्प हैं:

  • पहले से तय टोन चुनना: नई जानकारी जनरेट करने के लिए, टोन की सूची में से कोई टोन चुनें. इस सूची में ये टोन स्टाइल शामिल हैं:
    • डिफ़ॉल्ट: यह आसान, साफ़, और बेहतरीन है.
    • मज़ेदार: हंसी-मज़ाक़ वाला, सकारात्मक भाषा का इस्तेमाल करने वाला, हंसी-मज़ाक़ (चुटकुले, चुटकुले के तौर पर इस्तेमाल किए गए शब्द), और बढ़ा-चढ़ाकर बताने वाला (विडंबना, व्यंग्य या इमोजी का इस्तेमाल नहीं किया गया हो).
    • फ़ॉर्मल: स्टैंडर्ड इंग्लिश, सही व्याकरण, पूरे वाक्य, कोई स्लैंग या छोटा किया गया शब्द नहीं.
    • लोगों को अपनी बात समझाने के लिए: पाठक को अपनी बात समझाने के लिए, लॉजिकल, कम शब्दों में, और तर्क के साथ लिखें.
    • बातचीत वाली भाषा: आसानी से समझी जा सकने वाली, रोज़मर्रा की भाषा.
  • ब्रैंड के हिसाब से टोन: अपने ब्रैंड की आवाज़ की टोन में, मौजूदा जानकारी या अन्य टेक्स्ट ऐसेट दी जा सकती हैं. जनरेटिव एआई मॉडल, टेक्स्ट के टोन का विश्लेषण करेगा और इन बातों के आधार पर "लिखने के तरीके का ब्यौरा" जनरेट करेगा:
    • औपचारिकता (जैसे, फ़ॉर्मल, कैज़ुअल)
    • ज़रूरत से ज़्यादा शब्दों का इस्तेमाल करना (जैसे, कम शब्दों में, बहुत ज़्यादा शब्दों में)
    • टोन (जैसे, पेशेवर, जानकारी देने वाला, पॉज़िटिव, लुभावना)
    • वाक्य का स्ट्रक्चर (जैसे, "कुछ कॉन्जंक्शन वाला आसान वाक्य")
    • सबसे ज़्यादा इस्तेमाल किए गए शब्द और वाक्यांश

क्लाइंट लाइब्रेरी

हमारा सुझाव है कि अनुरोध सबमिट करने के लिए, क्लाइंट लाइब्रेरी का इस्तेमाल करें. हम आपके साथ ऐसी क्लाइंट लाइब्रेरी शेयर करेंगे जिन्हें अपने मेवन प्रोजेक्ट में इंस्टॉल किया जा सकता है.

कोड सैंपल

पुष्टि करने का तरीका चुनें और इन निर्देशों का इस्तेमाल करके, कोड के इन सैंपल को सेट अप करें. यहां एक सैंपल दिया गया है, जिसका इस्तेमाल करके टेक्स्ट के सुझाव जनरेट किए जा सकते हैं.

Java

import com.google.api.gax.core.FixedCredentialsProvider;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.shopping.merchant.productstudio.v1alpha.GenerateProductTextSuggestionsRequest;
import com.google.shopping.merchant.productstudio.v1alpha.GenerateProductTextSuggestionsResponse;
import com.google.shopping.merchant.productstudio.v1alpha.OutputSpec;
import com.google.shopping.merchant.productstudio.v1alpha.ProductInfo;
import com.google.shopping.merchant.productstudio.v1alpha.TextSuggestionsServiceClient;
import com.google.shopping.merchant.productstudio.v1alpha.TextSuggestionsServiceSettings;
import shopping.merchant.samples.utils.Authenticator;
import shopping.merchant.samples.utils.Config;

/** This class demonstrates how to generate product text suggestions. */
public class GenerateProductTextSuggestionsSample {

  private static String getName(String accountId) {
    return String.format("accounts/%s", accountId);
  }

  public static void generateProductTextSuggestions(Config config) throws Exception {
    // Obtains OAuth token based on the user's configuration.
    GoogleCredentials credential = new Authenticator().authenticate();

    TextSuggestionsServiceSettings textSuggestionsServiceSettings =
        TextSuggestionsServiceSettings.newBuilder()
            .setCredentialsProvider(FixedCredentialsProvider.create(credential))
            .build();

    String name = getName(config.getAccountId().toString());

    // Calls the API and catches and prints any network failures/errors.
    try (TextSuggestionsServiceClient textSuggestionsServiceClient =
        TextSuggestionsServiceClient.create(textSuggestionsServiceSettings)) {

      ProductInfo productInfo =
          ProductInfo.newBuilder()
              .putProductAttributes("title", "Mens shirt")
              .putProductAttributes("description", "A blue shirt for men in size S")
              .build();

      OutputSpec outputSpec = OutputSpec.newBuilder().setWorkflowId("title").build();

      GenerateProductTextSuggestionsRequest request =
          GenerateProductTextSuggestionsRequest.newBuilder()
              .setName(name)
              .setProductInfo(productInfo)
              .setOutputSpec(outputSpec)
              .build();

      System.out.println("Sending GenerateProductTextSuggestions request: " + name);
      GenerateProductTextSuggestionsResponse response =
          textSuggestionsServiceClient.generateProductTextSuggestions(request);
      System.out.println("Generated product text suggestions response below:");
      System.out.println(response);
    } catch (Exception e) {
      System.out.println("An error has occured: ");
      System.out.println(e);
    }
  }

  public static void main(String[] args) throws Exception {
    Config config = Config.load();
    generateProductTextSuggestions(config);
  }
}

सामान्य गड़बड़ियां और समस्याएं

यहां कुछ सामान्य समस्याएं और उनके समाधान बताए गए हैं.

टेक्स्ट के सुझाव जनरेट करने के लिए, प्रॉडक्ट की जानकारी देना ज़रूरी है

अगर आपको गड़बड़ी का यह मैसेज मिलता है, तो

Error message:
"error": {
    "code": 400,
    "message": "[product_info] Product info is required to generate text suggestions.",
    "status": "INVALID_ARGUMENT",
 ...
}

अनुरोध के मुख्य हिस्से में product_info जोड़ें और product_attributes या product_image में से कम से कम एक को सही तरीके से भरें.

उदाहरण के लिए, ऐसा करने पर गड़बड़ी दिखेगी.

POST https://merchantapi.googleapis.com/productstudio/v1alpha/accounts/{ACCOUNT_ID}:generateProductTextSuggestions

{
   "output_spec": {
      "workflow_id": "title"
   }
}

टेक्स्ट के सुझाव जनरेट करने के लिए, product_info का कम से कम एक फ़ील्ड होना ज़रूरी है

यह गड़बड़ी

{
  "error": {
    "code": 400,
    "message": "[product_info.product_attributes] At least one field of product_info is required to generate text suggestions.",
    "status": "INVALID_ARGUMENT",
 ...
}

का मतलब है कि आपको अनुरोध के मुख्य हिस्से में कम से कम एक product_info फ़ील्ड शामिल करना होगा.

उदाहरण के लिए, ऐसा करने पर गड़बड़ी दिखेगी.

POST https://merchantapi.googleapis.com/productstudio/v1alpha/accounts/{ACCOUNT_ID}:generateProductTextSuggestions

{
   "product_info": {
   },
   "output_spec": {
      "workflow_id": "title"
   }
}

इसके बजाय, कुछ ऐसा इस्तेमाल करें

   "product_info": {
        "product_attributes": {
         "description": "Selling size 12 Nike dunks. Oh they are red by the way!"
      }
   }

या

"product_info": {
    "product_image":{
        "uri": "https://cdn.shopify.com/s/files/1/0653/5879/0892/products/1672082339438_550x825.jpg?v=1672082415"
    }
}

हर title_example में (Something) होना ज़रूरी है

नीचे दिए गए चार उदाहरणों जैसी गड़बड़ियां

{
  "error": {
    "code": 400,
    "message": "[title_examples.product_info] At least one field of product_info is required in each title_example.",
    "status": "INVALID_ARGUMENT",
 ...
}

या

{
  ...
    "message": "[title_examples.category] Category is required in each title_example.",
  ...
}

या

{
  ...
    "message": "[title_examples.title_format] Title format is required in each title_example.",
  ...
}

या

{
  ...
    "message": "[title_examples.final_product_info] At least one field of final_product_info is required in each title_example.",
  ...
}

का मतलब है कि आपने ज़रूरी सब-फ़ील्ड को पॉप्युलेट नहीं किया है.

उदाहरण के लिए, नीचे दिए गए अनुरोध से गड़बड़ी होगी.

POST
https://merchantapi.googleapis.com/productstudio/v1alpha/accounts/{ACCOUNT_ID}:generateProductTextSuggestions

{
    "product_info": {
        "product_attributes": {
            "description": "selling size 12 nike dunks. oh they are red by the way!"
        }
    },
    "output_spec": {
        "workflow_id": "title"
    },
    "title_examples": []
}

इस समस्या को हल करने के लिए, अनुरोध में बताए गए हर title_example के लिए, इन सभी सब-फ़ील्ड को पॉप्युलेट करें:

  • product_info
  • category
  • title_format
  • final_product_info

यहां एक काम करने वाला उदाहरण दिया गया है:

{
   "product_info": {
      "product_attributes": {
         "title": "Volumizing & Lengthening Mascara - Dark Brown",
         "description": "This high-impact mascara delivers both voluptuous volume and dramatic length without clumping or smudging.",
      }
   },
   "output_spec": {
      "workflow_id": "title"
   },
   "title_examples": [
    {
      "product_info": {
        "title": "Lash Paradise Volumizing & Lengthening Mascara - Waterproof - Blackest Black",
        "colour": "Black"
      },
      "title_format": "product",
      "category": "mascara",
      "final_product_info": {
        "product": "Mascara",
        "brand": "Lash Paradise",
        "mascara_type": "Volumizing & Lengthening",
        "colour": "Blackest Black",
        "waterproof": "Waterproof",
      }
    }
  ]
}

workflow_id की वैल्यू गलत है

इस तरह की गड़बड़ी

{
  "error": {
    "code": 400,
    "message": "[\u003ceye3 title='/ProductStudioTextGenerationService.GenerateProductText, INVALID_ARGUMENT'/\u003e APPLICATION_ERROR; ... ;Unsupported workflow_id: attributes. Supported workflows are: [\"title\", \"description\", \"tide\"];AppErrorCode=3;StartTimeMs=1740696804045;unknown;ResFormat=uncompressed;ServerTimeSec=0.005976589;LogBytes=256;Non-FailFast;EffSecLevel=none;ReqFormat=uncompressed;ReqID=4d1786f59faa3ea7;GlobalID=0;Server=[2002:a05:6e16:618:b0:2c2:7cfc:bebd]:14001] Invalid value",
    "status": "INVALID_ARGUMENT",
 ...
}

इस तरह के अनुरोध से यह नतीजा मिलता है

POST https://merchantapi.googleapis.com/productstudio/v1alpha/accounts/{ACCOUNT_ID}:generateProductTextSuggestions

{
   "product_info": {
      "product_attributes": {
         "title": "Volumizing & Lengthening Mascara - Dark Brown",
         "description": "This high-impact mascara delivers both voluptuous volume and dramatic length without clumping or smudging.",
   },
   "output_spec": {
      "workflow_id": "attributes"
   }
}

अनुरोध में workflow_id को "एट्रिब्यूट" पर सेट किया गया है. हालांकि, इस फ़ील्ड में इनमें से सिर्फ़ एक वैल्यू का इस्तेमाल किया जा सकता है:

  • टाइटल: प्रॉडक्ट का टाइटल जनरेट या ऑप्टिमाइज़ करता है.
  • description: प्रॉडक्ट की जानकारी जनरेट या ऑप्टिमाइज़ करता है.
  • tide: प्रॉडक्ट का टाइटल और ब्यौरा, दोनों जनरेट या ऑप्टिमाइज़ करता है.

ऐसी टोन चुनी गई है जो काम नहीं करती

"टोन काम नहीं कर रहा है" वाली गड़बड़ी, जैसे कि

{
  "error": {
    "code": 400,
    "message": "[\u003ceye3 title='/ProductStudioTextGenerationService.GenerateProductText, INVALID_ARGUMENT'/\u003e APPLICATION_ERROR; ... ; Unsupported tone: 'asdf'. Supported tones are: [\"default\", \"playful\", \"formal\", \"persuasive\", \"conversational\"];AppErrorCode=3;StartTimeMs=1740697325058;unknown;ResFormat=uncompressed;ServerTimeSec=7.45346E-4;LogBytes=256;Non-FailFast;EffSecLevel=none;ReqFormat=uncompressed;ReqID=f7d9bbbc73a1d342;GlobalID=0;Server=[2002:a05:6918:3486:b0:2bc:ccd4:79e6]:14001] Invalid value",
    "status": "INVALID_ARGUMENT",
 ...
}

इस तरह के अनुरोध से

POST https://merchantapi.googleapis.com/productstudio/v1alpha/accounts/{ACCOUNT_ID}:generateProductTextSuggestions

{
   "product_info": {
      "product_attributes": {
         "title": "Volumizing & Lengthening Mascara - Dark Brown",
         "description": "This high-impact mascara delivers both voluptuous volume and dramatic length without clumping or smudging.",
   },
   "output_spec": {
      "workflow_id": "description"
      "tone": "cheerful"
   }
}

ध्यान दें कि tone को "खुश" पर सेट किया जा रहा है, लेकिन इस फ़ील्ड में इनमें से सिर्फ़ एक वैल्यू का इस्तेमाल किया जा सकता है:

  • डिफ़ॉल्ट: आसान, साफ़, और शानदार.
  • मज़ाक़िया: हंसी-मज़ाक़ वाला, अच्छी भाषा का इस्तेमाल करने वाला, हंसी-मज़ाक़ (चुटकुले, चुटकी) और ज़्यादा बढ़ा-चढ़ाकर बताने वाला (इरॉनी, व्यंग्य या इमोजी का इस्तेमाल नहीं किया गया हो).
  • औपचारिक: स्टैंडर्ड अंग्रेज़ी, सही व्याकरण, पूरे वाक्य, कोई स्लैंग या छोटा किया गया शब्द नहीं.
  • बहलाने-बुललाने वाला: पाठक को मनाने के लिए, तार्किक, कम शब्दों में, और तर्क के आधार पर लिखा गया हो.
  • बातचीत वाली: आम बोलचाल वाली, आसानी से समझी जा सकने वाली, और रोज़ इस्तेमाल होने वाली भाषा.