Improve ChatGPT metadata generation context and error handling - #1
Open
vitaliyvladov wants to merge 1 commit into
Open
Conversation
Send product specs as user context instead of a fake assistant turn, enrich requests with brand/category/existing copy, fix zero temperature defaults, restore fields on SSE errors, and replace emoji-heavy default prompts. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
English
Summary
Improves ChatGPT product/category/brand metadata generation so the model receives clearer context, zero sampling settings are preserved, and SSE failures restore the previous editor content instead of leaving blank or partial text.
Changes
role: assistant, which confused the model){$product},{$brand},{$category},{$annotation},{$description},{$features}?:defaults so temperature / presence / frequency penalties of0are preservedevent: error; JS restores previous textarea/TinyMCE content and alerts on failureokay_clean.sqlseeds; settings UI placeholder help (en/ru/ua)1DB_changes/update_4.6.1.sqlOpenAiHelperusesOkay\Core\Ai\OpenAiTextClient(develop still uses orhanerday/open-ai)Test plan
{$product},{$brand},{$category},{$annotation},{$description},{$features}) resolve in the request payload0— values are sent as0, not replaced by defaultsupdate_4.6.1.sqlon a DB with old default prompts — only matching old defaults are updatedokay_clean.sql— new default prompts and settings placeholder help (en/ru/ua) look correctУкраїнська
Підсумок
Покращує генерацію метаданих ChatGPT для товарів/категорій/брендів: модель отримує зрозуміліший контекст, нульові параметри семплінгу зберігаються, а при помилках SSE попередній вміст редактора відновлюється.
Зміни
role: assistant, що плутало модель){$product},{$brand},{$category},{$annotation},{$description},{$features}?:, щоб temperature / presence / frequency penalty зі значенням0не підмінялись дефолтамиevent: error; JS відновлює попередній вміст textarea/TinyMCE і показує alert при помилціokay_clean.sql; підказки плейсхолдерів у UI налаштувань (en/ru/ua)1DB_changes/update_4.6.1.sqlOpenAiHelperвикористовуєOkay\Core\Ai\OpenAiTextClient(у develop ще orhanerday/open-ai)План тестування
{$product},{$brand},{$category},{$annotation},{$description},{$features}) підставляються в запит0— у запит йде0, а не дефолтupdate_4.6.1.sqlна БД зі старими дефолтними промптами — оновлюються лише рядки зі старими дефолтамиokay_clean.sql— нові дефолтні промпти та підказки в налаштуваннях (en/ru/ua) коректні