@bodhiapp/reference-api-types 0.0.4 → 0.0.5
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/index.d.ts +12 -7
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -12,10 +12,8 @@ export type ModelType = 'gguf';
|
|
|
12
12
|
export type ModelSource = 'huggingface';
|
|
13
13
|
/** Derived specialisation tags that are filterable in v1. */
|
|
14
14
|
export type Specialisation = 'coding' | 'reasoning' | 'vision';
|
|
15
|
-
/** Sort keys for the list endpoint. */
|
|
15
|
+
/** Sort keys for the list endpoint. Always sorted descending (HuggingFace supports descending only). */
|
|
16
16
|
export type SortKey = 'downloads' | 'likes' | 'last_modified' | 'created_at' | 'trending';
|
|
17
|
-
/** Sort direction. */
|
|
18
|
-
export type SortOrder = 'asc' | 'desc';
|
|
19
17
|
/** One quantization variant of a model (single-model response only). */
|
|
20
18
|
export interface Quant {
|
|
21
19
|
name: string;
|
|
@@ -110,10 +108,8 @@ export interface ListModelsQuery {
|
|
|
110
108
|
tag?: string | string[];
|
|
111
109
|
/** Repeatable; AND. Catalog-wide. */
|
|
112
110
|
specialisation?: Specialisation | Specialisation[];
|
|
113
|
-
/** Default "downloads". */
|
|
111
|
+
/** Default "downloads". Always sorted descending (HuggingFace supports descending only). */
|
|
114
112
|
sort?: SortKey;
|
|
115
|
-
/** Default "desc". */
|
|
116
|
-
order?: SortOrder;
|
|
117
113
|
/** Min params (billions). Page-local filter. */
|
|
118
114
|
params_min?: number;
|
|
119
115
|
/** Max params (billions). Page-local filter. */
|
|
@@ -138,9 +134,18 @@ export interface GetModelQuery {
|
|
|
138
134
|
}
|
|
139
135
|
/** Response of the single-model endpoint: a Model with its `quants` table populated. */
|
|
140
136
|
export type GetModelResponse = Model;
|
|
141
|
-
export type ErrorCode = 'validation' | 'unauthorized' | 'not_found' | 'unsupported_source' | 'unsupported_type' | 'internal';
|
|
137
|
+
export type ErrorCode = 'validation' | 'unauthorized' | 'not_found' | 'unsupported_source' | 'unsupported_type' | 'upstream' | 'internal';
|
|
142
138
|
/** Error envelope returned on non-2xx responses. */
|
|
143
139
|
export interface ErrorResponse {
|
|
144
140
|
error: ErrorCode | string;
|
|
145
141
|
message?: string;
|
|
146
142
|
}
|
|
143
|
+
/**
|
|
144
|
+
* Error envelope when an upstream (HuggingFace) call fails: the upstream status and raw body are
|
|
145
|
+
* forwarded verbatim. Returned with the upstream HTTP status as the response status.
|
|
146
|
+
*/
|
|
147
|
+
export interface UpstreamErrorResponse {
|
|
148
|
+
error: 'upstream';
|
|
149
|
+
status: number;
|
|
150
|
+
body: unknown;
|
|
151
|
+
}
|
package/package.json
CHANGED