-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: batch evaluations backend #2
This commit implements the full cycle of a batch evaluation. Now users can run batch evaluations on top of their prompts with dataset data.
- Loading branch information
Showing
48 changed files
with
982 additions
and
332 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...sions/[commitUuid]/documents/[documentUuid]/evaluations/dashboard/_components/Actions.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
'use client' | ||
|
||
import { Button, TableWithHeader } from '@latitude-data/web-ui' | ||
import { runBatchEvaluationAction } from '$/actions/evaluations/runBatch' | ||
import useLatitudeAction from '$/hooks/useLatitudeAction' | ||
import { ROUTES } from '$/services/routes' | ||
import Link from 'next/link' | ||
|
||
export function Actions({ | ||
projectId, | ||
commitUuid, | ||
documentUuid, | ||
}: { | ||
projectId: string | ||
commitUuid: string | ||
documentUuid: string | ||
}) { | ||
const href = ROUTES.projects | ||
.detail({ id: Number(projectId) }) | ||
.commits.detail({ uuid: commitUuid }) | ||
.documents.detail({ uuid: documentUuid }).evaluations.dashboard.connect.root | ||
const { execute: executeBatchEvaluation } = useLatitudeAction( | ||
runBatchEvaluationAction, | ||
) | ||
|
||
return ( | ||
<> | ||
<Link href={href}> | ||
<TableWithHeader.Button>Connect evaluation</TableWithHeader.Button> | ||
</Link> | ||
<Button | ||
fancy | ||
onClick={() => | ||
executeBatchEvaluation({ | ||
projectId: Number(projectId), | ||
commitUuid, | ||
documentUuid, | ||
evaluationIds: [1], | ||
datasetId: 1, | ||
parameters: { | ||
nombre_usuario: 0, | ||
nombre: 2, | ||
}, | ||
}) | ||
} | ||
> | ||
Execute batch evaluation | ||
</Button> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
apps/web/src/app/(private)/projects/[projectId]/versions/[commitUuid]/layout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
'use server' | ||
|
||
import { ReactNode } from 'react' | ||
|
||
import { | ||
|
7 changes: 7 additions & 0 deletions
7
packages/core/public/uploads/workspaces/1/datasets/batchtest.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Username, Identifier,First name,Last name | ||
booker12,9012,Rachel,Booker | ||
grey07,2070,Laura,Grey | ||
johnson81,4081,Craig,Johnson | ||
jenkins46,9346,Mary,Jenkins | ||
smith79,5079,Jamie,Smith | ||
|
Oops, something went wrong.