টেক্সট সাজেশন জেনারেট করুন

Text Suggestions API, Product Studio API-এর জেনারেটিভ AI টুলের সুবিধা ব্যবহার করে প্রোডাক্টের শীর্ষক ও বিবরণ তৈরি ও অপ্টিমাইজ করে। আপনি এটি ব্যবহার করে গ্রাহকের এনগেজমেন্ট ও কনভার্সন উন্নত করতে এবং প্রোডাক্টের তথ্য ম্যানেজ ও আপডেট করার প্রক্রিয়াকে আরও সহজ করতে পারবেন। Product Studio API-এর ফিচারগুলি আপনাকে রিটেল পারফর্ম্যান্স অপ্টিমাইজ করতে সাহায্য করতে পারে।

API ব্যবহার করে আপনি কী তৈরি করতে পারবেন?

Text Suggestions API আপনাকে নিম্নলিখিত কাজগুলি করতে সাহায্য করে:

  • আপনার প্রোডাক্টের ছবি এবং/অথবা প্রোডাক্ট অ্যাট্রিবিউটের ভিত্তিতে সাজেস্ট করা প্রোডাক্টের নাম ও বিবরণ।
  • আপনার প্রোডাক্টের জন্য SEO-অপ্টিমাইজ করা শীর্ষক
  • আপনার প্রোডাক্টের জন্য কাস্টম-ফরম্যাট করা শীর্ষক
  • আপনার প্রোডাক্ট ফিড থেকে প্রোডাক্টের বিবরণ

এছাড়াও, আপনি বিবরণের জন্য ভয়েসের টোন নির্দিষ্ট করতে এবং আপনার সমস্ত প্রোডাক্ট তালিকা জুড়ে সামঞ্জস্য বজায় রাখতে পারেন।

কুইকস্টার্ট

GenerateProductTextSuggestions পদ্ধতিটি আপনার প্রোডাক্টের তথ্য ব্যবহার করে প্রোডাক্টের নাম এবং বিবরণ তৈরি বা অপ্টিমাইজ করতে পারে।

API এগুলি গ্রহণ করে:

  • প্রোডাক্ট অ্যাট্রিবিউট (JSON ডিকশনারি): প্রোডাক্ট অ্যাট্রিবিউট (যেমন, {"title": "White Tee", "brand": "MyBrand", "size": "XL"}) সহ JSON অবজেক্ট
  • প্রোডাক্টের ছবি: প্রোডাক্টের ছবি দেখায় এমন URI (যেমন, {"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: প্রোডাক্টের নাম ও বিবরণ, দুটিই জেনারেট বা অপ্টিমাইজ করে।

উদাহরণ

বিভিন্ন প্রোডাক্ট ডেটা ইনপুট থেকে শীর্ষক বা বিবরণ অথবা দুটিই জেনারেট বা অপ্টিমাইজ করার জন্য API ব্যবহার করার উদাহরণ নিচে দেওয়া হল। এছাড়াও, আমরা সাধারণ সমস্যা ও ভুল এবং সেগুলির সমাধানও দেখাই।

অপ্টিমাইজ করা টাইটেল জেনারেশন

এই উদাহরণে দেখানো হয়েছে কীভাবে একটি উপযুক্ত শীর্ষক তৈরি করতে হয়।

অনুরোধ করুন

অনুরোধের বডিতে প্রোডাক্টের তথ্য থাকে যা শিরোনাম অপ্টিমাইজেশনের জন্য ব্যবহার করা হয়। অনুরোধের স্ট্রাকচারের একটি উদাহরণ এখানে দেওয়া হল:

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"
      },
    }
  }
}

শিরোনাম ও বিবরণ থেকে শিরোনাম অপ্টিমাইজ করা (কাস্টম উদাহরণ সহ)

এই উদাহরণে, আমরা স্পষ্টভাবে প্রোডাক্ট অ্যাট্রিবিউট লেবেল করি যা আমরা চাই AI শনাক্ত করুক এবং আউটপুটে অ্যাট্রিবিউট অর্ডার করুক।

অনুরোধ করুন

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"
      },
    }
  }
}

