Throws different error types based on failure:
cause property.import { resumeExperiment } from "@arizeai/phoenix-client/experiments";
// Resume an interrupted experiment
try {
await resumeExperiment({
experimentId: "exp_123",
task: myTask,
});
} catch (error) {
// Handle by error name (no instanceof needed)
if (error.name === "TaskFetchError") {
console.error("Failed to connect to server:", error.cause);
} else if (error.name === "TaskAbortedError") {
console.error("Task stopped due to error:", error.cause);
} else {
console.error("Unexpected error:", error);
}
}
// Resume with evaluators
await resumeExperiment({
experimentId: "exp_123",
task: myTask,
evaluators: [correctnessEvaluator, relevanceEvaluator],
});
// Stop on first error (useful for debugging)
await resumeExperiment({
experimentId: "exp_123",
task: myTask,
stopOnFirstError: true, // Exit immediately on first task failure
});
Resume an incomplete experiment by running only the missing or failed runs.
This function identifies which (example, repetition) pairs have not been completed (either missing or failed) and re-runs the task only for those pairs. Optionally, evaluators can be run on the completed runs after task execution.
The function processes incomplete runs in batches using pagination to minimize memory usage.