@sanity/ailf 0.1.22 → 0.1.24
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.
|
@@ -99,6 +99,8 @@ export async function buildRemoteRequest(options) {
|
|
|
99
99
|
raw.readiness = true;
|
|
100
100
|
if (config.discoveryReportEnabled)
|
|
101
101
|
raw.discoveryReport = true;
|
|
102
|
+
if (config.noRemoteCache)
|
|
103
|
+
raw.noRemoteCache = true;
|
|
102
104
|
// 4. Validate the assembled request
|
|
103
105
|
const parsed = PipelineRequestSchema.parse(raw);
|
|
104
106
|
return { request: parsed, taskCount: tasks.length };
|
|
@@ -47,7 +47,14 @@ export class RunEvalStep {
|
|
|
47
47
|
}
|
|
48
48
|
: undefined;
|
|
49
49
|
const tasks = await ctx.taskSource.loadTasks(filter);
|
|
50
|
-
|
|
50
|
+
// Only check context files for tasks that have canonical docs.
|
|
51
|
+
// Tasks without canonical docs are skipped by FetchDocsStep (they
|
|
52
|
+
// have no docs to fetch), so no context file is written for them.
|
|
53
|
+
// The generated Promptfoo config still includes their "without-docs"
|
|
54
|
+
// variant (testing model knowledge alone), which doesn't need a
|
|
55
|
+
// context file.
|
|
56
|
+
const tasksWithDocs = tasks.filter((t) => t.canonicalDocs.length > 0);
|
|
57
|
+
const taskIds = tasksWithDocs.map((t) => t.id);
|
|
51
58
|
const contextIssues = checkCanonicalContextsExist(rootDir, taskIds);
|
|
52
59
|
const contextErrors = contextIssues.filter((i) => i.severity === "error");
|
|
53
60
|
if (contextErrors.length > 0) {
|
|
@@ -198,8 +198,15 @@ export function expandTask(task, rubricConfig, mode = "baseline") {
|
|
|
198
198
|
/**
|
|
199
199
|
* Convert a TaskDefinition (from @sanity/ailf-core) to the local
|
|
200
200
|
* SingleTaskDefinition format used by expandTask().
|
|
201
|
+
*
|
|
202
|
+
* When a task has no canonical docs, the `docs` var is set to empty string
|
|
203
|
+
* instead of a file path. This prevents Promptfoo from trying to read a
|
|
204
|
+
* context file that was never created by FetchDocsStep (which skips tasks
|
|
205
|
+
* without canonical docs). The gold entry still runs — it just tests model
|
|
206
|
+
* knowledge alone, same as the baseline variant.
|
|
201
207
|
*/
|
|
202
208
|
function taskDefinitionToSingle(task) {
|
|
209
|
+
const hasDocs = task.canonicalDocs.length > 0;
|
|
203
210
|
return {
|
|
204
211
|
assert: task.assertions.map((a) => ({ ...a })),
|
|
205
212
|
baseline: task.baseline,
|
|
@@ -208,7 +215,7 @@ function taskDefinitionToSingle(task) {
|
|
|
208
215
|
featureArea: task.featureArea,
|
|
209
216
|
id: task.id,
|
|
210
217
|
vars: {
|
|
211
|
-
docs: `file://contexts/canonical/${task.id}.md
|
|
218
|
+
docs: hasDocs ? `file://contexts/canonical/${task.id}.md` : "",
|
|
212
219
|
task: task.taskPrompt,
|
|
213
220
|
...task.extraVars,
|
|
214
221
|
},
|