feat(dashboard): add question input for System One and hide inline test
Allow customizing evaluation instructions in the System One example card, and disable the inline model probe button for System One models since decision models do not accept chat completion probes. Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -54,6 +54,7 @@ export function GenericExampleCard({ providerId, kind }) {
|
||||
const supportsMask = !!selectedModelObj?.capabilities?.includes("mask");
|
||||
|
||||
const [input, setInput] = useState(safeExConfig.defaultInput || "");
|
||||
const [question, setQuestion] = useState("Does this request require urgent attention?");
|
||||
const [refImage, setRefImage] = useState("");
|
||||
const [maskImage, setMaskImage] = useState("");
|
||||
const [extraValues, setExtraValues] = useState(() =>
|
||||
@@ -117,11 +118,20 @@ export function GenericExampleCard({ providerId, kind }) {
|
||||
acc[k] = v;
|
||||
return acc;
|
||||
}, {});
|
||||
const systemoneQuestions = kind === "systemone" ? {
|
||||
questions: {
|
||||
is_urgent: {
|
||||
type: "noul",
|
||||
instructions: question.trim() || "Does this request require urgent attention?",
|
||||
},
|
||||
},
|
||||
} : {};
|
||||
const requestBody = {
|
||||
model: modelFull,
|
||||
[exConfig.bodyKey]: input,
|
||||
...exConfig.extraBody,
|
||||
...extraBodyFromFields,
|
||||
...systemoneQuestions,
|
||||
...(supportsEdit && effectiveRefImage ? { image: effectiveRefImage } : {}),
|
||||
...(supportsMask && effectiveMaskImage ? { mask_image: effectiveMaskImage } : {}),
|
||||
};
|
||||
@@ -328,6 +338,29 @@ export function GenericExampleCard({ providerId, kind }) {
|
||||
</div>
|
||||
</Row>
|
||||
|
||||
{/* Question for System One */}
|
||||
{kind === "systemone" && (
|
||||
<Row label="Question">
|
||||
<div className="relative">
|
||||
<input
|
||||
value={question}
|
||||
onChange={(e) => setQuestion(e.target.value)}
|
||||
placeholder="Enter evaluation question or criteria"
|
||||
className="w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"
|
||||
/>
|
||||
{question && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setQuestion("")}
|
||||
className="absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors"
|
||||
>
|
||||
<span className="material-symbols-outlined text-[14px]">close</span>
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</Row>
|
||||
)}
|
||||
|
||||
{/* Reference image (only for edit-capable image models) */}
|
||||
{supportsEdit && (
|
||||
<Row label="Ref Image (URL)">
|
||||
|
||||
@@ -119,6 +119,7 @@ export default function ModelsCard({ providerId, kindFilter, providerAliasOverri
|
||||
|
||||
const providerAlias = providerAliasOverride || getProviderAlias(providerId);
|
||||
const effectiveType = kindFilter || "llm";
|
||||
const supportsTest = kindFilter !== "systemone";
|
||||
|
||||
const fetchData = useCallback(async () => {
|
||||
try {
|
||||
@@ -238,7 +239,7 @@ export default function ModelsCard({ providerId, kindFilter, providerAliasOverri
|
||||
onSetAlias={(alias) => handleSetAlias(model.id, alias)}
|
||||
onDeleteAlias={() => handleDeleteAlias(existingAlias)}
|
||||
testStatus={modelTestResults[model.id]}
|
||||
onTest={() => handleTestModel(model.id)}
|
||||
onTest={supportsTest ? () => handleTestModel(model.id) : undefined}
|
||||
isTesting={testingModelId === model.id}
|
||||
isFree={model.isFree}
|
||||
/>
|
||||
@@ -255,7 +256,7 @@ export default function ModelsCard({ providerId, kindFilter, providerAliasOverri
|
||||
onSetAlias={() => {}}
|
||||
onDeleteAlias={() => handleDeleteCustomModel(model.id)}
|
||||
testStatus={modelTestResults[model.id]}
|
||||
onTest={() => handleTestModel(model.id)}
|
||||
onTest={supportsTest ? () => handleTestModel(model.id) : undefined}
|
||||
isTesting={testingModelId === model.id}
|
||||
isCustom
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user