-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showed a table when there's only one eval running
- Loading branch information
1 parent
a5263dc
commit a85f7ee
Showing
8 changed files
with
190 additions
and
28 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 was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
packages/evalite-vitest/src/tests/fixtures/long-text/long-text.eval.ts
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,30 @@ | ||
import { evalite, Levenshtein } from "../../../index.js"; | ||
|
||
evalite("Long Text", { | ||
data: () => { | ||
return [ | ||
{ | ||
input: [ | ||
`Some extremely long text that will test the bounds of our system.`, | ||
`This is a test to see if we can handle long text inputs.`, | ||
`This is a test to see if we can handle long text inputs.`, | ||
`This is a test to see if we can handle long text inputs.`, | ||
`This is a test to see if we can handle long text inputs.`, | ||
`This is a test to see if we can handle long text inputs.`, | ||
].join("\n"), | ||
expected: [ | ||
`Some extremely long text that will test the bounds of our system.`, | ||
`This is a test to see if we can handle long text inputs.`, | ||
`This is a test to see if we can handle long text inputs.`, | ||
`This is a test to see if we can handle long text inputs.`, | ||
`This is a test to see if we can handle long text inputs.`, | ||
`This is a test to see if we can handle long text inputs.`, | ||
].join("\n"), | ||
}, | ||
]; | ||
}, | ||
task: (input) => { | ||
return input; | ||
}, | ||
scorers: [Levenshtein], | ||
}); |
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,21 @@ | ||
import { getJsonDbEvals } from "@evalite/core"; | ||
import { assert, expect, it } from "vitest"; | ||
import { runVitest } from "../command.js"; | ||
import { captureStdout, loadFixture } from "./test-utils.js"; | ||
|
||
it("Should report long text correctly", async () => { | ||
using fixture = loadFixture("long-text"); | ||
|
||
const captured = captureStdout(); | ||
|
||
await runVitest({ | ||
cwd: fixture.dir, | ||
path: undefined, | ||
testOutputWritable: captured.writable, | ||
}); | ||
|
||
expect(captured.getOutput()).toContain("Input"); | ||
expect(captured.getOutput()).toContain("Output"); | ||
expect(captured.getOutput()).toContain("Score"); | ||
expect(captured.getOutput()).toContain("Some extremely long text"); | ||
}); |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.