File size: 761 Bytes
1244914
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
export type Task = {
  before_run: Array<string>;
  run: string | Array<string>;
  parallelism?: number;
  timeout?: number;
  early_exit?: boolean;
  validations?: Array<Validation>;
  sources: Array<Source>;
};

export type Validation = 
  | {
      name: string;
      type: "regex";
      regex: string;
    }
  | {
      name: string;
      type: "shell";
      command: string;
      exit_code?: number;
    }
  | {
      name: string;
      type: "llm";
      evaluator: string;
      criteria: Record<string, any>;
    };

export type Source = { csv: string } | { cmd: string } | { value: Record<string, string>[] };


export enum TaskStatus {
  Passed = "passed",
  ValidationFailed = "validation_failed",
  Timeout = "timeout",
  Failed = "failed",
}