feat: add dynamic variables and startup result handling in batch run schemas
- Introduced dynamic_variables field in BatchRunCreate schema to support flexible input types. - Added BatchStartupResult schema to encapsulate startup state, including greeting and auto-confirmed messages. - Updated BatchRunCaseOut schema to include startup results, enhancing the structure for test run outputs. - Enhanced test run orchestration to prepare and validate dynamic configurations, ensuring isolated variable management across test cases. - Implemented changes in the frontend to accommodate new data structures for improved test case execution and result tracking.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -183,8 +183,6 @@ export function DebugDrawer({
|
||||
}) {
|
||||
const preview = useVoicePreview(assistantId, onNodeActive);
|
||||
const camera = useCameraPreview();
|
||||
const autoTest = useAutoTestRunner();
|
||||
const stopAutoTest = autoTest.stop;
|
||||
const [debugMode, setDebugMode] = useState<DebugMode>("manual");
|
||||
const [showTranscript, setShowTranscript] = useState(false);
|
||||
const [vizStyle, setVizStyle] = useState<VizStyle>("aura");
|
||||
@@ -220,6 +218,14 @@ export function DebugDrawer({
|
||||
}
|
||||
resolvedDynamicVariables[name] = value;
|
||||
}
|
||||
const autoTest = useAutoTestRunner({
|
||||
assistantId,
|
||||
enabled: debugMode === "auto",
|
||||
hasUnsavedChanges,
|
||||
dynamicVariables: resolvedDynamicVariables,
|
||||
dynamicVariablesError,
|
||||
});
|
||||
const stopAutoTest = autoTest.stop;
|
||||
|
||||
const selectCamera = useCallback(
|
||||
async (deviceId: string) => {
|
||||
@@ -369,6 +375,9 @@ function AutoTestPanel({
|
||||
start,
|
||||
stop,
|
||||
rerun,
|
||||
suites,
|
||||
cases,
|
||||
catalogLoading,
|
||||
} = autoTest;
|
||||
|
||||
return (
|
||||
@@ -379,6 +388,10 @@ function AutoTestPanel({
|
||||
<div className="shrink-0 border-t border-hairline bg-card p-3">
|
||||
<AutoTestRunBar
|
||||
state={state}
|
||||
testCase={selectedCase}
|
||||
suites={suites}
|
||||
cases={cases}
|
||||
loading={catalogLoading}
|
||||
onSelectCase={selectCase}
|
||||
onClearCase={clearCase}
|
||||
onStart={start}
|
||||
|
||||
@@ -59,11 +59,23 @@ export type BatchTurnResult = {
|
||||
evaluations: BatchEvaluationResult[];
|
||||
};
|
||||
|
||||
export type BatchStartupResult = {
|
||||
completed: boolean;
|
||||
greeting: string;
|
||||
assistantOutputs: string[];
|
||||
autoConfirmedMessages: Array<{
|
||||
title?: string;
|
||||
message?: string;
|
||||
actions?: Array<{ id?: string; label?: string }>;
|
||||
}>;
|
||||
};
|
||||
|
||||
export type BatchRunCase = {
|
||||
id: string;
|
||||
name: string;
|
||||
status: BatchCaseStatus;
|
||||
turns: BatchTurnResult[];
|
||||
startup?: BatchStartupResult;
|
||||
overallCriteria: BatchEvaluationResult[];
|
||||
attemptCount: number;
|
||||
maxAttempts: number;
|
||||
|
||||
@@ -851,6 +851,7 @@ export const batchRunsApi = {
|
||||
assistantId: string;
|
||||
evaluatorModelResourceId: string;
|
||||
caseIds: string[];
|
||||
dynamicVariables?: Record<string, string | number | boolean>;
|
||||
title?: string;
|
||||
config: {
|
||||
concurrency: number;
|
||||
|
||||
Reference in New Issue
Block a user