@sanity/ailf-studio 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +15 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6166,6 +6166,7 @@ function ailfTool(options = {}) {
|
|
|
6166
6166
|
|
|
6167
6167
|
// src/actions/RunEvaluationAction.tsx
|
|
6168
6168
|
import { BarChartIcon as BarChartIcon2 } from "@sanity/icons";
|
|
6169
|
+
import { useToast } from "@sanity/ui";
|
|
6169
6170
|
import { useCallback as useCallback15, useEffect as useEffect10, useRef as useRef4, useState as useState12 } from "react";
|
|
6170
6171
|
import {
|
|
6171
6172
|
getReleaseIdFromReleaseDocumentId as getReleaseIdFromReleaseDocumentId4,
|
|
@@ -6196,6 +6197,7 @@ function createRunEvaluationAction(options = {}) {
|
|
|
6196
6197
|
const dataset = useDataset();
|
|
6197
6198
|
const projectId = useProjectId();
|
|
6198
6199
|
const currentUser = useCurrentUser();
|
|
6200
|
+
const toast = useToast();
|
|
6199
6201
|
const [state, setState] = useState12({ status: "loading" });
|
|
6200
6202
|
const requestedAtRef = useRef4(null);
|
|
6201
6203
|
const perspectiveId = getReleaseIdFromReleaseDocumentId4(release._id);
|
|
@@ -6310,10 +6312,20 @@ function createRunEvaluationAction(options = {}) {
|
|
|
6310
6312
|
});
|
|
6311
6313
|
requestedAtRef.current = now;
|
|
6312
6314
|
setState({ requestId: doc._id, startedAt: now, status: "requested" });
|
|
6315
|
+
toast.push({
|
|
6316
|
+
closable: true,
|
|
6317
|
+
description: "The evaluation pipeline has been triggered. Results will appear here in ~10\u201315 minutes.",
|
|
6318
|
+
status: "info",
|
|
6319
|
+
title: "AI evaluation started"
|
|
6320
|
+
});
|
|
6313
6321
|
} catch (err) {
|
|
6314
|
-
|
|
6315
|
-
|
|
6316
|
-
|
|
6322
|
+
const message = err instanceof Error ? err.message : "Failed to create evaluation request";
|
|
6323
|
+
setState({ message, status: "error" });
|
|
6324
|
+
toast.push({
|
|
6325
|
+
closable: true,
|
|
6326
|
+
description: message,
|
|
6327
|
+
status: "error",
|
|
6328
|
+
title: "AI evaluation failed"
|
|
6317
6329
|
});
|
|
6318
6330
|
}
|
|
6319
6331
|
}, [
|