Skip to content

Commit 2fc4352

Browse files
committed
refactor: remove unused dependencies and update test ID generation method
1 parent cdb99a1 commit 2fc4352

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

package-lock.json

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@
55
"license": "MIT",
66
"description": "PromptPex is a test generator for prompts, that allows evaluating and comparing AI prompts across different models and configurations.",
77
"dependencies": {
8-
"genaiscript": "^2.3.13",
9-
"nanoid": "^5.1.5",
10-
"openai": "^5.11.0"
8+
"genaiscript": "^2.3.13"
119
},
1210
"devDependencies": {
1311
"@types/node": "^24.2.0",
12+
"openai": "^5.11.0",
1413
"prettier": "^3.6.2",
1514
"zx": "^8.7.2"
1615
},

src/genaisrc/src/promptpex.mts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,14 @@ import { runTests } from "./testrun.mts"
1919
import { evaluateTestMetrics } from "./testevalmetric.mts"
2020
import type { PromptPexContext, PromptPexTestResult } from "./types.mts"
2121
import {
22-
MODEL_ALIAS_GROUNDTRUTH,
2322
MODEL_ALIAS_RULES,
2423
MODEL_ALIAS_STORE,
2524
PROMPTPEX_CONTEXT,
2625
} from "./constants.mts"
2726
import { evalTestCollection } from "./testcollectioneval.mts"
2827
import { githubModelsEvalsGenerate } from "./githubmodels.mts"
29-
import { parse, resolve } from "node:path"
28+
import { resolve } from "node:path"
3029
import { saveContextState } from "./loaders.mts"
31-
import { nanoid } from 'nanoid'
3230

3331
const { output } = env
3432
const dbg = host.logger("promptpex")
@@ -192,7 +190,8 @@ export async function promptpexGenerate(files: PromptPexContext) {
192190
if (files.promptPexTests?.length) {
193191
for (const [index, test] of files.promptPexTests.entries()) {
194192
if (!test.testuid) {
195-
files.promptPexTests[index].testuid = `test-${nanoid(8)}`
193+
const id = Math.random().toString().slice(-8)
194+
files.promptPexTests[index].testuid = `test-${id}`
196195
}
197196
}
198197
}

0 commit comments

Comments
 (0)