woocommerce / woocommerce-android

WooCommerce Android app
https://www.woocommerce.com/mobile
GNU General Public License v2.0
264 stars 133 forks source link

Handle Token Limitations and Incomplete Responses in Product creation with AI #11929

Closed pmusolino closed 2 days ago

pmusolino commented 1 week ago

Problem:

When using the ChatGPT model GPT-4o for generating product descriptions, we've encountered an issue where the JSON response is truncated, indicated by "finish_reason": "length". This suggests that the AI had more information to provide but was cut off due to the max_tokens limit set in the API call. More context here: pe5sF9-2UY

Steps to Reproduce:

  1. Send a detailed prompt to the ChatGPT API using the GPT-4o model.
  2. Observe the JSON response received, particularly looking for "finish_reason": "length".
  3. Note the incomplete content and generic error message.

Changes

dangermattic commented 1 week ago

🚫 Please add a type label (e.g. type: enhancement) and a feature label (e.g. feature: stats) to this issue.