Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | 2x 2x 736x 715x 2208x | import { Model, modelDisplayName } from "@/objects/Model";
import {
AlertCircle,
ArrowRight,
History,
Lightbulb,
Sparkles,
} from "lucide-react";
import React from "react";
import { FieldLabel, SectionCard, inputBase } from "../primitives";
const EXAMPLES = [
"An agent that answers customer support tickets using our product documentation",
"A research assistant that summarises industry news and flags competitor moves",
"An onboarding buddy that walks new employees through internal HR policies",
];
const DescribeStep: React.FC<{
value: string;
onChange: (value: string) => void;
models: Model[];
modelId: string;
onModelChange: (id: string) => void;
error: string | null;
onGenerate: () => void;
/** The agent already generated in this wizard, when there is one: going
* back to it costs nothing, generating again does. */
resumeName?: string;
onResume?: () => void;
}> = ({
value,
onChange,
models,
modelId,
onModelChange,
error,
onGenerate,
resumeName,
onResume,
}) => (
<div className="space-y-4">
{onResume && (
<div className="flex items-center gap-2.5 rounded-xl border border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800/60 px-4 py-3">
<History className="size-4 shrink-0 text-gray-500 dark:text-gray-400" />
<p className="flex-1 text-sm text-gray-700 dark:text-gray-200">
You already generated{" "}
<span className="font-medium">{resumeName || "an agent"}</span>.
</p>
<button
type="button"
onClick={onResume}
className="flex items-center gap-1 text-xs font-medium text-gray-900 dark:text-white hover:underline"
>
Back to your generated agent
<ArrowRight className="size-3.5" />
</button>
</div>
)}
<SectionCard
icon={Sparkles}
title="Describe your problem"
description="Explain what you want the agent to do — the AI architect designs the prompt, skills, and knowledge bases around it."
>
<div>
<FieldLabel
label="Problem description"
description="The more context you give (audience, data, tone, constraints), the better the generated agent."
required
/>
<textarea
value={value}
onChange={(e) => onChange(e.target.value)}
placeholder="e.g. I run a SaaS product and need an agent that answers customer support tickets using our documentation, escalates billing issues to a human, and always replies in a friendly but concise tone."
rows={6}
className={inputBase + " resize-none"}
/>
</div>
<div>
<div className="flex items-center gap-1.5 text-xs font-medium text-gray-500 dark:text-gray-400 mb-2">
<Lightbulb className="size-3.5" />
Need inspiration?
</div>
<div className="flex flex-wrap gap-2">
{EXAMPLES.map((example) => (
<button
key={example}
type="button"
onClick={() => onChange(example)}
className="px-3 py-1.5 rounded-full border border-gray-200 dark:border-gray-600 text-xs text-gray-600 dark:text-gray-300 hover:border-gray-300 dark:hover:border-gray-500 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors text-left"
>
{example}
</button>
))}
</div>
</div>
{models.length > 0 && (
<div>
<FieldLabel
label="Generation model"
description="The model used to design the agent (not the model the agent will run on)."
/>
<select
value={modelId}
onChange={(e) => onModelChange(e.target.value)}
className={inputBase}
>
<option value="">Default model</option>
{models.map((model) => (
<option key={model.id} value={model.id}>
{modelDisplayName(model)}
</option>
))}
</select>
</div>
)}
</SectionCard>
{error && (
<div className="flex items-center gap-2 px-4 py-3 rounded-lg bg-red-50 dark:bg-red-950/40 border border-red-200 dark:border-red-800 text-red-700 dark:text-red-300 text-sm">
<AlertCircle className="size-4 shrink-0" />
{error}
</div>
)}
<div className="flex justify-end">
<button
type="button"
onClick={onGenerate}
disabled={value.trim().length < 20}
className="flex items-center gap-1.5 px-4 py-2 rounded-lg bg-gray-900 dark:bg-white text-white dark:text-gray-900 text-sm font-medium hover:opacity-80 disabled:opacity-50 transition-opacity"
>
<Sparkles className="size-4" />
Generate Agent
</button>
</div>
</div>
);
export default DescribeStep;
|