@outputai/evals 0.11.0 → 0.11.1-next.2223fa5.0

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/judge.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import { EvaluationVerdictResult, EvaluationNumberResult, EvaluationBooleanResult, EvaluationStringResult, z } from '@outputai/core';
2
+ import { type PromptVariables } from '@outputai/llm';
2
3
  export type JudgeArgs = {
3
4
  prompt: string;
4
- variables?: Record<string, string | number | boolean>;
5
+ variables?: PromptVariables;
5
6
  schema?: z.ZodType;
6
7
  };
7
8
  export declare function judgeVerdict({ prompt, variables, schema }: JudgeArgs): Promise<EvaluationVerdictResult>;
package/dist/judge.js CHANGED
@@ -1,31 +1,31 @@
1
1
  import { EvaluationVerdictResult, EvaluationNumberResult, EvaluationBooleanResult, EvaluationStringResult, z } from '@outputai/core';
2
2
  import { Path } from '@outputai/core/sdk/helpers';
3
- import { generateText, Output } from '@outputai/llm';
3
+ import { generateText, aiSdk } from '@outputai/llm';
4
4
  const verdictSchema = z.object({ verdict: z.enum(['pass', 'partial', 'fail']), reasoning: z.string() });
5
5
  const scoreSchema = z.object({ score: z.number(), reasoning: z.string() });
6
6
  const booleanSchema = z.object({ result: z.boolean(), reasoning: z.string() });
7
7
  const labelSchema = z.object({ label: z.string(), reasoning: z.string() });
8
8
  export async function judgeVerdict({ prompt, variables, schema = verdictSchema }) {
9
9
  const promptDir = Path.resolveInvocationDir();
10
- const response = await generateText({ prompt, variables, promptDir, output: Output.object({ schema }) });
10
+ const response = await generateText({ prompt, variables, promptDir, output: aiSdk.Output.object({ schema }) });
11
11
  const result = response.output;
12
12
  return new EvaluationVerdictResult({ value: result.verdict, confidence: 0.9, reasoning: result.reasoning });
13
13
  }
14
14
  export async function judgeScore({ prompt, variables, schema = scoreSchema }) {
15
15
  const promptDir = Path.resolveInvocationDir();
16
- const response = await generateText({ prompt, variables, promptDir, output: Output.object({ schema }) });
16
+ const response = await generateText({ prompt, variables, promptDir, output: aiSdk.Output.object({ schema }) });
17
17
  const result = response.output;
18
18
  return new EvaluationNumberResult({ value: result.score, confidence: 0.9, reasoning: result.reasoning });
19
19
  }
20
20
  export async function judgeBoolean({ prompt, variables, schema = booleanSchema }) {
21
21
  const promptDir = Path.resolveInvocationDir();
22
- const response = await generateText({ prompt, variables, promptDir, output: Output.object({ schema }) });
22
+ const response = await generateText({ prompt, variables, promptDir, output: aiSdk.Output.object({ schema }) });
23
23
  const result = response.output;
24
24
  return new EvaluationBooleanResult({ value: result.result, confidence: 0.9, reasoning: result.reasoning });
25
25
  }
26
26
  export async function judgeLabel({ prompt, variables, schema = labelSchema }) {
27
27
  const promptDir = Path.resolveInvocationDir();
28
- const response = await generateText({ prompt, variables, promptDir, output: Output.object({ schema }) });
28
+ const response = await generateText({ prompt, variables, promptDir, output: aiSdk.Output.object({ schema }) });
29
29
  const result = response.output;
30
30
  return new EvaluationStringResult({ value: result.label, confidence: 0.9, reasoning: result.reasoning });
31
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@outputai/evals",
3
- "version": "0.11.0",
3
+ "version": "0.11.1-next.2223fa5.0",
4
4
  "description": "Offline evaluation framework for Output.ai workflows",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -19,8 +19,8 @@
19
19
  "./dist"
20
20
  ],
21
21
  "dependencies": {
22
- "@outputai/core": "0.11.0",
23
- "@outputai/llm": "0.11.0"
22
+ "@outputai/core": "0.11.1-next.2223fa5.0",
23
+ "@outputai/llm": "0.11.1-next.2223fa5.0"
24
24
  },
25
25
  "license": "Apache-2.0",
26
26
  "publishConfig": {