openai 6.33.0 → 6.34.0
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/CHANGELOG.md +26 -0
- package/README.md +96 -0
- package/auth/index.d.mts +4 -0
- package/auth/index.d.mts.map +1 -0
- package/auth/index.d.ts +4 -0
- package/auth/index.d.ts.map +1 -0
- package/auth/index.js +11 -0
- package/auth/index.js.map +1 -0
- package/auth/index.mjs +3 -0
- package/auth/index.mjs.map +1 -0
- package/auth/subject-token-providers.d.mts +20 -0
- package/auth/subject-token-providers.d.mts.map +1 -0
- package/auth/subject-token-providers.d.ts +20 -0
- package/auth/subject-token-providers.d.ts.map +1 -0
- package/auth/subject-token-providers.js +127 -0
- package/auth/subject-token-providers.js.map +1 -0
- package/auth/subject-token-providers.mjs +121 -0
- package/auth/subject-token-providers.mjs.map +1 -0
- package/auth/types.d.mts +23 -0
- package/auth/types.d.mts.map +1 -0
- package/auth/types.d.ts +23 -0
- package/auth/types.d.ts.map +1 -0
- package/auth/types.js +3 -0
- package/auth/types.js.map +1 -0
- package/auth/types.mjs +2 -0
- package/auth/types.mjs.map +1 -0
- package/auth/workload-identity-auth.d.mts +16 -0
- package/auth/workload-identity-auth.d.mts.map +1 -0
- package/auth/workload-identity-auth.d.ts +16 -0
- package/auth/workload-identity-auth.d.ts.map +1 -0
- package/auth/workload-identity-auth.js +92 -0
- package/auth/workload-identity-auth.js.map +1 -0
- package/auth/workload-identity-auth.mjs +87 -0
- package/auth/workload-identity-auth.mjs.map +1 -0
- package/azure.d.mts +2 -1
- package/azure.d.mts.map +1 -1
- package/azure.d.ts +2 -1
- package/azure.d.ts.map +1 -1
- package/azure.js.map +1 -1
- package/azure.mjs.map +1 -1
- package/client.d.mts +11 -1
- package/client.d.mts.map +1 -1
- package/client.d.ts +11 -1
- package/client.d.ts.map +1 -1
- package/client.js +73 -10
- package/client.js.map +1 -1
- package/client.mjs +73 -10
- package/client.mjs.map +1 -1
- package/core/error.d.mts +15 -0
- package/core/error.d.mts.map +1 -1
- package/core/error.d.ts +15 -0
- package/core/error.d.ts.map +1 -1
- package/core/error.js +34 -1
- package/core/error.js.map +1 -1
- package/core/error.mjs +31 -0
- package/core/error.mjs.map +1 -1
- package/index.d.mts +1 -1
- package/index.d.mts.map +1 -1
- package/index.d.ts +1 -1
- package/index.d.ts.map +1 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/index.mjs +1 -1
- package/index.mjs.map +1 -1
- package/package.json +11 -1
- package/resources/conversations/conversations.d.mts +7 -0
- package/resources/conversations/conversations.d.mts.map +1 -1
- package/resources/conversations/conversations.d.ts +7 -0
- package/resources/conversations/conversations.d.ts.map +1 -1
- package/resources/conversations/conversations.js.map +1 -1
- package/resources/conversations/conversations.mjs.map +1 -1
- package/resources/realtime/calls.d.mts +3 -2
- package/resources/realtime/calls.d.mts.map +1 -1
- package/resources/realtime/calls.d.ts +3 -2
- package/resources/realtime/calls.d.ts.map +1 -1
- package/resources/realtime/client-secrets.d.mts +3 -2
- package/resources/realtime/client-secrets.d.mts.map +1 -1
- package/resources/realtime/client-secrets.d.ts +3 -2
- package/resources/realtime/client-secrets.d.ts.map +1 -1
- package/resources/realtime/realtime.d.mts +6 -4
- package/resources/realtime/realtime.d.mts.map +1 -1
- package/resources/realtime/realtime.d.ts +6 -4
- package/resources/realtime/realtime.d.ts.map +1 -1
- package/resources/realtime/realtime.js.map +1 -1
- package/resources/realtime/realtime.mjs.map +1 -1
- package/resources/shared.d.mts +1 -0
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +1 -0
- package/resources/shared.d.ts.map +1 -1
- package/resources/vector-stores/file-batches.d.mts +9 -5
- package/resources/vector-stores/file-batches.d.mts.map +1 -1
- package/resources/vector-stores/file-batches.d.ts +9 -5
- package/resources/vector-stores/file-batches.d.ts.map +1 -1
- package/resources/vector-stores/files.d.mts +3 -1
- package/resources/vector-stores/files.d.mts.map +1 -1
- package/resources/vector-stores/files.d.ts +3 -1
- package/resources/vector-stores/files.d.ts.map +1 -1
- package/src/auth/index.ts +9 -0
- package/src/auth/subject-token-providers.ts +185 -0
- package/src/auth/types.ts +28 -0
- package/src/auth/workload-identity-auth.ts +118 -0
- package/src/azure.ts +2 -1
- package/src/client.ts +112 -9
- package/src/core/error.ts +40 -0
- package/src/index.ts +2 -0
- package/src/resources/conversations/conversations.ts +8 -0
- package/src/resources/realtime/calls.ts +3 -2
- package/src/resources/realtime/client-secrets.ts +3 -2
- package/src/resources/realtime/realtime.ts +6 -4
- package/src/resources/shared.ts +2 -0
- package/src/resources/vector-stores/file-batches.ts +9 -5
- package/src/resources/vector-stores/files.ts +3 -1
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/src/core/error.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import { castToError } from '../internal/errors';
|
|
4
|
+
import type { OAuthErrorCode } from '../resources/shared';
|
|
4
5
|
|
|
5
6
|
export class OpenAIError extends Error {}
|
|
6
7
|
|
|
@@ -158,3 +159,42 @@ export class InvalidWebhookSignatureError extends Error {
|
|
|
158
159
|
super(message);
|
|
159
160
|
}
|
|
160
161
|
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Error thrown by the API server during OAuth token exchange.
|
|
165
|
+
* Can have status codes 400, 401, or 403.
|
|
166
|
+
* Other status codes from OAuth endpoints are raised as normal APIError types.
|
|
167
|
+
*/
|
|
168
|
+
export class OAuthError extends APIError<400 | 401 | 403, Headers> {
|
|
169
|
+
readonly error_code: OAuthErrorCode | undefined;
|
|
170
|
+
|
|
171
|
+
constructor(status: 400 | 401 | 403, error: Object | undefined, headers: Headers) {
|
|
172
|
+
let finalMessage = 'OAuth2 authentication error';
|
|
173
|
+
let error_code: OAuthErrorCode | undefined = undefined;
|
|
174
|
+
|
|
175
|
+
if (error && typeof error === 'object') {
|
|
176
|
+
const errorData = error as Record<string, any>;
|
|
177
|
+
error_code = errorData['error'];
|
|
178
|
+
const description = errorData['error_description'];
|
|
179
|
+
if (description && typeof description === 'string') {
|
|
180
|
+
finalMessage = description;
|
|
181
|
+
} else if (error_code) {
|
|
182
|
+
finalMessage = error_code;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
super(status, error, finalMessage, headers);
|
|
187
|
+
this.error_code = error_code;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export class SubjectTokenProviderError extends OpenAIError {
|
|
192
|
+
readonly provider: string;
|
|
193
|
+
readonly cause: Error | undefined;
|
|
194
|
+
|
|
195
|
+
constructor(message: string, provider: string, cause?: Error) {
|
|
196
|
+
super(message);
|
|
197
|
+
this.provider = provider;
|
|
198
|
+
this.cause = cause;
|
|
199
|
+
}
|
|
200
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -170,6 +170,14 @@ export interface Message {
|
|
|
170
170
|
* The type of the message. Always set to `message`.
|
|
171
171
|
*/
|
|
172
172
|
type: 'message';
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Labels an `assistant` message as intermediate commentary (`commentary`) or the
|
|
176
|
+
* final answer (`final_answer`). For models like `gpt-5.3-codex` and beyond, when
|
|
177
|
+
* sending follow-up requests, preserve and resend phase on all assistant messages
|
|
178
|
+
* — dropping it can degrade performance. Not used for user messages.
|
|
179
|
+
*/
|
|
180
|
+
phase?: 'commentary' | 'final_answer' | null;
|
|
173
181
|
}
|
|
174
182
|
|
|
175
183
|
export namespace Message {
|
|
@@ -172,8 +172,9 @@ export interface CallAcceptParams {
|
|
|
172
172
|
|
|
173
173
|
/**
|
|
174
174
|
* Realtime API can write session traces to the
|
|
175
|
-
* [Traces Dashboard](/logs?api=traces). Set to null to
|
|
176
|
-
* tracing is enabled for a session, the configuration cannot
|
|
175
|
+
* [Traces Dashboard](https://platform.openai.com/logs?api=traces). Set to null to
|
|
176
|
+
* disable tracing. Once tracing is enabled for a session, the configuration cannot
|
|
177
|
+
* be modified.
|
|
177
178
|
*
|
|
178
179
|
* `auto` will create a trace for the session with default values for the workflow
|
|
179
180
|
* name, group id, and metadata.
|
|
@@ -153,8 +153,9 @@ export interface RealtimeSessionCreateResponse {
|
|
|
153
153
|
|
|
154
154
|
/**
|
|
155
155
|
* Realtime API can write session traces to the
|
|
156
|
-
* [Traces Dashboard](/logs?api=traces). Set to null to
|
|
157
|
-
* tracing is enabled for a session, the configuration cannot
|
|
156
|
+
* [Traces Dashboard](https://platform.openai.com/logs?api=traces). Set to null to
|
|
157
|
+
* disable tracing. Once tracing is enabled for a session, the configuration cannot
|
|
158
|
+
* be modified.
|
|
158
159
|
*
|
|
159
160
|
* `auto` will create a trace for the session with default values for the workflow
|
|
160
161
|
* name, group id, and metadata.
|
|
@@ -3136,8 +3136,9 @@ export interface RealtimeSessionCreateRequest {
|
|
|
3136
3136
|
|
|
3137
3137
|
/**
|
|
3138
3138
|
* Realtime API can write session traces to the
|
|
3139
|
-
* [Traces Dashboard](/logs?api=traces). Set to null to
|
|
3140
|
-
* tracing is enabled for a session, the configuration cannot
|
|
3139
|
+
* [Traces Dashboard](https://platform.openai.com/logs?api=traces). Set to null to
|
|
3140
|
+
* disable tracing. Once tracing is enabled for a session, the configuration cannot
|
|
3141
|
+
* be modified.
|
|
3141
3142
|
*
|
|
3142
3143
|
* `auto` will create a trace for the session with default values for the workflow
|
|
3143
3144
|
* name, group id, and metadata.
|
|
@@ -3349,8 +3350,9 @@ export namespace RealtimeToolsConfigUnion {
|
|
|
3349
3350
|
|
|
3350
3351
|
/**
|
|
3351
3352
|
* Realtime API can write session traces to the
|
|
3352
|
-
* [Traces Dashboard](/logs?api=traces). Set to null to
|
|
3353
|
-
* tracing is enabled for a session, the configuration cannot
|
|
3353
|
+
* [Traces Dashboard](https://platform.openai.com/logs?api=traces). Set to null to
|
|
3354
|
+
* disable tracing. Once tracing is enabled for a session, the configuration cannot
|
|
3355
|
+
* be modified.
|
|
3354
3356
|
*
|
|
3355
3357
|
* `auto` will create a trace for the session with default values for the workflow
|
|
3356
3358
|
* name, group id, and metadata.
|
package/src/resources/shared.ts
CHANGED
|
@@ -248,6 +248,8 @@ export type FunctionParameters = { [key: string]: unknown };
|
|
|
248
248
|
*/
|
|
249
249
|
export type Metadata = { [key: string]: string };
|
|
250
250
|
|
|
251
|
+
export type OAuthErrorCode = 'invalid_grant' | 'invalid_subject_token' | (string & {});
|
|
252
|
+
|
|
251
253
|
/**
|
|
252
254
|
* **gpt-5 and o-series models only**
|
|
253
255
|
*
|
|
@@ -274,8 +274,9 @@ export interface FileBatchCreateParams {
|
|
|
274
274
|
* A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that
|
|
275
275
|
* the vector store should use. Useful for tools like `file_search` that can access
|
|
276
276
|
* files. If `attributes` or `chunking_strategy` are provided, they will be applied
|
|
277
|
-
* to all files in the batch. The maximum batch size is 2000 files.
|
|
278
|
-
*
|
|
277
|
+
* to all files in the batch. The maximum batch size is 2000 files. This endpoint
|
|
278
|
+
* is recommended for multi-file ingestion and helps reduce per-vector-store write
|
|
279
|
+
* request pressure. Mutually exclusive with `files`.
|
|
279
280
|
*/
|
|
280
281
|
file_ids?: Array<string>;
|
|
281
282
|
|
|
@@ -283,8 +284,9 @@ export interface FileBatchCreateParams {
|
|
|
283
284
|
* A list of objects that each include a `file_id` plus optional `attributes` or
|
|
284
285
|
* `chunking_strategy`. Use this when you need to override metadata for specific
|
|
285
286
|
* files. The global `attributes` or `chunking_strategy` will be ignored and must
|
|
286
|
-
* be specified for each file. The maximum batch size is 2000 files.
|
|
287
|
-
*
|
|
287
|
+
* be specified for each file. The maximum batch size is 2000 files. This endpoint
|
|
288
|
+
* is recommended for multi-file ingestion and helps reduce per-vector-store write
|
|
289
|
+
* request pressure. Mutually exclusive with `file_ids`.
|
|
288
290
|
*/
|
|
289
291
|
files?: Array<FileBatchCreateParams.File>;
|
|
290
292
|
}
|
|
@@ -294,7 +296,9 @@ export namespace FileBatchCreateParams {
|
|
|
294
296
|
/**
|
|
295
297
|
* A [File](https://platform.openai.com/docs/api-reference/files) ID that the
|
|
296
298
|
* vector store should use. Useful for tools like `file_search` that can access
|
|
297
|
-
* files.
|
|
299
|
+
* files. For multi-file ingestion, we recommend
|
|
300
|
+
* [`file_batches`](https://platform.openai.com/docs/api-reference/vector-stores-file-batches/createBatch)
|
|
301
|
+
* to minimize per-vector-store write requests.
|
|
298
302
|
*/
|
|
299
303
|
file_id: string;
|
|
300
304
|
|
|
@@ -299,7 +299,9 @@ export interface FileCreateParams {
|
|
|
299
299
|
/**
|
|
300
300
|
* A [File](https://platform.openai.com/docs/api-reference/files) ID that the
|
|
301
301
|
* vector store should use. Useful for tools like `file_search` that can access
|
|
302
|
-
* files.
|
|
302
|
+
* files. For multi-file ingestion, we recommend
|
|
303
|
+
* [`file_batches`](https://platform.openai.com/docs/api-reference/vector-stores-file-batches/createBatch)
|
|
304
|
+
* to minimize per-vector-store write requests.
|
|
303
305
|
*/
|
|
304
306
|
file_id: string;
|
|
305
307
|
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '6.
|
|
1
|
+
export const VERSION = '6.34.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "6.
|
|
1
|
+
export declare const VERSION = "6.34.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "6.
|
|
1
|
+
export declare const VERSION = "6.34.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '6.
|
|
1
|
+
export const VERSION = '6.34.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|