ปัญหาที่พบบ่อยไม่สามารถถอดรหัส JSON จากการตอบกลับของบริการ AI ได้
ไม่สามารถถอดรหัส JSON จากการตอบกลับของบริการ AI ได้
Gato AI Translations for Polylang ส่งพรอมต์ไปยังบริการ AI และการตอบกลับจะอยู่ในรูปแบบ JSON
ขึ้นอยู่กับข้อมูลที่คุณส่ง (สตริงที่ต้องการแปลและภาษา) บริการ AI อาจสร้างการตอบกลับที่ไม่ใช่ JSON ที่ถูกต้อง ในกรณีนี้ บันทึกจะแสดงข้อความแสดงข้อผิดพลาดดังนี้:
Error [Query "translate-customposts"] Execution with errors: 🔴 Translation to zh_CN failed - There was an error requesting data from the API for provider 'OpenRouter': Could not JSON-decode the OpenRouter API's 'choices[0].message.content' field in the responseทุกครั้งที่เราค้นพบปัญหาใหม่ เราจะปรับแต่งพรอมต์เพื่อป้องกันไม่ให้เกิดขึ้นอีก
ปัจจุบัน พรอมต์มีเนื้อหาดังต่อไปนี้:
If a sentence contains HTML:
- Translate the text inside the HTML tags. (eg: `<p>Hello world</p>` => `<p>Hola mundo</p>`)
- Translate the following properties inside the HTML tags: alt, title, placeholder, aria-label, aria-describedby, aria-labelledby, aria-placeholder. Do not translate any other property.
- Ensure that any double quotes (") within a translated string inside an HTML tag attribute are properly escaped by adding a backslash before them (\"), but only if they haven't been escaped already.
- Ensure that the quotes in HTML tag attributes are not escaped (eg: keep `<mark class="has-inline-color">` as is, do not convert to `<mark class=\"has-inline-color\">`).
- Ensure that slashes within HTML tags are not escaped (eg: keep `<p>Hello world</p>` as is, do not convert to `<p>Hello world<\/p>`).
Keep emojis exactly as they are, do not translate them.
Ensure that the response is encoded using UTF-8 for all characters.หากคุณพบข้อผิดพลาด แสดงว่าเป็นปัญหาใหม่ที่เราจำเป็นต้องระบุและแก้ไข
ดำเนินการดังต่อไปนี้:
- พยายามทำความเข้าใจว่าปัญหาคืออะไร
- ปรับแต่งพรอมต์ เพื่อจัดการกับปัญหา
เมื่อทำงานได้แล้ว ส่งพรอมต์ที่คุณใช้มาให้เรา และเราจะฝังโซลูชันนั้นไว้ในปลั๊กอินโดยตรง