শিরোনাম থেকে বিবরণ তৈরি করুন

এই উদাহরণে দেখানো হয়েছে কীভাবে প্রোডাক্টের নাম দিতে হয় এবং API-কে সেই প্রোডাক্টের বিবরণ জেনারেট করতে বলতে হয়।

অনুরোধ করুন

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."
  },
}

টার্গেট ভাষা সংক্রান্ত সহায়তা

এই ফিল্ড API রেসপন্সে জেনারেট করা বিবরণের টেক্সটের ভাষা নির্দিষ্ট করে। আপনি output_spec-এর অংশ হিসেবে target_language যোগ করতে পারবেন প্যারামিটার:

{
    "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 দুটি বিকল্প অফার করে:

  • আগে থেকে নির্ধারিত টোন বেছে নেওয়া: নতুন বিবরণ তৈরি করতে আপনি টোনের তালিকা থেকে বেছে নিতে পারবেন। তালিকায় এইসব টোন স্টাইল অন্তর্ভুক্ত আছে:
    • ডিফল্ট: সহজ, স্পষ্ট ও মার্জিত।
    • মজার: হালকা মেজাজের, ইতিবাচক ভাষা, হাস্যরস (কৌতুক, শ্লেষ) এবং অতিরঞ্জন (কোনও বিদ্রূপ, কটাক্ষ বা ইমোজি নয়) ব্যবহার করা।
    • আনুষ্ঠানিক: স্ট্যান্ডার্ড ইংরেজি, সঠিক ব্যাকরণ, সম্পূর্ণ বাক্য, কোনও অপশব্দ বা সংক্ষিপ্ত রূপ নেই।
    • প্ররোচনামূলক: পাঠককে বোঝানোর জন্য যৌক্তিক, সংক্ষিপ্ত এবং যুক্তি-চালিত।
    • কথোপকথনমূলক: বন্ধুত্বপূর্ণ, সহজে বোঝা যায় এমন, দৈনন্দিন ভাষা।
  • ব্র্যান্ড-নির্দিষ্ট টোন: আপনি নিজের ব্র্যান্ডের টোনে আগে থেকে থাকা বিবরণ বা অন্যান্য টেক্সট অ্যাসেট দিতে পারেন। জেনারেটিভ AI মডেল টেক্সটের টোন বিশ্লেষণ করবে এবং এইসব দিক অনুযায়ী "লেখার স্টাইল বর্ণনাকারী" জেনারেট করবে:
    • ফর্ম্যালিটি (যেমন, ফর্ম্যাল, ক্যাজুয়াল)
    • কতখানি বিস্তারিত (যেমন, সংক্ষিপ্ত, খুব বিস্তারিত)
    • টোন (যেমন, পেশাদার, তথ্যপূর্ণ, ইতিবাচক, প্ররোচনামূলক)
    • বাক্যের গঠন (যেমন, "অল্প কয়েকটি কনজাংশন সহ সহজ বাক্য")
    • সবচেয়ে বেশি ব্যবহৃত শব্দ ও বাক্যাংশ

ক্লায়েন্ট লাইব্রেরি

আপনার অনুরোধ জমা দেওয়ার জন্য আমরা ক্লায়েন্ট লাইব্রেরি ব্যবহার করার সাজেশন দিই। আমরা আপনার সাথে ক্লায়েন্ট লাইব্রেরি শেয়ার করব যা আপনি Maven প্রোজেক্টে ইনস্টল করতে পারবেন।

কোডের নমুনা

আপনার যাচাইকরণের পদ্ধতি বেছে নিন এবং এই নির্দেশাবলী ব্যবহার করে এইসব কোড স্যাম্পেল সেট-আপ করুন। এখানে একটি স্যাম্পেল দেওয়া হল যা আপনি টেক্সট সাজেশন জেনারেট করতে ব্যবহার করতে পারবেন।

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);
  }
}

Python

"""A module to generate product text suggestions."""

from examples.authentication import configuration
from examples.authentication import generate_user_credentials
from google.shopping.merchant_productstudio_v1alpha import GenerateProductTextSuggestionsRequest
from google.shopping.merchant_productstudio_v1alpha import OutputSpec
from google.shopping.merchant_productstudio_v1alpha import ProductInfo
from google.shopping.merchant_productstudio_v1alpha import TextSuggestionsServiceClient


