From 15e57c32948c593a31fe547f39b851f21dcdf566 Mon Sep 17 00:00:00 2001 From: sebastjanartic <45803536-sebastjanartic@users.noreply.replit.com> Date: Tue, 2 Sep 2025 13:18:56 +0000 Subject: [PATCH] Enhance AI description generation with custom instructions for users Add a custom instructions input field to the admin video edit dialog and backend to allow users to guide the AI description generation process. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 170e18f0-0f13-4eca-8643-546bba1dd8cc Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/170e18f0-0f13-4eca-8643-546bba1dd8cc/LY6xmBI --- client/src/pages/admin.tsx | 26 ++++++++++++++++++-------- server/aiService.ts | 5 ++++- server/routes.ts | 7 ++++--- 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/client/src/pages/admin.tsx b/client/src/pages/admin.tsx index 8e29f98..5744872 100644 --- a/client/src/pages/admin.tsx +++ b/client/src/pages/admin.tsx @@ -229,6 +229,7 @@ function EditVideoDialog({ }); }, [video]); const [isGeneratingAI, setIsGeneratingAI] = useState(false); + const [customInstructions, setCustomInstructions] = useState(""); const updateMutation = useMutation({ mutationFn: (data: any) => apiRequest("PATCH", `/api/admin/videos/${video.id}`, data), @@ -274,7 +275,8 @@ function EditVideoDialog({ const response = await apiRequest("POST", `/api/admin/videos/${video.id}/generate-description`, { maxCharacters: 500, includeArtistInfo: true, - includeLabelInfo: true + includeLabelInfo: true, + customInstructions: customInstructions.trim() || undefined }); const data = await response.json(); @@ -351,13 +353,21 @@ function EditVideoDialog({ {isGeneratingAI ? "Generating..." : "Generate AI Description"} -