-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy patheval-tasks.ts
53 lines (41 loc) · 1.47 KB
/
eval-tasks.ts
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../resource';
import * as Core from '../core';
import * as BenchmarksAPI from './benchmarks';
export class EvalTasks extends APIResource {
retrieve(
evalTaskId: string,
options?: Core.RequestOptions,
): Core.APIPromise<BenchmarksAPI.Benchmark | null> {
return this._client.get(`/v1/eval-tasks/${evalTaskId}`, options);
}
list(options?: Core.RequestOptions): Core.APIPromise<BenchmarksAPI.BenchmarkListResponse> {
return (
this._client.get('/v1/eval-tasks', options) as Core.APIPromise<{
data: BenchmarksAPI.BenchmarkListResponse;
}>
)._thenUnwrap((obj) => obj.data);
}
register(body: EvalTaskRegisterParams, options?: Core.RequestOptions): Core.APIPromise<void> {
return this._client.post('/v1/eval-tasks', {
body,
...options,
headers: { Accept: '*/*', ...options?.headers },
});
}
}
export type EvalTaskListResponse = Array<BenchmarksAPI.Benchmark>;
export interface EvalTaskRegisterParams {
dataset_id: string;
eval_task_id: string;
scoring_functions: Array<string>;
metadata?: Record<string, boolean | number | string | Array<unknown> | unknown | null>;
provider_benchmark_id?: string;
provider_id?: string;
}
export declare namespace EvalTasks {
export {
type EvalTaskListResponse as EvalTaskListResponse,
type EvalTaskRegisterParams as EvalTaskRegisterParams,
};
}