# Fetches the Merchant Center account ID from the configuration file.
# This ID is used to construct the 'name' for the API request.
_ACCOUNT_ID = configuration.Configuration().read_merchant_info()
# The parent resource name for the GenerateProductTextSuggestionsRequest.
# Format: "accounts/{account}"
_PARENT_RESOURCE_NAME = f"accounts/{_ACCOUNT_ID}"


def generate_product_text_suggestions_sample():
  """Generates product text suggestions for a given product."""

  # Gets OAuth Credentials.
  credentials = generate_user_credentials.main()

  # Creates a client for the TextSuggestionsService.
  client = TextSuggestionsServiceClient(credentials=credentials)

  # Defines the product information for which suggestions are needed.
  # This includes attributes like title and description.
  product_info = ProductInfo(
      product_attributes={
          "title": "Mens shirt",
          "description": "A blue shirt for men in size S",
      }
  )

  # Defines the output specification.
  # The 'workflow_id' specifies the type of text suggestion, e.g., "title".
  output_spec = OutputSpec(workflow_id="title")

  # Creates the request object for generating product text suggestions.
  # It includes the parent resource name, product information, and output
  # specification.
  request = GenerateProductTextSuggestionsRequest(
      name=_PARENT_RESOURCE_NAME,
      product_info=product_info,
      output_spec=output_spec,
  )

  # Sends the request to the API.
  print(
      f"Sending GenerateProductTextSuggestions request: {_PARENT_RESOURCE_NAME}"
  )
  try:
    response = client.generate_product_text_suggestions(request=request)
    # Prints the generated suggestions.
    print("Generated product text suggestions response below:")
    print(response)
  except RuntimeError as e:
    # Catches and prints any errors that occur during the API call.
    print("An error has occured: ")
    print(e)


if __name__ == "__main__":
  generate_product_text_suggestions_sample()

সাধারণ সমস্যা ও ত্রুটি

এখানে কিছু সাধারণ সমস্যা এবং সেগুলির সমাধান দেওয়া হল।

টেক্সট সাজেশন জেনারেট করার জন্য প্রোডাক্টের তথ্য প্রয়োজন

আপনি কি নিম্নলিখিত সমস্যার মেসেজটি পেয়েছেন

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-এ (কিছু) প্রয়োজন

নিচে উল্লেখ করা চারটি উদাহরণের মতো সমস্যা

{
  "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-কে "attributes" হিসেবে সেট করে, কিন্তু এই ফিল্ডে নিম্নলিখিত ভ্যালুগুলির মধ্যে শুধুমাত্র একটি কাজ করে:

  • title: প্রোডাক্টের নাম জেনারেট বা অপ্টিমাইজ করে।
  • 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-কে "cheerful" হিসেবে সেট করা হচ্ছে, কিন্তু এই ফিল্ডে নিম্নলিখিত ভ্যালুগুলির মধ্যে শুধুমাত্র একটিই ব্যবহার করা যাবে:

  • ডিফল্ট: সহজ, স্পষ্ট ও মার্জিত।
  • কৌতুকপূর্ণ: হালকা মেজাজের, ইতিবাচক ভাষা, হাস্যরস (কৌতুক, শ্লেষ) এবং অতিরঞ্জন (কোনও বিদ্রূপ, কটাক্ষ বা ইমোজি নয়) ব্যবহার করা।
  • আনুষ্ঠানিক: স্ট্যান্ডার্ড ইংরেজি, সঠিক ব্যাকরণ, সম্পূর্ণ বাক্য, কোনও স্ল্যাং বা সংক্ষিপ্ত রূপ নেই।
  • প্ররোচনামূলক: পাঠককে বোঝানোর জন্য যৌক্তিক, সংক্ষিপ্ত এবং যুক্তি-চালিত।
  • কথোপকথনমূলক: বন্ধুত্বপূর্ণ, সহজে বোঝা যায় এমন, দৈনন্দিন ভাষা।