Text Suggestions API ใช้ประโยชน์จากเครื่องมือ Generative AI ของ Product Studio API เพื่อ สร้างและเพิ่มประสิทธิภาพชื่อและคำอธิบายผลิตภัณฑ์ คุณสามารถใช้เพื่อปรับปรุง การมีส่วนร่วมและ Conversion ของลูกค้า รวมถึงเพิ่มประสิทธิภาพกระบวนการจัดการและ อัปเดตข้อมูลผลิตภัณฑ์ ฟีเจอร์ของ Product Studio API ช่วยคุณ เพิ่มประสิทธิภาพการค้าปลีกได้
คุณสร้างอะไรได้บ้างโดยใช้ API
Text Suggestions API ช่วยให้คุณทำสิ่งต่อไปนี้ได้
- ชื่อและคำอธิบายผลิตภัณฑ์ที่แนะนำโดยอิงตามรูปภาพผลิตภัณฑ์และ/หรือ แอตทริบิวต์ผลิตภัณฑ์
- ชื่อที่เพิ่มประสิทธิภาพ SEO สำหรับผลิตภัณฑ์
- ชื่อผลิตภัณฑ์ที่จัดรูปแบบเอง
- คำอธิบายผลิตภัณฑ์จากฟีดผลิตภัณฑ์
นอกจากนี้ คุณยังระบุโทนเสียงสำหรับคำอธิบายและรักษาความสอดคล้องกัน ในข้อมูลผลิตภัณฑ์ที่แสดงทั้งหมดได้ด้วย
คู่มือเริ่มใช้งานฉบับย่อ
วิธี GenerateProductTextSuggestions
สามารถสร้างหรือเพิ่มประสิทธิภาพชื่อและรายละเอียดผลิตภัณฑ์โดยใช้
ข้อมูลผลิตภัณฑ์
API ยอมรับข้อมูลต่อไปนี้
- แอตทริบิวต์ผลิตภัณฑ์ (พจนานุกรม JSON): ออบเจ็กต์ JSON ที่มีแอตทริบิวต์ผลิตภัณฑ์ (เช่น
{"title": "White Tee", "brand": "MyBrand", "size": "XL"}
) - รูปภาพผลิตภัณฑ์: URI ที่ชี้ไปยังรูปภาพผลิตภัณฑ์ (เช่น
{"uri": "https://my-store.com/img/1.png"}
) - ตัวเลือกการจัดรูปแบบชื่อ: พารามิเตอร์สำหรับการปรับแต่งการสร้างชื่อ
ซึ่งรวมถึง
attribute_separator
: ระบุตัวคั่นระหว่างแอตทริบิวต์target_language
: ตั้งค่าภาษาเอาต์พุตattribute_order
: กำหนดลำดับของแอตทริบิวต์ในชื่อที่สร้างขึ้น
- ตัวอย่างการติดป้ายกำกับข้อมูล: ดูตัวอย่างวิธีสร้างชื่อจากคำอธิบาย
- รหัสเวิร์กโฟลว์ (
output_spec.workflow_id
): ฟิลด์workflow_id
ภายใน ออบเจ็กต์output_spec
จะกำหนดประเภทการสร้างข้อความtitle
: สร้างหรือเพิ่มประสิทธิภาพชื่อผลิตภัณฑ์description
: สร้างหรือเพิ่มประสิทธิภาพคำอธิบายผลิตภัณฑ์tide
: สร้างหรือเพิ่มประสิทธิภาพทั้งชื่อและรายละเอียดผลิตภัณฑ์
ตัวอย่าง
ต่อไปนี้เป็นตัวอย่างการใช้ API เพื่อสร้างหรือเพิ่มประสิทธิภาพชื่อหรือคำอธิบาย หรือทั้ง 2 อย่างจากข้อมูลผลิตภัณฑ์ที่ป้อนต่างๆ นอกจากนี้ เรายังนำเสนอข้อผิดพลาดและปัญหาที่พบบ่อยพร้อมวิธีแก้ไข
การสร้างชื่อที่เพิ่มประสิทธิภาพ
ตัวอย่างแสดงวิธีสร้างชื่อที่เหมาะสม
ส่งคำขอ
เนื้อความของคำขอมีข้อมูลผลิตภัณฑ์ที่จะใช้ในการเพิ่มประสิทธิภาพชื่อ ตัวอย่างโครงสร้างคำขอมีดังนี้
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
คุณเพิ่ม 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 มีตัวเลือก 2 แบบ ดังนี้
- การเลือกโทนเสียงที่กำหนดไว้ล่วงหน้า: คุณเลือกจากรายการโทนเสียงเพื่อ
สร้างคำอธิบายใหม่ได้ รายการนี้มีรูปแบบน้ำเสียงต่อไปนี้
- ค่าเริ่มต้น: เรียบง่าย ชัดเจน และสวยงาม
- ขี้เล่น: สนุกสนาน ใช้ภาษาเชิงบวก อารมณ์ขัน (มุกตลก คำพ้องเสียง) และการพูดเกินจริง (ไม่มีการประชดประชัน เสียดสี หรืออีโมจิ)
- ทางการ: ภาษาอังกฤษมาตรฐาน ไวยากรณ์ที่ถูกต้อง ประโยคที่สมบูรณ์ ไม่มี คำสแลงหรือคำย่อ
- โน้มน้าว: สมเหตุสมผล กระชับ และขับเคลื่อนด้วยการโต้แย้งเพื่อโน้มน้าว ผู้อ่าน
- สนทนา: ภาษาที่เป็นกันเอง เข้าใจง่าย และใช้ในชีวิตประจำวัน
- น้ำเสียงเฉพาะของแบรนด์: คุณระบุคำอธิบายที่มีอยู่หรือชิ้นงานข้อความอื่นๆ
ในน้ำเสียงของแบรนด์ได้ โมเดล Generative 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
อย่างน้อย 1 รายการ
เช่น การโพสต์ข้อความนี้จะทำให้เกิดข้อผิดพลาด
POST https://merchantapi.googleapis.com/productstudio/v1alpha/accounts/{ACCOUNT_ID}:generateProductTextSuggestions
{
"output_spec": {
"workflow_id": "title"
}
}
ต้องมีฟิลด์ product_info อย่างน้อย 1 ฟิลด์เพื่อสร้างคำแนะนำข้อความ
ข้อผิดพลาดนี้
{
"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
อย่างน้อย 1 รายการในเนื้อหาคำขอ
เช่น การโพสต์ข้อความนี้จะทำให้เกิดข้อผิดพลาด
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
ข้อผิดพลาด เช่น ตัวอย่าง 4 รายการต่อไปนี้
{
"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
เป็น "ร่าเริง" แต่ช่องนี้รองรับค่าต่อไปนี้เพียงค่าเดียว
- ค่าเริ่มต้น: เรียบง่าย ชัดเจน และสวยงาม
- ขี้เล่น: สนุกสนาน ใช้ภาษาเชิงบวก อารมณ์ขัน (มุกตลก คำพ้องเสียง) และ การพูดเกินจริง (ไม่มีการประชดประชัน เสียดสี หรืออีโมจิ)
- เป็นทางการ: ภาษาอังกฤษมาตรฐาน ไวยากรณ์ถูกต้อง ประโยคสมบูรณ์ ไม่มีคำสแลง หรือคำย่อ
- โน้มน้าวใจ: สมเหตุสมผล กระชับ และอิงตามการโต้แย้งเพื่อโน้มน้าว ผู้อ่าน
- สนทนา: ภาษาที่เป็นกันเอง เข้าใจง่าย และใช้ในชีวิตประจำวัน