-
Notifications
You must be signed in to change notification settings - Fork 5
/
models.ts
88 lines (77 loc) · 2.52 KB
/
models.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../resource';
import { isRequestOptions } from '../core';
import * as Core from '../core';
import * as ModelsAPI from './models';
export class Models extends APIResource {
list(params?: ModelListParams, options?: Core.RequestOptions): Core.APIPromise<ModelServingSpec>;
list(options?: Core.RequestOptions): Core.APIPromise<ModelServingSpec>;
list(
params: ModelListParams | Core.RequestOptions = {},
options?: Core.RequestOptions,
): Core.APIPromise<ModelServingSpec> {
if (isRequestOptions(params)) {
return this.list({}, params);
}
const { 'X-LlamaStack-ProviderData': xLlamaStackProviderData } = params;
return this._client.get('/models/list', {
...options,
headers: {
...(xLlamaStackProviderData != null ?
{ 'X-LlamaStack-ProviderData': xLlamaStackProviderData }
: undefined),
...options?.headers,
},
});
}
get(params: ModelGetParams, options?: Core.RequestOptions): Core.APIPromise<ModelServingSpec | null> {
const { 'X-LlamaStack-ProviderData': xLlamaStackProviderData, ...query } = params;
return this._client.get('/models/get', {
query,
...options,
headers: {
...(xLlamaStackProviderData != null ?
{ 'X-LlamaStack-ProviderData': xLlamaStackProviderData }
: undefined),
...options?.headers,
},
});
}
}
export interface ModelServingSpec {
/**
* The model family and SKU of the model along with other parameters corresponding
* to the model.
*/
llama_model: unknown;
provider_config: ModelServingSpec.ProviderConfig;
}
export namespace ModelServingSpec {
export interface ProviderConfig {
config: Record<string, boolean | number | string | Array<unknown> | unknown | null>;
provider_id: string;
}
}
export interface ModelListParams {
/**
* JSON-encoded provider data which will be made available to the adapter servicing
* the API
*/
'X-LlamaStack-ProviderData'?: string;
}
export interface ModelGetParams {
/**
* Query param:
*/
core_model_id: string;
/**
* Header param: JSON-encoded provider data which will be made available to the
* adapter servicing the API
*/
'X-LlamaStack-ProviderData'?: string;
}
export namespace Models {
export import ModelServingSpec = ModelsAPI.ModelServingSpec;
export import ModelListParams = ModelsAPI.ModelListParams;
export import ModelGetParams = ModelsAPI.ModelGetParams;
}