@iblai/data-layer 1.9.3 → 1.9.4
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.d.ts +4733 -2
- package/dist/index.esm.js +388 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +422 -0
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/src/features/evaluations/api-slice.d.ts +4314 -0
- package/dist/src/features/evaluations/constants.d.ts +102 -0
- package/dist/src/features/evaluations/types.d.ts +285 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -45474,6 +45474,391 @@ const auditLogsApiSlice = react.createApi({
|
|
|
45474
45474
|
});
|
|
45475
45475
|
const { useGetAuditLogsQuery, useLazyGetAuditLogsQuery } = auditLogsApiSlice;
|
|
45476
45476
|
|
|
45477
|
+
const EVALUATIONS_REDUCER_PATH = 'evaluationsApiSlice';
|
|
45478
|
+
const evaluationsBase = (org, userId) => `/api/ai-mentor/orgs/${org}/users/${userId}/evaluations`;
|
|
45479
|
+
const EVALUATIONS_ENDPOINTS = {
|
|
45480
|
+
GET_TASK: {
|
|
45481
|
+
service: exports.SERVICES.AXD,
|
|
45482
|
+
path: (org, userId, taskId) => `/api/ai-mentor/orgs/${org}/users/${userId}/tasks/${encodeURIComponent(taskId)}`,
|
|
45483
|
+
},
|
|
45484
|
+
LIST_DATASETS: {
|
|
45485
|
+
service: exports.SERVICES.AXD,
|
|
45486
|
+
path: (org, userId) => `${evaluationsBase(org, userId)}/datasets/`,
|
|
45487
|
+
},
|
|
45488
|
+
CREATE_DATASET: {
|
|
45489
|
+
service: exports.SERVICES.AXD,
|
|
45490
|
+
path: (org, userId) => `${evaluationsBase(org, userId)}/datasets/`,
|
|
45491
|
+
},
|
|
45492
|
+
GET_DATASET: {
|
|
45493
|
+
service: exports.SERVICES.AXD,
|
|
45494
|
+
path: (org, userId, datasetName) => `${evaluationsBase(org, userId)}/datasets/${encodeURIComponent(datasetName)}/`,
|
|
45495
|
+
},
|
|
45496
|
+
LIST_DATASET_ITEMS: {
|
|
45497
|
+
service: exports.SERVICES.AXD,
|
|
45498
|
+
path: (org, userId, datasetName) => `${evaluationsBase(org, userId)}/datasets/${encodeURIComponent(datasetName)}/items/`,
|
|
45499
|
+
},
|
|
45500
|
+
ADD_DATASET_ITEMS: {
|
|
45501
|
+
service: exports.SERVICES.AXD,
|
|
45502
|
+
path: (org, userId, datasetName) => `${evaluationsBase(org, userId)}/datasets/${encodeURIComponent(datasetName)}/items/`,
|
|
45503
|
+
},
|
|
45504
|
+
UPLOAD_DATASET_CSV: {
|
|
45505
|
+
service: exports.SERVICES.AXD,
|
|
45506
|
+
path: (org, userId, datasetName) => `${evaluationsBase(org, userId)}/datasets/${encodeURIComponent(datasetName)}/items/upload/`,
|
|
45507
|
+
},
|
|
45508
|
+
UPDATE_DATASET_ITEM: {
|
|
45509
|
+
service: exports.SERVICES.AXD,
|
|
45510
|
+
path: (org, userId, datasetName, itemId) => `${evaluationsBase(org, userId)}/datasets/${encodeURIComponent(datasetName)}/items/${encodeURIComponent(itemId)}/`,
|
|
45511
|
+
},
|
|
45512
|
+
DELETE_DATASET_ITEM: {
|
|
45513
|
+
service: exports.SERVICES.AXD,
|
|
45514
|
+
path: (org, userId, datasetName, itemId) => `${evaluationsBase(org, userId)}/datasets/${encodeURIComponent(datasetName)}/items/${encodeURIComponent(itemId)}/`,
|
|
45515
|
+
},
|
|
45516
|
+
LIST_RUNS: {
|
|
45517
|
+
service: exports.SERVICES.AXD,
|
|
45518
|
+
path: (org, userId, datasetName) => `${evaluationsBase(org, userId)}/datasets/${encodeURIComponent(datasetName)}/runs/`,
|
|
45519
|
+
},
|
|
45520
|
+
START_RUN: {
|
|
45521
|
+
service: exports.SERVICES.AXD,
|
|
45522
|
+
path: (org, userId, datasetName) => `${evaluationsBase(org, userId)}/datasets/${encodeURIComponent(datasetName)}/runs/`,
|
|
45523
|
+
},
|
|
45524
|
+
GET_RUN: {
|
|
45525
|
+
service: exports.SERVICES.AXD,
|
|
45526
|
+
path: (org, userId, datasetName, runName) => `${evaluationsBase(org, userId)}/datasets/${encodeURIComponent(datasetName)}/runs/${encodeURIComponent(runName)}/`,
|
|
45527
|
+
},
|
|
45528
|
+
EXPORT_RUN: {
|
|
45529
|
+
service: exports.SERVICES.AXD,
|
|
45530
|
+
path: (org, userId, datasetName, runName) => `${evaluationsBase(org, userId)}/datasets/${encodeURIComponent(datasetName)}/runs/${encodeURIComponent(runName)}/export/`,
|
|
45531
|
+
},
|
|
45532
|
+
DELETE_RUN: {
|
|
45533
|
+
service: exports.SERVICES.AXD,
|
|
45534
|
+
path: (org, userId, datasetName, runName) => `${evaluationsBase(org, userId)}/datasets/${encodeURIComponent(datasetName)}/runs/${encodeURIComponent(runName)}/`,
|
|
45535
|
+
},
|
|
45536
|
+
EVALUATE_RUN: {
|
|
45537
|
+
service: exports.SERVICES.AXD,
|
|
45538
|
+
path: (org, userId, datasetName, runName) => `${evaluationsBase(org, userId)}/datasets/${encodeURIComponent(datasetName)}/runs/${encodeURIComponent(runName)}/evaluate/`,
|
|
45539
|
+
},
|
|
45540
|
+
LIST_RUN_JUDGES: {
|
|
45541
|
+
service: exports.SERVICES.AXD,
|
|
45542
|
+
path: (org, userId, datasetName, runName) => `${evaluationsBase(org, userId)}/datasets/${encodeURIComponent(datasetName)}/runs/${encodeURIComponent(runName)}/evaluate/`,
|
|
45543
|
+
},
|
|
45544
|
+
LIST_JUDGES: {
|
|
45545
|
+
service: exports.SERVICES.AXD,
|
|
45546
|
+
path: (org, userId) => `${evaluationsBase(org, userId)}/judges/`,
|
|
45547
|
+
},
|
|
45548
|
+
LIST_SCORES: {
|
|
45549
|
+
service: exports.SERVICES.AXD,
|
|
45550
|
+
path: (org, userId) => `${evaluationsBase(org, userId)}/scores/`,
|
|
45551
|
+
},
|
|
45552
|
+
CREATE_SCORE: {
|
|
45553
|
+
service: exports.SERVICES.AXD,
|
|
45554
|
+
path: (org, userId) => `${evaluationsBase(org, userId)}/scores/`,
|
|
45555
|
+
},
|
|
45556
|
+
DELETE_SCORE: {
|
|
45557
|
+
service: exports.SERVICES.AXD,
|
|
45558
|
+
path: (org, userId, scoreId) => `${evaluationsBase(org, userId)}/scores/${encodeURIComponent(scoreId)}/`,
|
|
45559
|
+
},
|
|
45560
|
+
LIST_SCORE_CONFIGS: {
|
|
45561
|
+
service: exports.SERVICES.AXD,
|
|
45562
|
+
path: (org, userId) => `${evaluationsBase(org, userId)}/score-configs/`,
|
|
45563
|
+
},
|
|
45564
|
+
CREATE_SCORE_CONFIG: {
|
|
45565
|
+
service: exports.SERVICES.AXD,
|
|
45566
|
+
path: (org, userId) => `${evaluationsBase(org, userId)}/score-configs/`,
|
|
45567
|
+
},
|
|
45568
|
+
};
|
|
45569
|
+
const EVALUATIONS_TAGS = {
|
|
45570
|
+
DATASETS: 'EVAL_DATASETS',
|
|
45571
|
+
DATASET: 'EVAL_DATASET',
|
|
45572
|
+
DATASET_ITEMS: 'EVAL_DATASET_ITEMS',
|
|
45573
|
+
RUNS: 'EVAL_RUNS',
|
|
45574
|
+
RUN: 'EVAL_RUN',
|
|
45575
|
+
SCORES: 'EVAL_SCORES',
|
|
45576
|
+
SCORE_CONFIGS: 'EVAL_SCORE_CONFIGS',
|
|
45577
|
+
JUDGES: 'EVAL_JUDGES',
|
|
45578
|
+
};
|
|
45579
|
+
|
|
45580
|
+
const evaluationsApiSlice = react.createApi({
|
|
45581
|
+
reducerPath: EVALUATIONS_REDUCER_PATH,
|
|
45582
|
+
baseQuery: iblFetchBaseQuery,
|
|
45583
|
+
tagTypes: [
|
|
45584
|
+
EVALUATIONS_TAGS.DATASETS,
|
|
45585
|
+
EVALUATIONS_TAGS.DATASET,
|
|
45586
|
+
EVALUATIONS_TAGS.DATASET_ITEMS,
|
|
45587
|
+
EVALUATIONS_TAGS.RUNS,
|
|
45588
|
+
EVALUATIONS_TAGS.RUN,
|
|
45589
|
+
EVALUATIONS_TAGS.SCORES,
|
|
45590
|
+
EVALUATIONS_TAGS.SCORE_CONFIGS,
|
|
45591
|
+
EVALUATIONS_TAGS.JUDGES,
|
|
45592
|
+
],
|
|
45593
|
+
endpoints: (builder) => ({
|
|
45594
|
+
listEvalDatasets: builder.query({
|
|
45595
|
+
query: ({ org, userId, page, limit, name, user_email }) => ({
|
|
45596
|
+
url: EVALUATIONS_ENDPOINTS.LIST_DATASETS.path(org, userId),
|
|
45597
|
+
service: EVALUATIONS_ENDPOINTS.LIST_DATASETS.service,
|
|
45598
|
+
params: { page, limit, name, user_email },
|
|
45599
|
+
}),
|
|
45600
|
+
providesTags: [EVALUATIONS_TAGS.DATASETS],
|
|
45601
|
+
}),
|
|
45602
|
+
createEvalDataset: builder.mutation({
|
|
45603
|
+
query: ({ org, userId, body }) => ({
|
|
45604
|
+
url: EVALUATIONS_ENDPOINTS.CREATE_DATASET.path(org, userId),
|
|
45605
|
+
service: EVALUATIONS_ENDPOINTS.CREATE_DATASET.service,
|
|
45606
|
+
method: 'POST',
|
|
45607
|
+
body,
|
|
45608
|
+
}),
|
|
45609
|
+
invalidatesTags: [EVALUATIONS_TAGS.DATASETS],
|
|
45610
|
+
}),
|
|
45611
|
+
getEvalDataset: builder.query({
|
|
45612
|
+
query: ({ org, userId, datasetName }) => ({
|
|
45613
|
+
url: EVALUATIONS_ENDPOINTS.GET_DATASET.path(org, userId, datasetName),
|
|
45614
|
+
service: EVALUATIONS_ENDPOINTS.GET_DATASET.service,
|
|
45615
|
+
}),
|
|
45616
|
+
providesTags: (_result, _error, { datasetName }) => [
|
|
45617
|
+
{ type: EVALUATIONS_TAGS.DATASET, id: datasetName },
|
|
45618
|
+
],
|
|
45619
|
+
}),
|
|
45620
|
+
listEvalDatasetItems: builder.query({
|
|
45621
|
+
query: ({ org, userId, datasetName, page, limit, include_trace }) => ({
|
|
45622
|
+
url: EVALUATIONS_ENDPOINTS.LIST_DATASET_ITEMS.path(org, userId, datasetName),
|
|
45623
|
+
service: EVALUATIONS_ENDPOINTS.LIST_DATASET_ITEMS.service,
|
|
45624
|
+
params: { page, limit, include_trace },
|
|
45625
|
+
}),
|
|
45626
|
+
providesTags: (_result, _error, { datasetName }) => [
|
|
45627
|
+
{ type: EVALUATIONS_TAGS.DATASET_ITEMS, id: datasetName },
|
|
45628
|
+
],
|
|
45629
|
+
}),
|
|
45630
|
+
addEvalDatasetItems: builder.mutation({
|
|
45631
|
+
query: ({ org, userId, datasetName, body }) => ({
|
|
45632
|
+
url: EVALUATIONS_ENDPOINTS.ADD_DATASET_ITEMS.path(org, userId, datasetName),
|
|
45633
|
+
service: EVALUATIONS_ENDPOINTS.ADD_DATASET_ITEMS.service,
|
|
45634
|
+
method: 'POST',
|
|
45635
|
+
body,
|
|
45636
|
+
}),
|
|
45637
|
+
invalidatesTags: (_result, _error, { datasetName }) => [
|
|
45638
|
+
{ type: EVALUATIONS_TAGS.DATASET_ITEMS, id: datasetName },
|
|
45639
|
+
],
|
|
45640
|
+
}),
|
|
45641
|
+
uploadEvalDatasetCsv: builder.mutation({
|
|
45642
|
+
query: ({ org, userId, datasetName, formData }) => ({
|
|
45643
|
+
url: EVALUATIONS_ENDPOINTS.UPLOAD_DATASET_CSV.path(org, userId, datasetName),
|
|
45644
|
+
service: EVALUATIONS_ENDPOINTS.UPLOAD_DATASET_CSV.service,
|
|
45645
|
+
method: 'POST',
|
|
45646
|
+
body: formData,
|
|
45647
|
+
isJson: false,
|
|
45648
|
+
}),
|
|
45649
|
+
invalidatesTags: (_result, _error, { datasetName }) => [
|
|
45650
|
+
{ type: EVALUATIONS_TAGS.DATASET_ITEMS, id: datasetName },
|
|
45651
|
+
],
|
|
45652
|
+
}),
|
|
45653
|
+
updateEvalDatasetItem: builder.mutation({
|
|
45654
|
+
query: ({ org, userId, datasetName, itemId, body }) => ({
|
|
45655
|
+
url: EVALUATIONS_ENDPOINTS.UPDATE_DATASET_ITEM.path(org, userId, datasetName, itemId),
|
|
45656
|
+
service: EVALUATIONS_ENDPOINTS.UPDATE_DATASET_ITEM.service,
|
|
45657
|
+
method: 'PUT',
|
|
45658
|
+
body,
|
|
45659
|
+
}),
|
|
45660
|
+
invalidatesTags: (_result, _error, { datasetName }) => [
|
|
45661
|
+
{ type: EVALUATIONS_TAGS.DATASET_ITEMS, id: datasetName },
|
|
45662
|
+
],
|
|
45663
|
+
}),
|
|
45664
|
+
deleteEvalDatasetItem: builder.mutation({
|
|
45665
|
+
query: ({ org, userId, datasetName, itemId }) => ({
|
|
45666
|
+
url: EVALUATIONS_ENDPOINTS.DELETE_DATASET_ITEM.path(org, userId, datasetName, itemId),
|
|
45667
|
+
service: EVALUATIONS_ENDPOINTS.DELETE_DATASET_ITEM.service,
|
|
45668
|
+
method: 'DELETE',
|
|
45669
|
+
}),
|
|
45670
|
+
invalidatesTags: (_result, _error, { datasetName }) => [
|
|
45671
|
+
{ type: EVALUATIONS_TAGS.DATASET_ITEMS, id: datasetName },
|
|
45672
|
+
],
|
|
45673
|
+
}),
|
|
45674
|
+
listEvalRuns: builder.query({
|
|
45675
|
+
query: ({ org, userId, datasetName, page, limit, user_email }) => ({
|
|
45676
|
+
url: EVALUATIONS_ENDPOINTS.LIST_RUNS.path(org, userId, datasetName),
|
|
45677
|
+
service: EVALUATIONS_ENDPOINTS.LIST_RUNS.service,
|
|
45678
|
+
params: { page, limit, user_email },
|
|
45679
|
+
}),
|
|
45680
|
+
providesTags: (_result, _error, { datasetName }) => [
|
|
45681
|
+
{ type: EVALUATIONS_TAGS.RUNS, id: datasetName },
|
|
45682
|
+
],
|
|
45683
|
+
}),
|
|
45684
|
+
startEvalRun: builder.mutation({
|
|
45685
|
+
query: ({ org, userId, datasetName, body }) => ({
|
|
45686
|
+
url: EVALUATIONS_ENDPOINTS.START_RUN.path(org, userId, datasetName),
|
|
45687
|
+
service: EVALUATIONS_ENDPOINTS.START_RUN.service,
|
|
45688
|
+
method: 'POST',
|
|
45689
|
+
body,
|
|
45690
|
+
}),
|
|
45691
|
+
invalidatesTags: (_result, _error, { datasetName }) => [
|
|
45692
|
+
{ type: EVALUATIONS_TAGS.RUNS, id: datasetName },
|
|
45693
|
+
],
|
|
45694
|
+
}),
|
|
45695
|
+
getEvalRun: builder.query({
|
|
45696
|
+
query: ({ org, userId, datasetName, runName }) => ({
|
|
45697
|
+
url: EVALUATIONS_ENDPOINTS.GET_RUN.path(org, userId, datasetName, runName),
|
|
45698
|
+
service: EVALUATIONS_ENDPOINTS.GET_RUN.service,
|
|
45699
|
+
}),
|
|
45700
|
+
providesTags: (_result, _error, { runName }) => [{ type: EVALUATIONS_TAGS.RUN, id: runName }],
|
|
45701
|
+
}),
|
|
45702
|
+
deleteEvalRun: builder.mutation({
|
|
45703
|
+
query: ({ org, userId, datasetName, runName }) => ({
|
|
45704
|
+
url: EVALUATIONS_ENDPOINTS.DELETE_RUN.path(org, userId, datasetName, runName),
|
|
45705
|
+
service: EVALUATIONS_ENDPOINTS.DELETE_RUN.service,
|
|
45706
|
+
method: 'DELETE',
|
|
45707
|
+
}),
|
|
45708
|
+
invalidatesTags: (_result, _error, { datasetName }) => [
|
|
45709
|
+
{ type: EVALUATIONS_TAGS.RUNS, id: datasetName },
|
|
45710
|
+
],
|
|
45711
|
+
}),
|
|
45712
|
+
exportEvalRun: builder.mutation({
|
|
45713
|
+
query: ({ org, userId, datasetName, runName }) => ({
|
|
45714
|
+
url: EVALUATIONS_ENDPOINTS.EXPORT_RUN.path(org, userId, datasetName, runName),
|
|
45715
|
+
service: EVALUATIONS_ENDPOINTS.EXPORT_RUN.service,
|
|
45716
|
+
responseHandler: (response) => response.text(),
|
|
45717
|
+
isJson: false,
|
|
45718
|
+
}),
|
|
45719
|
+
}),
|
|
45720
|
+
evaluateEvalRun: builder.mutation({
|
|
45721
|
+
query: ({ org, userId, datasetName, runName, body }) => ({
|
|
45722
|
+
url: EVALUATIONS_ENDPOINTS.EVALUATE_RUN.path(org, userId, datasetName, runName),
|
|
45723
|
+
service: EVALUATIONS_ENDPOINTS.EVALUATE_RUN.service,
|
|
45724
|
+
method: 'POST',
|
|
45725
|
+
body,
|
|
45726
|
+
}),
|
|
45727
|
+
invalidatesTags: (_result, _error, { runName }) => [
|
|
45728
|
+
{ type: EVALUATIONS_TAGS.RUN, id: runName },
|
|
45729
|
+
EVALUATIONS_TAGS.JUDGES,
|
|
45730
|
+
],
|
|
45731
|
+
}),
|
|
45732
|
+
listEvalRunJudges: builder.query({
|
|
45733
|
+
query: ({ org, userId, datasetName, runName, page, limit, status, user_email }) => ({
|
|
45734
|
+
url: EVALUATIONS_ENDPOINTS.LIST_RUN_JUDGES.path(org, userId, datasetName, runName),
|
|
45735
|
+
service: EVALUATIONS_ENDPOINTS.LIST_RUN_JUDGES.service,
|
|
45736
|
+
params: { page, limit, status, user_email },
|
|
45737
|
+
}),
|
|
45738
|
+
providesTags: [EVALUATIONS_TAGS.JUDGES],
|
|
45739
|
+
}),
|
|
45740
|
+
listEvalJudges: builder.query({
|
|
45741
|
+
query: ({ org, userId, page, limit, status, user_email, dataset_name }) => ({
|
|
45742
|
+
url: EVALUATIONS_ENDPOINTS.LIST_JUDGES.path(org, userId),
|
|
45743
|
+
service: EVALUATIONS_ENDPOINTS.LIST_JUDGES.service,
|
|
45744
|
+
params: { page, limit, status, user_email, dataset_name },
|
|
45745
|
+
}),
|
|
45746
|
+
providesTags: [EVALUATIONS_TAGS.JUDGES],
|
|
45747
|
+
}),
|
|
45748
|
+
listEvalScores: builder.query({
|
|
45749
|
+
query: ({ org, userId, page, limit, dataset_run_id, trace_id, name }) => ({
|
|
45750
|
+
url: EVALUATIONS_ENDPOINTS.LIST_SCORES.path(org, userId),
|
|
45751
|
+
service: EVALUATIONS_ENDPOINTS.LIST_SCORES.service,
|
|
45752
|
+
params: { page, limit, dataset_run_id, trace_id, name },
|
|
45753
|
+
}),
|
|
45754
|
+
providesTags: [EVALUATIONS_TAGS.SCORES],
|
|
45755
|
+
}),
|
|
45756
|
+
// Score create/delete deliberately do NOT invalidate the RUN tag: the
|
|
45757
|
+
// eval store ingests score writes asynchronously, so an immediate
|
|
45758
|
+
// refetch returns the run *without* the change and would clobber the
|
|
45759
|
+
// cache patches below. The run still refreshes on reopen / manual
|
|
45760
|
+
// Refresh, by which point the store has caught up.
|
|
45761
|
+
createEvalScore: builder.mutation({
|
|
45762
|
+
query: ({ org, userId, body }) => ({
|
|
45763
|
+
url: EVALUATIONS_ENDPOINTS.CREATE_SCORE.path(org, userId),
|
|
45764
|
+
service: EVALUATIONS_ENDPOINTS.CREATE_SCORE.service,
|
|
45765
|
+
method: 'POST',
|
|
45766
|
+
body,
|
|
45767
|
+
}),
|
|
45768
|
+
invalidatesTags: [EVALUATIONS_TAGS.SCORES],
|
|
45769
|
+
async onQueryStarted({ org, userId, body, datasetName, runName }, { dispatch, queryFulfilled }) {
|
|
45770
|
+
try {
|
|
45771
|
+
await queryFulfilled;
|
|
45772
|
+
}
|
|
45773
|
+
catch (_a) {
|
|
45774
|
+
return;
|
|
45775
|
+
}
|
|
45776
|
+
if (!datasetName || !runName)
|
|
45777
|
+
return;
|
|
45778
|
+
dispatch(evaluationsApiSlice.util.updateQueryData('getEvalRun', { org, userId, datasetName, runName }, (draft) => {
|
|
45779
|
+
var _a, _b, _c, _d, _e, _f;
|
|
45780
|
+
const item = (_a = draft.dataset_run_items) === null || _a === void 0 ? void 0 : _a.find((i) => i.trace_id === body.trace_id);
|
|
45781
|
+
if (!item)
|
|
45782
|
+
return;
|
|
45783
|
+
item.scores = (_b = item.scores) !== null && _b !== void 0 ? _b : [];
|
|
45784
|
+
item.scores.push({
|
|
45785
|
+
// The create endpoint returns no id (the write is queued);
|
|
45786
|
+
// this placeholder is replaced by the real record on the
|
|
45787
|
+
// next refetch once the store has ingested it.
|
|
45788
|
+
id: `pending-${body.trace_id}-${body.name}-${Date.now()}`,
|
|
45789
|
+
name: body.name,
|
|
45790
|
+
value: body.value,
|
|
45791
|
+
string_value: null,
|
|
45792
|
+
data_type: (_c = body.data_type) !== null && _c !== void 0 ? _c : 'NUMERIC',
|
|
45793
|
+
comment: (_d = body.comment) !== null && _d !== void 0 ? _d : null,
|
|
45794
|
+
trace_id: body.trace_id,
|
|
45795
|
+
observation_id: (_e = body.observation_id) !== null && _e !== void 0 ? _e : null,
|
|
45796
|
+
dataset_run_id: (_f = body.dataset_run_id) !== null && _f !== void 0 ? _f : null,
|
|
45797
|
+
created_at: new Date().toISOString(),
|
|
45798
|
+
});
|
|
45799
|
+
}));
|
|
45800
|
+
},
|
|
45801
|
+
}),
|
|
45802
|
+
deleteEvalScore: builder.mutation({
|
|
45803
|
+
query: ({ org, userId, scoreId }) => ({
|
|
45804
|
+
url: EVALUATIONS_ENDPOINTS.DELETE_SCORE.path(org, userId, scoreId),
|
|
45805
|
+
service: EVALUATIONS_ENDPOINTS.DELETE_SCORE.service,
|
|
45806
|
+
method: 'DELETE',
|
|
45807
|
+
}),
|
|
45808
|
+
invalidatesTags: [EVALUATIONS_TAGS.SCORES],
|
|
45809
|
+
async onQueryStarted({ org, userId, scoreId, datasetName, runName }, { dispatch, queryFulfilled }) {
|
|
45810
|
+
try {
|
|
45811
|
+
await queryFulfilled;
|
|
45812
|
+
}
|
|
45813
|
+
catch (_a) {
|
|
45814
|
+
return;
|
|
45815
|
+
}
|
|
45816
|
+
if (!datasetName || !runName)
|
|
45817
|
+
return;
|
|
45818
|
+
dispatch(evaluationsApiSlice.util.updateQueryData('getEvalRun', { org, userId, datasetName, runName }, (draft) => {
|
|
45819
|
+
var _a, _b;
|
|
45820
|
+
for (const item of (_a = draft.dataset_run_items) !== null && _a !== void 0 ? _a : []) {
|
|
45821
|
+
if ((_b = item.scores) === null || _b === void 0 ? void 0 : _b.some((s) => s.id === scoreId)) {
|
|
45822
|
+
item.scores = item.scores.filter((s) => s.id !== scoreId);
|
|
45823
|
+
}
|
|
45824
|
+
}
|
|
45825
|
+
}));
|
|
45826
|
+
},
|
|
45827
|
+
}),
|
|
45828
|
+
listEvalScoreConfigs: builder.query({
|
|
45829
|
+
query: ({ org, userId, page, limit }) => ({
|
|
45830
|
+
url: EVALUATIONS_ENDPOINTS.LIST_SCORE_CONFIGS.path(org, userId),
|
|
45831
|
+
service: EVALUATIONS_ENDPOINTS.LIST_SCORE_CONFIGS.service,
|
|
45832
|
+
params: { page, limit },
|
|
45833
|
+
}),
|
|
45834
|
+
providesTags: [EVALUATIONS_TAGS.SCORE_CONFIGS],
|
|
45835
|
+
}),
|
|
45836
|
+
getEvalTaskStatus: builder.query({
|
|
45837
|
+
query: ({ org, userId, taskId }) => ({
|
|
45838
|
+
url: EVALUATIONS_ENDPOINTS.GET_TASK.path(org, userId, taskId),
|
|
45839
|
+
service: EVALUATIONS_ENDPOINTS.GET_TASK.service,
|
|
45840
|
+
}),
|
|
45841
|
+
}),
|
|
45842
|
+
createEvalScoreConfig: builder.mutation({
|
|
45843
|
+
query: ({ org, userId, body }) => ({
|
|
45844
|
+
url: EVALUATIONS_ENDPOINTS.CREATE_SCORE_CONFIG.path(org, userId),
|
|
45845
|
+
service: EVALUATIONS_ENDPOINTS.CREATE_SCORE_CONFIG.service,
|
|
45846
|
+
method: 'POST',
|
|
45847
|
+
body,
|
|
45848
|
+
}),
|
|
45849
|
+
invalidatesTags: [EVALUATIONS_TAGS.SCORE_CONFIGS],
|
|
45850
|
+
}),
|
|
45851
|
+
}),
|
|
45852
|
+
});
|
|
45853
|
+
const { useListEvalDatasetsQuery, useLazyListEvalDatasetsQuery, useCreateEvalDatasetMutation, useGetEvalDatasetQuery, useListEvalDatasetItemsQuery, useLazyListEvalDatasetItemsQuery, useAddEvalDatasetItemsMutation, useUploadEvalDatasetCsvMutation, useUpdateEvalDatasetItemMutation, useDeleteEvalDatasetItemMutation, useListEvalRunsQuery, useLazyListEvalRunsQuery, useStartEvalRunMutation, useGetEvalRunQuery, useLazyGetEvalRunQuery, useDeleteEvalRunMutation, useExportEvalRunMutation, useEvaluateEvalRunMutation, useListEvalRunJudgesQuery, useLazyListEvalRunJudgesQuery, useListEvalJudgesQuery, useLazyListEvalJudgesQuery, useListEvalScoresQuery, useLazyListEvalScoresQuery, useCreateEvalScoreMutation, useDeleteEvalScoreMutation, useListEvalScoreConfigsQuery, useCreateEvalScoreConfigMutation, useGetEvalTaskStatusQuery, useLazyGetEvalTaskStatusQuery, } = evaluationsApiSlice;
|
|
45854
|
+
|
|
45855
|
+
/** Total page count derived from `count` and the requested page size. */
|
|
45856
|
+
function evalTotalPages(count, limit) {
|
|
45857
|
+
if (!count || count <= 0)
|
|
45858
|
+
return 0;
|
|
45859
|
+
return Math.ceil(count / limit);
|
|
45860
|
+
}
|
|
45861
|
+
|
|
45477
45862
|
const WATCHED_GROUPS_REDUCER_PATH = 'watchedGroupsApiSlice';
|
|
45478
45863
|
const WATCHED_GROUPS_QUERY_KEYS = {
|
|
45479
45864
|
WATCHED_GROUPS: 'WATCHED_GROUPS',
|
|
@@ -45786,6 +46171,7 @@ const mentorReducer = {
|
|
|
45786
46171
|
[courseMetadataApiSlice.reducerPath]: courseMetadataApiSlice.reducer,
|
|
45787
46172
|
[edxSsoApiSlice.reducerPath]: edxSsoApiSlice.reducer,
|
|
45788
46173
|
[clawApiSlice.reducerPath]: clawApiSlice.reducer,
|
|
46174
|
+
[evaluationsApiSlice.reducerPath]: evaluationsApiSlice.reducer,
|
|
45789
46175
|
[watchedGroupsApiSlice.reducerPath]: watchedGroupsApiSlice.reducer,
|
|
45790
46176
|
[chatPrivacyApiSlice.reducerPath]: chatPrivacyApiSlice.reducer,
|
|
45791
46177
|
[skillsApiSlice.reducerPath]: skillsApiSlice.reducer,
|
|
@@ -45842,6 +46228,7 @@ const mentorMiddleware = [
|
|
|
45842
46228
|
courseMetadataApiSlice.middleware,
|
|
45843
46229
|
edxSsoApiSlice.middleware,
|
|
45844
46230
|
clawApiSlice.middleware,
|
|
46231
|
+
evaluationsApiSlice.middleware,
|
|
45845
46232
|
watchedGroupsApiSlice.middleware,
|
|
45846
46233
|
chatPrivacyApiSlice.middleware,
|
|
45847
46234
|
skillsApiSlice.middleware,
|
|
@@ -45970,6 +46357,9 @@ exports.DISCLAIMERS_ENDPOINTS = DISCLAIMERS_ENDPOINTS;
|
|
|
45970
46357
|
exports.DISCLAIMERS_QUERY_KEYS = DISCLAIMERS_QUERY_KEYS;
|
|
45971
46358
|
exports.DISCLAIMERS_REDUCER_PATH = DISCLAIMERS_REDUCER_PATH;
|
|
45972
46359
|
exports.EDX_PROCTORING_ENDPOINTS = EDX_PROCTORING_ENDPOINTS;
|
|
46360
|
+
exports.EVALUATIONS_ENDPOINTS = EVALUATIONS_ENDPOINTS;
|
|
46361
|
+
exports.EVALUATIONS_REDUCER_PATH = EVALUATIONS_REDUCER_PATH;
|
|
46362
|
+
exports.EVALUATIONS_TAGS = EVALUATIONS_TAGS;
|
|
45973
46363
|
exports.IblDataLayer = IblDataLayer;
|
|
45974
46364
|
exports.LOGO_ENDPOINTS = LOGO_ENDPOINTS;
|
|
45975
46365
|
exports.MCP_ENDPOINTS = MCP_ENDPOINTS;
|
|
@@ -46051,6 +46441,8 @@ exports.datasetsApiSlice = datasetsApiSlice;
|
|
|
46051
46441
|
exports.disclaimersApiSlice = disclaimersApiSlice;
|
|
46052
46442
|
exports.edxProctoringApiSlice = edxProctoringApiSlice;
|
|
46053
46443
|
exports.edxSsoApiSlice = edxSsoApiSlice;
|
|
46444
|
+
exports.evalTotalPages = evalTotalPages;
|
|
46445
|
+
exports.evaluationsApiSlice = evaluationsApiSlice;
|
|
46054
46446
|
exports.fakeBaseQueryWithLogging = fakeBaseQueryWithLogging;
|
|
46055
46447
|
exports.featureTags = featureTags;
|
|
46056
46448
|
exports.getNextRecentMessagesPageParam = getNextRecentMessagesPageParam;
|
|
@@ -46093,6 +46485,7 @@ exports.tenantLogoApiSlice = tenantLogoApiSlice;
|
|
|
46093
46485
|
exports.toolsApiSlice = toolsApiSlice;
|
|
46094
46486
|
exports.trainingDocumentsApiSlice = trainingDocumentsApiSlice;
|
|
46095
46487
|
exports.useActivateWorkflowMutation = useActivateWorkflowMutation;
|
|
46488
|
+
exports.useAddEvalDatasetItemsMutation = useAddEvalDatasetItemsMutation;
|
|
46096
46489
|
exports.useAddPinnedMessageMutation = useAddPinnedMessageMutation;
|
|
46097
46490
|
exports.useAddTrainingDocumentMutation = useAddTrainingDocumentMutation;
|
|
46098
46491
|
exports.useAddWatchedUserMutation = useAddWatchedUserMutation;
|
|
@@ -46129,6 +46522,9 @@ exports.useCreateCredentialAssertionMutation = useCreateCredentialAssertionMutat
|
|
|
46129
46522
|
exports.useCreateCredentialMutation = useCreateCredentialMutation;
|
|
46130
46523
|
exports.useCreateCustomDomainMutation = useCreateCustomDomainMutation;
|
|
46131
46524
|
exports.useCreateDisclaimerMutation = useCreateDisclaimerMutation;
|
|
46525
|
+
exports.useCreateEvalDatasetMutation = useCreateEvalDatasetMutation;
|
|
46526
|
+
exports.useCreateEvalScoreConfigMutation = useCreateEvalScoreConfigMutation;
|
|
46527
|
+
exports.useCreateEvalScoreMutation = useCreateEvalScoreMutation;
|
|
46132
46528
|
exports.useCreateExternalMappingMutation = useCreateExternalMappingMutation;
|
|
46133
46529
|
exports.useCreateGlobalMemoryMutation = useCreateGlobalMemoryMutation;
|
|
46134
46530
|
exports.useCreateGuestCheckoutMutation = useCreateGuestCheckoutMutation;
|
|
@@ -46184,6 +46580,9 @@ exports.useDeleteCourseCredentialMutation = useDeleteCourseCredentialMutation;
|
|
|
46184
46580
|
exports.useDeleteCredentialMutation = useDeleteCredentialMutation;
|
|
46185
46581
|
exports.useDeleteCustomDomainMutation = useDeleteCustomDomainMutation;
|
|
46186
46582
|
exports.useDeleteDisclaimerMutation = useDeleteDisclaimerMutation;
|
|
46583
|
+
exports.useDeleteEvalDatasetItemMutation = useDeleteEvalDatasetItemMutation;
|
|
46584
|
+
exports.useDeleteEvalRunMutation = useDeleteEvalRunMutation;
|
|
46585
|
+
exports.useDeleteEvalScoreMutation = useDeleteEvalScoreMutation;
|
|
46187
46586
|
exports.useDeleteExternalMappingMutation = useDeleteExternalMappingMutation;
|
|
46188
46587
|
exports.useDeleteGlobalMemoryMutation = useDeleteGlobalMemoryMutation;
|
|
46189
46588
|
exports.useDeleteIntegrationCredentialMutation = useDeleteIntegrationCredentialMutation;
|
|
@@ -46223,8 +46622,10 @@ exports.useEditMentorMutation = useEditMentorMutation;
|
|
|
46223
46622
|
exports.useEditSessionMutation = useEditSessionMutation;
|
|
46224
46623
|
exports.useEditTrainingDocumentMutation = useEditTrainingDocumentMutation;
|
|
46225
46624
|
exports.useEnablePaywallMutation = useEnablePaywallMutation;
|
|
46625
|
+
exports.useEvaluateEvalRunMutation = useEvaluateEvalRunMutation;
|
|
46226
46626
|
exports.useExchangeAppleTokenMutation = useExchangeAppleTokenMutation;
|
|
46227
46627
|
exports.useExportChatHistoryMutation = useExportChatHistoryMutation;
|
|
46628
|
+
exports.useExportEvalRunMutation = useExportEvalRunMutation;
|
|
46228
46629
|
exports.useForkMentorMutation = useForkMentorMutation;
|
|
46229
46630
|
exports.useGetAccessTimeHeatmapQuery = useGetAccessTimeHeatmapQuery;
|
|
46230
46631
|
exports.useGetAccountBillingInfoQuery = useGetAccountBillingInfoQuery;
|
|
@@ -46281,6 +46682,9 @@ exports.useGetDetailedFinancialStatsQuery = useGetDetailedFinancialStatsQuery;
|
|
|
46281
46682
|
exports.useGetDisclaimersQuery = useGetDisclaimersQuery;
|
|
46282
46683
|
exports.useGetEdxSSOTokenQuery = useGetEdxSSOTokenQuery;
|
|
46283
46684
|
exports.useGetEnrollmentCourseSearchQuery = useGetEnrollmentCourseSearchQuery;
|
|
46685
|
+
exports.useGetEvalDatasetQuery = useGetEvalDatasetQuery;
|
|
46686
|
+
exports.useGetEvalRunQuery = useGetEvalRunQuery;
|
|
46687
|
+
exports.useGetEvalTaskStatusQuery = useGetEvalTaskStatusQuery;
|
|
46284
46688
|
exports.useGetExamInfoQuery = useGetExamInfoQuery;
|
|
46285
46689
|
exports.useGetExternalMappingQuery = useGetExternalMappingQuery;
|
|
46286
46690
|
exports.useGetFileUploadUrlMutation = useGetFileUploadUrlMutation;
|
|
@@ -46500,6 +46904,8 @@ exports.useLazyGetDisclaimersQuery = useLazyGetDisclaimersQuery;
|
|
|
46500
46904
|
exports.useLazyGetDownloadReportFromURLQuery = useLazyGetDownloadReportFromURLQuery;
|
|
46501
46905
|
exports.useLazyGetEdxSSOTokenQuery = useLazyGetEdxSSOTokenQuery;
|
|
46502
46906
|
exports.useLazyGetEnrollmentCourseSearchQuery = useLazyGetEnrollmentCourseSearchQuery;
|
|
46907
|
+
exports.useLazyGetEvalRunQuery = useLazyGetEvalRunQuery;
|
|
46908
|
+
exports.useLazyGetEvalTaskStatusQuery = useLazyGetEvalTaskStatusQuery;
|
|
46503
46909
|
exports.useLazyGetExamInfoQuery = useLazyGetExamInfoQuery;
|
|
46504
46910
|
exports.useLazyGetExternalMappingQuery = useLazyGetExternalMappingQuery;
|
|
46505
46911
|
exports.useLazyGetFreeUsageCountQuery = useLazyGetFreeUsageCountQuery;
|
|
@@ -46625,6 +47031,12 @@ exports.useLazyGetWorkflowQuery = useLazyGetWorkflowQuery;
|
|
|
46625
47031
|
exports.useLazyGetWorkflowsQuery = useLazyGetWorkflowsQuery;
|
|
46626
47032
|
exports.useLazyListArtifactVersionsQuery = useLazyListArtifactVersionsQuery;
|
|
46627
47033
|
exports.useLazyListArtifactsQuery = useLazyListArtifactsQuery;
|
|
47034
|
+
exports.useLazyListEvalDatasetItemsQuery = useLazyListEvalDatasetItemsQuery;
|
|
47035
|
+
exports.useLazyListEvalDatasetsQuery = useLazyListEvalDatasetsQuery;
|
|
47036
|
+
exports.useLazyListEvalJudgesQuery = useLazyListEvalJudgesQuery;
|
|
47037
|
+
exports.useLazyListEvalRunJudgesQuery = useLazyListEvalRunJudgesQuery;
|
|
47038
|
+
exports.useLazyListEvalRunsQuery = useLazyListEvalRunsQuery;
|
|
47039
|
+
exports.useLazyListEvalScoresQuery = useLazyListEvalScoresQuery;
|
|
46628
47040
|
exports.useLazyListItemSubscribersQuery = useLazyListItemSubscribersQuery;
|
|
46629
47041
|
exports.useLazyListPaywallsQuery = useLazyListPaywallsQuery;
|
|
46630
47042
|
exports.useLazyListPricesQuery = useLazyListPricesQuery;
|
|
@@ -46637,6 +47049,13 @@ exports.useLazyStarredMentorsQuery = useLazyStarredMentorsQuery;
|
|
|
46637
47049
|
exports.useLazyStartOAuthFlowQuery = useLazyStartOAuthFlowQuery;
|
|
46638
47050
|
exports.useListArtifactVersionsQuery = useListArtifactVersionsQuery;
|
|
46639
47051
|
exports.useListArtifactsQuery = useListArtifactsQuery;
|
|
47052
|
+
exports.useListEvalDatasetItemsQuery = useListEvalDatasetItemsQuery;
|
|
47053
|
+
exports.useListEvalDatasetsQuery = useListEvalDatasetsQuery;
|
|
47054
|
+
exports.useListEvalJudgesQuery = useListEvalJudgesQuery;
|
|
47055
|
+
exports.useListEvalRunJudgesQuery = useListEvalRunJudgesQuery;
|
|
47056
|
+
exports.useListEvalRunsQuery = useListEvalRunsQuery;
|
|
47057
|
+
exports.useListEvalScoreConfigsQuery = useListEvalScoreConfigsQuery;
|
|
47058
|
+
exports.useListEvalScoresQuery = useListEvalScoresQuery;
|
|
46640
47059
|
exports.useListItemSubscribersQuery = useListItemSubscribersQuery;
|
|
46641
47060
|
exports.useListPaywallsQuery = useListPaywallsQuery;
|
|
46642
47061
|
exports.useListPricesQuery = useListPricesQuery;
|
|
@@ -46667,6 +47086,7 @@ exports.useSetPlatformConfigurationsMutation = useSetPlatformConfigurationsMutat
|
|
|
46667
47086
|
exports.useSetStudentMentorCreationStatusMutation = useSetStudentMentorCreationStatusMutation;
|
|
46668
47087
|
exports.useStarMentorMutation = useStarMentorMutation;
|
|
46669
47088
|
exports.useStarredMentorsQuery = useStarredMentorsQuery;
|
|
47089
|
+
exports.useStartEvalRunMutation = useStartEvalRunMutation;
|
|
46670
47090
|
exports.useStartExamMutation = useStartExamMutation;
|
|
46671
47091
|
exports.useStartStripeConnectOnboardingMutation = useStartStripeConnectOnboardingMutation;
|
|
46672
47092
|
exports.useTestConnectivityClawInstanceMutation = useTestConnectivityClawInstanceMutation;
|
|
@@ -46689,6 +47109,7 @@ exports.useUpdateClawInstanceMutation = useUpdateClawInstanceMutation;
|
|
|
46689
47109
|
exports.useUpdateClawMentorConfigMutation = useUpdateClawMentorConfigMutation;
|
|
46690
47110
|
exports.useUpdateCredentialMutation = useUpdateCredentialMutation;
|
|
46691
47111
|
exports.useUpdateDisclaimerMutation = useUpdateDisclaimerMutation;
|
|
47112
|
+
exports.useUpdateEvalDatasetItemMutation = useUpdateEvalDatasetItemMutation;
|
|
46692
47113
|
exports.useUpdateExamAttemptMutation = useUpdateExamAttemptMutation;
|
|
46693
47114
|
exports.useUpdateIntegrationCredentialMutation = useUpdateIntegrationCredentialMutation;
|
|
46694
47115
|
exports.useUpdateLtiKeyMutation = useUpdateLtiKeyMutation;
|
|
@@ -46737,6 +47158,7 @@ exports.useUpdateWatcherMutation = useUpdateWatcherMutation;
|
|
|
46737
47158
|
exports.useUpdateWorkflowMutation = useUpdateWorkflowMutation;
|
|
46738
47159
|
exports.useUploadCredentialImageMutation = useUploadCredentialImageMutation;
|
|
46739
47160
|
exports.useUploadDarkLogoMutation = useUploadDarkLogoMutation;
|
|
47161
|
+
exports.useUploadEvalDatasetCsvMutation = useUploadEvalDatasetCsvMutation;
|
|
46740
47162
|
exports.useUploadLightLogoMutation = useUploadLightLogoMutation;
|
|
46741
47163
|
exports.useUploadProfileImageMutation = useUploadProfileImageMutation;
|
|
46742
47164
|
exports.useUsersGradesPassedQuery = useUsersGradesPassedQuery;
|