From 0b96ab51fbaa3d2f61ca5e0166664626b319f606 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Wed, 29 Oct 2025 13:58:45 +0000 Subject: [PATCH] Refactor prompt creation flow --- src/components/prompts/CreatePromptDialog.tsx | 86 +++++++++++++++---- 1 file changed, 70 insertions(+), 16 deletions(-) diff --git a/src/components/prompts/CreatePromptDialog.tsx b/src/components/prompts/CreatePromptDialog.tsx index c0dd546..2b05e86 100644 --- a/src/components/prompts/CreatePromptDialog.tsx +++ b/src/components/prompts/CreatePromptDialog.tsx @@ -36,9 +36,11 @@ export function CreatePromptDialog({ open, onOpenChange }: CreatePromptDialogPro const [mainObjective, setMainObjective] = useState(""); const [toneOfVoice, setToneOfVoice] = useState(""); const [forbiddenPatterns, setForbiddenPatterns] = useState(""); + const [refinementInstructions, setRefinementInstructions] = useState(""); + const [isGenerated, setIsGenerated] = useState(false); const handleGeneratePrompt = () => { - const generatedPrompt = `Você é ${agentName}, ${agentRole}. + let generatedPrompt = `Você é ${agentName}, ${agentRole}. Público-alvo: ${targetAudience} @@ -50,7 +52,24 @@ ${forbiddenPatterns ? `Padrões proibidos:\n${forbiddenPatterns}` : ''} Siga estas diretrizes em todas as suas interações.`; + if (refinementInstructions && isGenerated) { + generatedPrompt += `\n\nInstruções adicionais:\n${refinementInstructions}`; + } + setSystemPrompt(generatedPrompt); + setIsGenerated(true); + }; + + const handleStartOver = () => { + setAgentName(""); + setAgentRole(""); + setTargetAudience(""); + setMainObjective(""); + setToneOfVoice(""); + setForbiddenPatterns(""); + setRefinementInstructions(""); + setSystemPrompt(""); + setIsGenerated(false); }; const handleSave = () => { @@ -175,23 +194,58 @@ Siga estas diretrizes em todas as suas interações.`; /> - +
+ + {isGenerated && ( + + )} +
{systemPrompt && ( -
- -