ИИ-помощник в админке: улучшение названий/описаний через OpenAI#148
Merged
Conversation
Внизу форм редактирования — панель AiAssistPanel: готовый промпт для улучшения названия/описания (копирование в ChatGPT/Claude) и кнопка «Улучшить с ИИ» через новую edge-функцию ai-assist (OpenAI Responses API, опциональный web_search с точками интереса рядом). Ответ санируется от сносок-цитат, «Применить» подставляет значения в форму со скроллом к полю. Секреты edge-функций заливаются из .env.local: npm run secrets:sync. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Updates to Preview Branch (feature/ai-assist) ↗︎
Tasks are run on every commit but only new migration files are pushed.
View logs for this Workflow Run ↗︎. |
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.
Summary
PointForm) и маршрута (RouteEditPage): автособранный read-only промпт из живых значений полей + контекст (тип, координаты, признаки), кнопка «Скопировать промпт» для ручной вставки в ChatGPT/Claude.ai-assist(вторая в проекте): авторизация JWT-админа +map_admin_users, OpenAI Responses API, модельgpt-5-mini(переопределяется секретомOPENAI_MODEL).web_search(проверка фактов + 2–3 точки интереса рядом, медленнее), без него — быстрый вызов без POI.parseAiSuggestion): срез markdown-ограждений, вычистка сносок-цитат web-поиска([site](url)), title ≤ 99 символов, pois ≤ 3.src/admin/utils/aiAssistPrompt.ts, её копия вsupabase/functions/ai-assist/_pure.ts(Deno не импортирует из src/); правки синхронизировать..env.local:npm run secrets:sync(scripts/set-supabase-secrets.sh). CI деплоитai-assistотдельной строкой в deploy.yml.Test plan
npm run test— 539 unit-тестов (новые: aiAssistPrompt, AiAssistPanel, PointForm apply-flow)npm run test:functions— 75 deno-тестов (валидация входа, парсер ответа, санитизация ссылок)npm run build, lint, format, e2e — pre-commit прошёл целиком🤖 Generated with Claude Code