-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathModelService.ts
46 lines (43 loc) · 1.01 KB
/
ModelService.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
import { clientErrorWrapper } from '../utils/errors.js';
import { Options } from '../client.js';
import {
ModelServiceListInput,
ModelServiceListOutput,
ModelServiceRetrieveInput,
ModelServiceRetrieveOutput,
} from '../schema.js';
import { BaseService } from './BaseService.js';
export class ModelService extends BaseService {
async list(
input: ModelServiceListInput,
opts?: Options,
): Promise<ModelServiceListOutput> {
return await clientErrorWrapper(
this._client.GET('/v2/models', {
...opts,
params: {
query: {
...input,
version: '2023-11-22',
},
},
}),
);
}
async retrieve(
input: ModelServiceRetrieveInput,
opts?: Options,
): Promise<ModelServiceRetrieveOutput> {
return clientErrorWrapper(
this._client.GET('/v2/models/{id}', {
...opts,
params: {
path: input,
query: {
version: '2024-01-30',
},
},
}),
);
}
}