ogx-client 0.8.0 → 1.0.1
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/.github/workflows/release-doctor.yml +0 -2
- package/.release-please-manifest.json +1 -1
- package/.stats.yml +4 -4
- package/CHANGELOG.md +27 -0
- package/CONTRIBUTING.md +0 -14
- package/README.md +5 -4
- package/api.md +26 -48
- package/bin/check-release-environment +0 -4
- package/dist/CHANGELOG.md +27 -0
- package/dist/README.md +5 -4
- package/dist/index.d.mts +2 -18
- package/dist/index.d.ts +2 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -16
- package/dist/index.mjs.map +1 -1
- package/dist/package.json +1 -1
- package/dist/resources/chat/chat.d.ts +2 -2
- package/dist/resources/chat/chat.d.ts.map +1 -1
- package/dist/resources/chat/chat.js +2 -2
- package/dist/resources/chat/chat.js.map +1 -1
- package/dist/resources/chat/chat.mjs +2 -2
- package/dist/resources/chat/completions/completions.d.ts +2021 -0
- package/dist/resources/chat/completions/completions.d.ts.map +1 -0
- package/dist/resources/chat/completions/completions.js +70 -0
- package/dist/resources/chat/completions/completions.js.map +1 -0
- package/dist/resources/chat/completions/completions.mjs +43 -0
- package/dist/resources/chat/completions/completions.mjs.map +1 -0
- package/dist/resources/chat/completions/index.d.ts +3 -0
- package/dist/resources/chat/completions/index.d.ts.map +1 -0
- package/dist/resources/chat/completions/index.js +16 -0
- package/dist/resources/chat/completions/index.js.map +1 -0
- package/dist/resources/chat/completions/index.mjs +10 -0
- package/dist/resources/chat/completions/index.mjs.map +1 -0
- package/dist/resources/chat/completions/messages.d.ts +204 -0
- package/dist/resources/chat/completions/messages.d.ts.map +1 -0
- package/dist/resources/chat/completions/messages.js +35 -0
- package/dist/resources/chat/completions/messages.js.map +1 -0
- package/dist/resources/chat/completions/messages.mjs +30 -0
- package/dist/resources/chat/completions/messages.mjs.map +1 -0
- package/dist/resources/chat/completions.d.ts +1 -2020
- package/dist/resources/chat/completions.d.ts.map +1 -1
- package/dist/resources/chat/completions.js +15 -29
- package/dist/resources/chat/completions.js.map +1 -1
- package/dist/resources/chat/completions.mjs +1 -27
- package/dist/resources/chat/completions.mjs.map +1 -1
- package/dist/resources/chat/index.d.ts +1 -1
- package/dist/resources/chat/index.d.ts.map +1 -1
- package/dist/resources/chat/index.js +2 -2
- package/dist/resources/chat/index.js.map +1 -1
- package/dist/resources/chat/index.mjs +1 -1
- package/dist/resources/completions.d.ts +2 -2
- package/dist/resources/completions.d.ts.map +1 -1
- package/dist/resources/conversations/conversations.d.ts +12 -11
- package/dist/resources/conversations/conversations.d.ts.map +1 -1
- package/dist/resources/conversations/conversations.js.map +1 -1
- package/dist/resources/conversations/conversations.mjs.map +1 -1
- package/dist/resources/conversations/index.d.ts +1 -1
- package/dist/resources/conversations/index.d.ts.map +1 -1
- package/dist/resources/conversations/items.d.ts +49 -29
- package/dist/resources/conversations/items.d.ts.map +1 -1
- package/dist/resources/conversations/items.js +5 -5
- package/dist/resources/conversations/items.js.map +1 -1
- package/dist/resources/conversations/items.mjs +5 -5
- package/dist/resources/conversations/items.mjs.map +1 -1
- package/dist/resources/files.d.ts +10 -10
- package/dist/resources/files.d.ts.map +1 -1
- package/dist/resources/files.js.map +1 -1
- package/dist/resources/files.mjs.map +1 -1
- package/dist/resources/index.d.ts +1 -4
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/index.js +1 -7
- package/dist/resources/index.js.map +1 -1
- package/dist/resources/index.mjs +1 -4
- package/dist/resources/index.mjs.map +1 -1
- package/dist/resources/models/index.d.ts +2 -2
- package/dist/resources/models/index.d.ts.map +1 -1
- package/dist/resources/models/index.js.map +1 -1
- package/dist/resources/models/index.mjs +1 -1
- package/dist/resources/models/index.mjs.map +1 -1
- package/dist/resources/models/models.d.ts +220 -32
- package/dist/resources/models/models.d.ts.map +1 -1
- package/dist/resources/models/models.js +32 -10
- package/dist/resources/models/models.js.map +1 -1
- package/dist/resources/models/models.mjs +32 -10
- package/dist/resources/models/models.mjs.map +1 -1
- package/dist/resources/models/openai.d.ts +128 -2
- package/dist/resources/models/openai.d.ts.map +1 -1
- package/dist/resources/models/openai.js +17 -5
- package/dist/resources/models/openai.js.map +1 -1
- package/dist/resources/models/openai.mjs +17 -5
- package/dist/resources/models/openai.mjs.map +1 -1
- package/dist/resources/responses/responses.d.ts +0 -16
- package/dist/resources/responses/responses.d.ts.map +1 -1
- package/dist/resources/responses/responses.js.map +1 -1
- package/dist/resources/responses/responses.mjs.map +1 -1
- package/dist/resources/shared.d.ts +0 -19
- package/dist/resources/shared.d.ts.map +1 -1
- package/dist/src/index.ts +12 -43
- package/dist/src/resources/chat/chat.ts +2 -2
- package/dist/src/resources/chat/completions/completions.ts +2444 -0
- package/dist/src/resources/chat/completions/index.ts +24 -0
- package/dist/src/resources/chat/completions/messages.ts +273 -0
- package/dist/src/resources/chat/completions.ts +1 -2422
- package/dist/src/resources/chat/index.ts +1 -1
- package/dist/src/resources/completions.ts +2 -2
- package/dist/src/resources/conversations/conversations.ts +15 -9
- package/dist/src/resources/conversations/index.ts +1 -1
- package/dist/src/resources/conversations/items.ts +84 -28
- package/dist/src/resources/files.ts +29 -10
- package/dist/src/resources/index.ts +9 -10
- package/dist/src/resources/models/index.ts +10 -2
- package/dist/src/resources/models/models.ts +321 -32
- package/dist/src/resources/models/openai.ts +180 -3
- package/dist/src/resources/responses/responses.ts +0 -21
- package/dist/src/resources/shared.ts +0 -20
- package/dist/src/version.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.mjs +1 -1
- package/package.json +1 -1
- package/src/index.ts +12 -43
- package/src/resources/chat/chat.ts +2 -2
- package/src/resources/chat/completions/completions.ts +2444 -0
- package/src/resources/chat/completions/index.ts +24 -0
- package/src/resources/chat/completions/messages.ts +273 -0
- package/src/resources/chat/completions.ts +1 -2422
- package/src/resources/chat/index.ts +1 -1
- package/src/resources/completions.ts +2 -2
- package/src/resources/conversations/conversations.ts +15 -9
- package/src/resources/conversations/index.ts +1 -1
- package/src/resources/conversations/items.ts +84 -28
- package/src/resources/files.ts +29 -10
- package/src/resources/index.ts +9 -10
- package/src/resources/models/index.ts +10 -2
- package/src/resources/models/models.ts +321 -32
- package/src/resources/models/openai.ts +180 -3
- package/src/resources/responses/responses.ts +0 -21
- package/src/resources/shared.ts +0 -20
- package/src/version.ts +1 -1
- package/tests/api-resources/chat/{completions.test.ts → completions/completions.test.ts} +0 -1
- package/tests/api-resources/chat/completions/messages.test.ts +47 -0
- package/tests/api-resources/completions.test.ts +1 -1
- package/tests/api-resources/conversations/items.test.ts +12 -0
- package/tests/api-resources/models/models.test.ts +34 -0
- package/tests/api-resources/models/openai.test.ts +18 -0
- package/tests/api-resources/responses/responses.test.ts +0 -2
- package/.github/workflows/publish-npm.yml +0 -32
- package/dist/resources/moderations.d.ts +0 -83
- package/dist/resources/moderations.d.ts.map +0 -1
- package/dist/resources/moderations.js +0 -24
- package/dist/resources/moderations.js.map +0 -1
- package/dist/resources/moderations.mjs +0 -20
- package/dist/resources/moderations.mjs.map +0 -1
- package/dist/resources/safety.d.ts +0 -297
- package/dist/resources/safety.d.ts.map +0 -1
- package/dist/resources/safety.js +0 -24
- package/dist/resources/safety.js.map +0 -1
- package/dist/resources/safety.mjs +0 -20
- package/dist/resources/safety.mjs.map +0 -1
- package/dist/resources/shields.d.ts +0 -82
- package/dist/resources/shields.d.ts.map +0 -1
- package/dist/resources/shields.js +0 -46
- package/dist/resources/shields.js.map +0 -1
- package/dist/resources/shields.mjs +0 -42
- package/dist/resources/shields.mjs.map +0 -1
- package/dist/src/resources/moderations.ts +0 -97
- package/dist/src/resources/safety.ts +0 -367
- package/dist/src/resources/shields.ts +0 -119
- package/src/resources/moderations.ts +0 -97
- package/src/resources/safety.ts +0 -367
- package/src/resources/shields.ts +0 -119
- package/tests/api-resources/moderations.test.ts +0 -29
- package/tests/api-resources/safety.test.ts +0 -41
- package/tests/api-resources/shields.test.ts +0 -88
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import { APIResource } from "../../resource.js";
|
|
2
2
|
import * as Core from "../../core.js";
|
|
3
3
|
import * as OpenAIAPI from "./openai.js";
|
|
4
|
-
import { OpenAI } from "./openai.js";
|
|
4
|
+
import { OpenAI, OpenAIListParams, OpenAIListResponse } from "./openai.js";
|
|
5
5
|
export declare class Models extends APIResource {
|
|
6
6
|
openai: OpenAIAPI.OpenAI;
|
|
7
7
|
/**
|
|
8
|
-
* Get a model by its identifier.
|
|
8
|
+
* Get a model by its identifier. Returns OpenAI, Anthropic, or Google response
|
|
9
|
+
* format based on SDK detection headers.
|
|
9
10
|
*/
|
|
11
|
+
retrieve(modelId: string, params?: ModelRetrieveParams, options?: Core.RequestOptions): Core.APIPromise<ModelRetrieveResponse>;
|
|
10
12
|
retrieve(modelId: string, options?: Core.RequestOptions): Core.APIPromise<ModelRetrieveResponse>;
|
|
11
13
|
/**
|
|
12
|
-
* List models
|
|
14
|
+
* List models. Returns OpenAI, Anthropic, or Google response format based on SDK
|
|
15
|
+
* detection headers.
|
|
13
16
|
*/
|
|
14
|
-
list(options?: Core.RequestOptions): Core.APIPromise<
|
|
17
|
+
list(params?: ModelListParams, options?: Core.RequestOptions): Core.APIPromise<ModelListResponse>;
|
|
18
|
+
list(options?: Core.RequestOptions): Core.APIPromise<ModelListResponse>;
|
|
15
19
|
}
|
|
16
20
|
/**
|
|
17
21
|
* Response containing a list of OpenAI model objects.
|
|
@@ -43,55 +47,239 @@ export interface Model {
|
|
|
43
47
|
/**
|
|
44
48
|
* A model resource representing an AI model registered in OGX.
|
|
45
49
|
*/
|
|
46
|
-
export
|
|
50
|
+
export type ModelRetrieveResponse = ModelRetrieveResponse.Model | ModelRetrieveResponse.AnthropicModelInfo | ModelRetrieveResponse.GoogleModelInfo;
|
|
51
|
+
export declare namespace ModelRetrieveResponse {
|
|
47
52
|
/**
|
|
48
|
-
*
|
|
53
|
+
* A model resource representing an AI model registered in OGX.
|
|
49
54
|
*/
|
|
50
|
-
|
|
55
|
+
interface Model {
|
|
56
|
+
/**
|
|
57
|
+
* The model identifier (OpenAI-compatible alias for identifier).
|
|
58
|
+
*/
|
|
59
|
+
id: string;
|
|
60
|
+
/**
|
|
61
|
+
* Unique identifier for this resource in ogx
|
|
62
|
+
*/
|
|
63
|
+
identifier: string;
|
|
64
|
+
/**
|
|
65
|
+
* The object type, always 'model'.
|
|
66
|
+
*/
|
|
67
|
+
object: 'model';
|
|
68
|
+
/**
|
|
69
|
+
* ID of the provider that owns this resource
|
|
70
|
+
*/
|
|
71
|
+
provider_id: string;
|
|
72
|
+
/**
|
|
73
|
+
* The Unix timestamp in seconds when the model was created.
|
|
74
|
+
*/
|
|
75
|
+
created?: number;
|
|
76
|
+
/**
|
|
77
|
+
* Any additional metadata for this model
|
|
78
|
+
*/
|
|
79
|
+
metadata?: {
|
|
80
|
+
[key: string]: unknown;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Enumeration of supported model types in OGX.
|
|
84
|
+
*/
|
|
85
|
+
model_type?: 'llm' | 'embedding' | 'rerank';
|
|
86
|
+
/**
|
|
87
|
+
* Enable model availability check during registration. When false (default),
|
|
88
|
+
* validation is deferred to runtime and model is preserved during provider
|
|
89
|
+
* refresh.
|
|
90
|
+
*/
|
|
91
|
+
model_validation?: boolean | null;
|
|
92
|
+
/**
|
|
93
|
+
* The owner of the model.
|
|
94
|
+
*/
|
|
95
|
+
owned_by?: string;
|
|
96
|
+
/**
|
|
97
|
+
* Unique identifier for this resource in the provider
|
|
98
|
+
*/
|
|
99
|
+
provider_resource_id?: string | null;
|
|
100
|
+
type?: 'model';
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Anthropic model info response object.
|
|
104
|
+
*
|
|
105
|
+
* :id: Unique model identifier
|
|
106
|
+
*/
|
|
107
|
+
interface AnthropicModelInfo {
|
|
108
|
+
/**
|
|
109
|
+
* Unique model identifier.
|
|
110
|
+
*/
|
|
111
|
+
id: string;
|
|
112
|
+
/**
|
|
113
|
+
* RFC 3339 datetime string representing when the model was released.
|
|
114
|
+
*/
|
|
115
|
+
created_at: string;
|
|
116
|
+
/**
|
|
117
|
+
* A human-readable name for the model.
|
|
118
|
+
*/
|
|
119
|
+
display_name: string;
|
|
120
|
+
/**
|
|
121
|
+
* Maximum input context window size in tokens.
|
|
122
|
+
*/
|
|
123
|
+
max_input_tokens?: number | null;
|
|
124
|
+
/**
|
|
125
|
+
* Maximum value for the max_tokens parameter when using this model.
|
|
126
|
+
*/
|
|
127
|
+
max_tokens?: number | null;
|
|
128
|
+
/**
|
|
129
|
+
* Object type, always 'model'.
|
|
130
|
+
*/
|
|
131
|
+
type?: 'model';
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Google model info response object.
|
|
135
|
+
*
|
|
136
|
+
* :name: Model resource name, e.g. 'models/gemini-pro' :display_name: A
|
|
137
|
+
* human-readable name for the model :description: A description of the model
|
|
138
|
+
*/
|
|
139
|
+
interface GoogleModelInfo {
|
|
140
|
+
/**
|
|
141
|
+
* A human-readable name for the model.
|
|
142
|
+
*/
|
|
143
|
+
display_name: string;
|
|
144
|
+
/**
|
|
145
|
+
* Model resource name, e.g. 'models/gemini-pro'.
|
|
146
|
+
*/
|
|
147
|
+
name: string;
|
|
148
|
+
/**
|
|
149
|
+
* A description of the model.
|
|
150
|
+
*/
|
|
151
|
+
description?: string;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Response containing a list of OpenAI model objects.
|
|
156
|
+
*/
|
|
157
|
+
export type ModelListResponse = ListModelsResponse | ModelListResponse.AnthropicListModelsResponse | ModelListResponse.GoogleListModelsResponse;
|
|
158
|
+
export declare namespace ModelListResponse {
|
|
51
159
|
/**
|
|
52
|
-
*
|
|
160
|
+
* Response containing a list of Anthropic model objects.
|
|
53
161
|
*/
|
|
54
|
-
|
|
162
|
+
interface AnthropicListModelsResponse {
|
|
163
|
+
/**
|
|
164
|
+
* List of Anthropic model objects.
|
|
165
|
+
*/
|
|
166
|
+
data: Array<AnthropicListModelsResponse.Data>;
|
|
167
|
+
/**
|
|
168
|
+
* First ID in the data list, usable as before_id for the previous page.
|
|
169
|
+
*/
|
|
170
|
+
first_id?: string | null;
|
|
171
|
+
/**
|
|
172
|
+
* Whether there are more results in the requested page direction.
|
|
173
|
+
*/
|
|
174
|
+
has_more?: boolean;
|
|
175
|
+
/**
|
|
176
|
+
* Last ID in the data list, usable as after_id for the next page.
|
|
177
|
+
*/
|
|
178
|
+
last_id?: string | null;
|
|
179
|
+
}
|
|
180
|
+
namespace AnthropicListModelsResponse {
|
|
181
|
+
/**
|
|
182
|
+
* Anthropic model info response object.
|
|
183
|
+
*
|
|
184
|
+
* :id: Unique model identifier
|
|
185
|
+
*/
|
|
186
|
+
interface Data {
|
|
187
|
+
/**
|
|
188
|
+
* Unique model identifier.
|
|
189
|
+
*/
|
|
190
|
+
id: string;
|
|
191
|
+
/**
|
|
192
|
+
* RFC 3339 datetime string representing when the model was released.
|
|
193
|
+
*/
|
|
194
|
+
created_at: string;
|
|
195
|
+
/**
|
|
196
|
+
* A human-readable name for the model.
|
|
197
|
+
*/
|
|
198
|
+
display_name: string;
|
|
199
|
+
/**
|
|
200
|
+
* Maximum input context window size in tokens.
|
|
201
|
+
*/
|
|
202
|
+
max_input_tokens?: number | null;
|
|
203
|
+
/**
|
|
204
|
+
* Maximum value for the max_tokens parameter when using this model.
|
|
205
|
+
*/
|
|
206
|
+
max_tokens?: number | null;
|
|
207
|
+
/**
|
|
208
|
+
* Object type, always 'model'.
|
|
209
|
+
*/
|
|
210
|
+
type?: 'model';
|
|
211
|
+
}
|
|
212
|
+
}
|
|
55
213
|
/**
|
|
56
|
-
*
|
|
214
|
+
* Response containing a list of Google model objects.
|
|
57
215
|
*/
|
|
58
|
-
|
|
216
|
+
interface GoogleListModelsResponse {
|
|
217
|
+
/**
|
|
218
|
+
* List of Google model objects.
|
|
219
|
+
*/
|
|
220
|
+
models: Array<GoogleListModelsResponse.Model>;
|
|
221
|
+
}
|
|
222
|
+
namespace GoogleListModelsResponse {
|
|
223
|
+
/**
|
|
224
|
+
* Google model info response object.
|
|
225
|
+
*
|
|
226
|
+
* :name: Model resource name, e.g. 'models/gemini-pro' :display_name: A
|
|
227
|
+
* human-readable name for the model :description: A description of the model
|
|
228
|
+
*/
|
|
229
|
+
interface Model {
|
|
230
|
+
/**
|
|
231
|
+
* A human-readable name for the model.
|
|
232
|
+
*/
|
|
233
|
+
display_name: string;
|
|
234
|
+
/**
|
|
235
|
+
* Model resource name, e.g. 'models/gemini-pro'.
|
|
236
|
+
*/
|
|
237
|
+
name: string;
|
|
238
|
+
/**
|
|
239
|
+
* A description of the model.
|
|
240
|
+
*/
|
|
241
|
+
description?: string;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
export interface ModelRetrieveParams {
|
|
246
|
+
'anthropic-version'?: string;
|
|
247
|
+
'x-goog-api-client'?: string;
|
|
248
|
+
'x-goog-api-key'?: string;
|
|
249
|
+
'x-goog-user-project'?: string;
|
|
250
|
+
}
|
|
251
|
+
export interface ModelListParams {
|
|
59
252
|
/**
|
|
60
|
-
*
|
|
253
|
+
* Query param: Return models after this model ID (Anthropic SDK format only).
|
|
61
254
|
*/
|
|
62
|
-
|
|
255
|
+
after_id?: string | null;
|
|
63
256
|
/**
|
|
64
|
-
*
|
|
257
|
+
* Query param: Return models before this model ID (Anthropic SDK format only).
|
|
65
258
|
*/
|
|
66
|
-
|
|
259
|
+
before_id?: string | null;
|
|
67
260
|
/**
|
|
68
|
-
*
|
|
261
|
+
* Query param: Maximum number of models to return (Anthropic SDK format only).
|
|
69
262
|
*/
|
|
70
|
-
|
|
71
|
-
[key: string]: unknown;
|
|
72
|
-
};
|
|
263
|
+
limit?: number | null;
|
|
73
264
|
/**
|
|
74
|
-
*
|
|
265
|
+
* Header param
|
|
75
266
|
*/
|
|
76
|
-
|
|
267
|
+
'anthropic-version'?: string;
|
|
77
268
|
/**
|
|
78
|
-
*
|
|
79
|
-
* validation is deferred to runtime and model is preserved during provider
|
|
80
|
-
* refresh.
|
|
269
|
+
* Header param
|
|
81
270
|
*/
|
|
82
|
-
|
|
271
|
+
'x-goog-api-client'?: string;
|
|
83
272
|
/**
|
|
84
|
-
*
|
|
273
|
+
* Header param
|
|
85
274
|
*/
|
|
86
|
-
|
|
275
|
+
'x-goog-api-key'?: string;
|
|
87
276
|
/**
|
|
88
|
-
*
|
|
277
|
+
* Header param
|
|
89
278
|
*/
|
|
90
|
-
|
|
91
|
-
type?: 'model';
|
|
279
|
+
'x-goog-user-project'?: string;
|
|
92
280
|
}
|
|
93
281
|
export declare namespace Models {
|
|
94
|
-
export { type ListModelsResponse as ListModelsResponse, type Model as Model, type ModelRetrieveResponse as ModelRetrieveResponse, };
|
|
95
|
-
export { OpenAI as OpenAI };
|
|
282
|
+
export { type ListModelsResponse as ListModelsResponse, type Model as Model, type ModelRetrieveResponse as ModelRetrieveResponse, type ModelListResponse as ModelListResponse, type ModelRetrieveParams as ModelRetrieveParams, type ModelListParams as ModelListParams, };
|
|
283
|
+
export { OpenAI as OpenAI, type OpenAIListResponse as OpenAIListResponse, type OpenAIListParams as OpenAIListParams, };
|
|
96
284
|
}
|
|
97
285
|
//# sourceMappingURL=models.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/resources/models/models.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/resources/models/models.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,SAAS,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,M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E1B,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAID,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,KAAK,IAAI,KAAK,EACnB,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,eAAe,IAAI,eAAe,GACxC,CAAC;IAEF,OAAO,EACL,MAAM,IAAI,MAAM,EAChB,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
|
|
@@ -32,6 +32,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
33
|
exports.Models = void 0;
|
|
34
34
|
const resource_1 = require("../../resource.js");
|
|
35
|
+
const core_1 = require("../../core.js");
|
|
35
36
|
const OpenAIAPI = __importStar(require("./openai.js"));
|
|
36
37
|
const openai_1 = require("./openai.js");
|
|
37
38
|
class Models extends resource_1.APIResource {
|
|
@@ -39,17 +40,38 @@ class Models extends resource_1.APIResource {
|
|
|
39
40
|
super(...arguments);
|
|
40
41
|
this.openai = new OpenAIAPI.OpenAI(this._client);
|
|
41
42
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
retrieve(modelId, params = {}, options) {
|
|
44
|
+
if ((0, core_1.isRequestOptions)(params)) {
|
|
45
|
+
return this.retrieve(modelId, {}, params);
|
|
46
|
+
}
|
|
47
|
+
const { 'anthropic-version': anthropicVersion, 'x-goog-api-client': xGoogAPIClient, 'x-goog-api-key': xGoogAPIKey, 'x-goog-user-project': xGoogUserProject, } = params;
|
|
48
|
+
return this._client.get(`/v1/models/${modelId}`, {
|
|
49
|
+
...options,
|
|
50
|
+
headers: {
|
|
51
|
+
...(anthropicVersion != null ? { 'anthropic-version': anthropicVersion } : undefined),
|
|
52
|
+
...(xGoogAPIClient != null ? { 'x-goog-api-client': xGoogAPIClient } : undefined),
|
|
53
|
+
...(xGoogAPIKey != null ? { 'x-goog-api-key': xGoogAPIKey } : undefined),
|
|
54
|
+
...(xGoogUserProject != null ? { 'x-goog-user-project': xGoogUserProject } : undefined),
|
|
55
|
+
...options?.headers,
|
|
56
|
+
},
|
|
57
|
+
});
|
|
47
58
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
59
|
+
list(params = {}, options) {
|
|
60
|
+
if ((0, core_1.isRequestOptions)(params)) {
|
|
61
|
+
return this.list({}, params);
|
|
62
|
+
}
|
|
63
|
+
const { 'anthropic-version': anthropicVersion, 'x-goog-api-client': xGoogAPIClient, 'x-goog-api-key': xGoogAPIKey, 'x-goog-user-project': xGoogUserProject, ...query } = params;
|
|
64
|
+
return this._client.get('/v1/models', {
|
|
65
|
+
query,
|
|
66
|
+
...options,
|
|
67
|
+
headers: {
|
|
68
|
+
...(anthropicVersion != null ? { 'anthropic-version': anthropicVersion } : undefined),
|
|
69
|
+
...(xGoogAPIClient != null ? { 'x-goog-api-client': xGoogAPIClient } : undefined),
|
|
70
|
+
...(xGoogAPIKey != null ? { 'x-goog-api-key': xGoogAPIKey } : undefined),
|
|
71
|
+
...(xGoogUserProject != null ? { 'x-goog-user-project': xGoogUserProject } : undefined),
|
|
72
|
+
...options?.headers,
|
|
73
|
+
},
|
|
74
|
+
});
|
|
53
75
|
}
|
|
54
76
|
}
|
|
55
77
|
exports.Models = Models;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/resources/models/models.ts"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,uBAAuB;AACvB,EAAE;AACF,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtF,gDAA6C;
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/resources/models/models.ts"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,uBAAuB;AACvB,EAAE;AACF,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtF,gDAA6C;AAC7C,wCAA8C;AAE9C,uDAAsC;AACtC,wCAAwE;AAExE,MAAa,MAAO,SAAQ,sBAAW;IAAvC;;QACE,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAsEhE,CAAC;IA1DC,QAAQ,CACN,OAAe,EACf,SAAoD,EAAE,EACtD,OAA6B;QAE7B,IAAI,IAAA,uBAAgB,EAAC,MAAM,CAAC,EAAE;YAC5B,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;SAC3C;QACD,MAAM,EACJ,mBAAmB,EAAE,gBAAgB,EACrC,mBAAmB,EAAE,cAAc,EACnC,gBAAgB,EAAE,WAAW,EAC7B,qBAAqB,EAAE,gBAAgB,GACxC,GAAG,MAAM,CAAC;QACX,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAA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AAE,cAAc,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;gBACjF,GAAG,CAAC,WAAW,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;gBACxE,GAAG,CAAC,gBAAgB,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;gBACvF,GAAG,OAAO,EAAE,OAAO;aACpB;SACF,CAAC,CAAC;IACL,CAAC;CACF;AAvED,wBAuEC;AA+TD,MAAM,CAAC,MAAM,GAAG,eAAM,CAAC"}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
//
|
|
7
7
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
8
8
|
import { APIResource } from "../../resource.mjs";
|
|
9
|
+
import { isRequestOptions } from "../../core.mjs";
|
|
9
10
|
import * as OpenAIAPI from "./openai.mjs";
|
|
10
11
|
import { OpenAI } from "./openai.mjs";
|
|
11
12
|
export class Models extends APIResource {
|
|
@@ -13,17 +14,38 @@ export class Models extends APIResource {
|
|
|
13
14
|
super(...arguments);
|
|
14
15
|
this.openai = new OpenAIAPI.OpenAI(this._client);
|
|
15
16
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
retrieve(modelId, params = {}, options) {
|
|
18
|
+
if (isRequestOptions(params)) {
|
|
19
|
+
return this.retrieve(modelId, {}, params);
|
|
20
|
+
}
|
|
21
|
+
const { 'anthropic-version': anthropicVersion, 'x-goog-api-client': xGoogAPIClient, 'x-goog-api-key': xGoogAPIKey, 'x-goog-user-project': xGoogUserProject, } = params;
|
|
22
|
+
return this._client.get(`/v1/models/${modelId}`, {
|
|
23
|
+
...options,
|
|
24
|
+
headers: {
|
|
25
|
+
...(anthropicVersion != null ? { 'anthropic-version': anthropicVersion } : undefined),
|
|
26
|
+
...(xGoogAPIClient != null ? { 'x-goog-api-client': xGoogAPIClient } : undefined),
|
|
27
|
+
...(xGoogAPIKey != null ? { 'x-goog-api-key': xGoogAPIKey } : undefined),
|
|
28
|
+
...(xGoogUserProject != null ? { 'x-goog-user-project': xGoogUserProject } : undefined),
|
|
29
|
+
...options?.headers,
|
|
30
|
+
},
|
|
31
|
+
});
|
|
21
32
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
33
|
+
list(params = {}, options) {
|
|
34
|
+
if (isRequestOptions(params)) {
|
|
35
|
+
return this.list({}, params);
|
|
36
|
+
}
|
|
37
|
+
const { 'anthropic-version': anthropicVersion, 'x-goog-api-client': xGoogAPIClient, 'x-goog-api-key': xGoogAPIKey, 'x-goog-user-project': xGoogUserProject, ...query } = params;
|
|
38
|
+
return this._client.get('/v1/models', {
|
|
39
|
+
query,
|
|
40
|
+
...options,
|
|
41
|
+
headers: {
|
|
42
|
+
...(anthropicVersion != null ? { 'anthropic-version': anthropicVersion } : undefined),
|
|
43
|
+
...(xGoogAPIClient != null ? { 'x-goog-api-client': xGoogAPIClient } : undefined),
|
|
44
|
+
...(xGoogAPIKey != null ? { 'x-goog-api-key': xGoogAPIKey } : undefined),
|
|
45
|
+
...(xGoogUserProject != null ? { 'x-goog-user-project': xGoogUserProject } : undefined),
|
|
46
|
+
...options?.headers,
|
|
47
|
+
},
|
|
48
|
+
});
|
|
27
49
|
}
|
|
28
50
|
}
|
|
29
51
|
Models.OpenAI = OpenAI;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.mjs","sourceRoot":"","sources":["../../src/resources/models/models.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,uBAAuB;AACvB,EAAE;AACF,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,sFAAsF;OAE/E,EAAE,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"models.mjs","sourceRoot":"","sources":["../../src/resources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penAI extends APIResource {
|
|
5
5
|
/**
|
|
6
|
-
* List models
|
|
6
|
+
* List models. Returns OpenAI, Anthropic, or Google response format based on SDK
|
|
7
|
+
* detection headers.
|
|
7
8
|
*/
|
|
8
|
-
list(options?: Core.RequestOptions): Core.APIPromise<
|
|
9
|
+
list(params?: OpenAIListParams, options?: Core.RequestOptions): Core.APIPromise<OpenAIListResponse>;
|
|
10
|
+
list(options?: Core.RequestOptions): Core.APIPromise<OpenAIListResponse>;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Response containing a list of OpenAI model objects.
|
|
14
|
+
*/
|
|
15
|
+
export type OpenAIListResponse = ModelsAPI.ListModelsResponse | OpenAIListResponse.AnthropicListModelsResponse | OpenAIListResponse.GoogleListModelsResponse;
|
|
16
|
+
export declare namespace OpenAIListResponse {
|
|
17
|
+
/**
|
|
18
|
+
* Response containing a list of Anthropic model objects.
|
|
19
|
+
*/
|
|
20
|
+
interface AnthropicListModelsResponse {
|
|
21
|
+
/**
|
|
22
|
+
* List of Anthropic model objects.
|
|
23
|
+
*/
|
|
24
|
+
data: Array<AnthropicListModelsResponse.Data>;
|
|
25
|
+
/**
|
|
26
|
+
* First ID in the data list, usable as before_id for the previous page.
|
|
27
|
+
*/
|
|
28
|
+
first_id?: string | null;
|
|
29
|
+
/**
|
|
30
|
+
* Whether there are more results in the requested page direction.
|
|
31
|
+
*/
|
|
32
|
+
has_more?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Last ID in the data list, usable as after_id for the next page.
|
|
35
|
+
*/
|
|
36
|
+
last_id?: string | null;
|
|
37
|
+
}
|
|
38
|
+
namespace AnthropicListModelsResponse {
|
|
39
|
+
/**
|
|
40
|
+
* Anthropic model info response object.
|
|
41
|
+
*
|
|
42
|
+
* :id: Unique model identifier
|
|
43
|
+
*/
|
|
44
|
+
interface Data {
|
|
45
|
+
/**
|
|
46
|
+
* Unique model identifier.
|
|
47
|
+
*/
|
|
48
|
+
id: string;
|
|
49
|
+
/**
|
|
50
|
+
* RFC 3339 datetime string representing when the model was released.
|
|
51
|
+
*/
|
|
52
|
+
created_at: string;
|
|
53
|
+
/**
|
|
54
|
+
* A human-readable name for the model.
|
|
55
|
+
*/
|
|
56
|
+
display_name: string;
|
|
57
|
+
/**
|
|
58
|
+
* Maximum input context window size in tokens.
|
|
59
|
+
*/
|
|
60
|
+
max_input_tokens?: number | null;
|
|
61
|
+
/**
|
|
62
|
+
* Maximum value for the max_tokens parameter when using this model.
|
|
63
|
+
*/
|
|
64
|
+
max_tokens?: number | null;
|
|
65
|
+
/**
|
|
66
|
+
* Object type, always 'model'.
|
|
67
|
+
*/
|
|
68
|
+
type?: 'model';
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Response containing a list of Google model objects.
|
|
73
|
+
*/
|
|
74
|
+
interface GoogleListModelsResponse {
|
|
75
|
+
/**
|
|
76
|
+
* List of Google model objects.
|
|
77
|
+
*/
|
|
78
|
+
models: Array<GoogleListModelsResponse.Model>;
|
|
79
|
+
}
|
|
80
|
+
namespace GoogleListModelsResponse {
|
|
81
|
+
/**
|
|
82
|
+
* Google model info response object.
|
|
83
|
+
*
|
|
84
|
+
* :name: Model resource name, e.g. 'models/gemini-pro' :display_name: A
|
|
85
|
+
* human-readable name for the model :description: A description of the model
|
|
86
|
+
*/
|
|
87
|
+
interface Model {
|
|
88
|
+
/**
|
|
89
|
+
* A human-readable name for the model.
|
|
90
|
+
*/
|
|
91
|
+
display_name: string;
|
|
92
|
+
/**
|
|
93
|
+
* Model resource name, e.g. 'models/gemini-pro'.
|
|
94
|
+
*/
|
|
95
|
+
name: string;
|
|
96
|
+
/**
|
|
97
|
+
* A description of the model.
|
|
98
|
+
*/
|
|
99
|
+
description?: string;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
export interface OpenAIListParams {
|
|
104
|
+
/**
|
|
105
|
+
* Query param: Return models after this model ID (Anthropic SDK format only).
|
|
106
|
+
*/
|
|
107
|
+
after_id?: string | null;
|
|
108
|
+
/**
|
|
109
|
+
* Query param: Return models before this model ID (Anthropic SDK format only).
|
|
110
|
+
*/
|
|
111
|
+
before_id?: string | null;
|
|
112
|
+
/**
|
|
113
|
+
* Query param: Maximum number of models to return (Anthropic SDK format only).
|
|
114
|
+
*/
|
|
115
|
+
limit?: number | null;
|
|
116
|
+
/**
|
|
117
|
+
* Header param
|
|
118
|
+
*/
|
|
119
|
+
'anthropic-version'?: string;
|
|
120
|
+
/**
|
|
121
|
+
* Header param
|
|
122
|
+
*/
|
|
123
|
+
'x-goog-api-client'?: string;
|
|
124
|
+
/**
|
|
125
|
+
* Header param
|
|
126
|
+
*/
|
|
127
|
+
'x-goog-api-key'?: string;
|
|
128
|
+
/**
|
|
129
|
+
* Header param
|
|
130
|
+
*/
|
|
131
|
+
'x-goog-user-project'?: string;
|
|
132
|
+
}
|
|
133
|
+
export declare namespace OpenAI {
|
|
134
|
+
export { type OpenAIListResponse as OpenAIListResponse, type OpenAIListParams as OpenAIListParams };
|
|
9
135
|
}
|
|
10
136
|
//# sourceMappingURL=openai.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openai.d.ts","sourceRoot":"","sources":["../../src/resources/models/openai.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"openai.d.ts","sourceRoot":"","sources":["../../src/resources/models/openai.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,SAAS,MAAM,UAAU,CAAC;AAEtC,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;OAGG;IACH,IAAI,CAAC,MAAM,CAAC,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU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AAW,CAAC,EAAE,MAAM,CAAC;SACtB;KACF;CACF;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EAAE,KAAK,kBAAkB,IAAI,kBAAkB,EAAE,KAAK,gBAAgB,IAAI,gBAAgB,EAAE,CAAC;CACrG"}
|
|
@@ -9,12 +9,24 @@
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.OpenAI = void 0;
|
|
11
11
|
const resource_1 = require("../../resource.js");
|
|
12
|
+
const core_1 = require("../../core.js");
|
|
12
13
|
class OpenAI extends resource_1.APIResource {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
list(params = {}, options) {
|
|
15
|
+
if ((0, core_1.isRequestOptions)(params)) {
|
|
16
|
+
return this.list({}, params);
|
|
17
|
+
}
|
|
18
|
+
const { 'anthropic-version': anthropicVersion, 'x-goog-api-client': xGoogAPIClient, 'x-goog-api-key': xGoogAPIKey, 'x-goog-user-project': xGoogUserProject, ...query } = params;
|
|
19
|
+
return this._client.get('/v1/models', {
|
|
20
|
+
query,
|
|
21
|
+
...options,
|
|
22
|
+
headers: {
|
|
23
|
+
...(anthropicVersion != null ? { 'anthropic-version': anthropicVersion } : undefined),
|
|
24
|
+
...(xGoogAPIClient != null ? { 'x-goog-api-client': xGoogAPIClient } : undefined),
|
|
25
|
+
...(xGoogAPIKey != null ? { 'x-goog-api-key': xGoogAPIKey } : undefined),
|
|
26
|
+
...(xGoogUserProject != null ? { 'x-goog-user-project': xGoogUserProject } : undefined),
|
|
27
|
+
...options?.headers,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
18
30
|
}
|
|
19
31
|
}
|
|
20
32
|
exports.OpenAI = OpenAI;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openai.js","sourceRoot":"","sources":["../../src/resources/models/openai.ts"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,uBAAuB;AACvB,EAAE;AACF,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,sFAAsF;;;AAEtF,gDAA6C;
|
|
1
|
+
{"version":3,"file":"openai.js","sourceRoot":"","sources":["../../src/resources/models/openai.ts"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,uBAAuB;AACvB,EAAE;AACF,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,sFAAsF;;;AAEtF,gDAA6C;AAC7C,wCAA8C;AAI9C,MAAa,MAAO,SAAQ,sBAAW;IAOrC,IAAI,CACF,SAAiD,EAAE,EACnD,OAA6B;QAE7B,IAAI,IAAA,uBAAgB,EAAC,MAAM,CAAC,EAAE;YAC5B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;SAC9B;QACD,MAAM,EACJ,mBAAmB,EAAE,gBAAgB,EACrC,mBAAmB,EAAE,cAAc,EACnC,gBAAgB,EAAE,WAAW,EAC7B,qBAAqB,EAAE,gBAAgB,EACvC,GAAG,KAAK,EACT,GAAG,MAAM,CAAC;QACX,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE;YACpC,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE;gBACP,GAAG,CAAC,gBAAgB,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;gBACrF,GAAG,CAAC,cAAc,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,mBAAmB,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;gBACjF,GAAG,CAAC,WAAW,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;gBACxE,GAAG,CAAC,gBAAgB,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;gBACvF,GAAG,OAAO,EAAE,OAAO;aACpB;SACF,CAAC,CAAC;IACL,CAAC;CACF;AAjCD,wBAiCC"}
|
|
@@ -6,12 +6,24 @@
|
|
|
6
6
|
//
|
|
7
7
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
8
8
|
import { APIResource } from "../../resource.mjs";
|
|
9
|
+
import { isRequestOptions } from "../../core.mjs";
|
|
9
10
|
export class OpenAI extends APIResource {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
list(params = {}, options) {
|
|
12
|
+
if (isRequestOptions(params)) {
|
|
13
|
+
return this.list({}, params);
|
|
14
|
+
}
|
|
15
|
+
const { 'anthropic-version': anthropicVersion, 'x-goog-api-client': xGoogAPIClient, 'x-goog-api-key': xGoogAPIKey, 'x-goog-user-project': xGoogUserProject, ...query } = params;
|
|
16
|
+
return this._client.get('/v1/models', {
|
|
17
|
+
query,
|
|
18
|
+
...options,
|
|
19
|
+
headers: {
|
|
20
|
+
...(anthropicVersion != null ? { 'anthropic-version': anthropicVersion } : undefined),
|
|
21
|
+
...(xGoogAPIClient != null ? { 'x-goog-api-client': xGoogAPIClient } : undefined),
|
|
22
|
+
...(xGoogAPIKey != null ? { 'x-goog-api-key': xGoogAPIKey } : undefined),
|
|
23
|
+
...(xGoogUserProject != null ? { 'x-goog-user-project': xGoogUserProject } : undefined),
|
|
24
|
+
...options?.headers,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
15
27
|
}
|
|
16
28
|
}
|
|
17
29
|
//# sourceMappingURL=openai.mjs.map
|