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.
Files changed (117) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +96 -0
  3. package/auth/index.d.mts +4 -0
  4. package/auth/index.d.mts.map +1 -0
  5. package/auth/index.d.ts +4 -0
  6. package/auth/index.d.ts.map +1 -0
  7. package/auth/index.js +11 -0
  8. package/auth/index.js.map +1 -0
  9. package/auth/index.mjs +3 -0
  10. package/auth/index.mjs.map +1 -0
  11. package/auth/subject-token-providers.d.mts +20 -0
  12. package/auth/subject-token-providers.d.mts.map +1 -0
  13. package/auth/subject-token-providers.d.ts +20 -0
  14. package/auth/subject-token-providers.d.ts.map +1 -0
  15. package/auth/subject-token-providers.js +127 -0
  16. package/auth/subject-token-providers.js.map +1 -0
  17. package/auth/subject-token-providers.mjs +121 -0
  18. package/auth/subject-token-providers.mjs.map +1 -0
  19. package/auth/types.d.mts +23 -0
  20. package/auth/types.d.mts.map +1 -0
  21. package/auth/types.d.ts +23 -0
  22. package/auth/types.d.ts.map +1 -0
  23. package/auth/types.js +3 -0
  24. package/auth/types.js.map +1 -0
  25. package/auth/types.mjs +2 -0
  26. package/auth/types.mjs.map +1 -0
  27. package/auth/workload-identity-auth.d.mts +16 -0
  28. package/auth/workload-identity-auth.d.mts.map +1 -0
  29. package/auth/workload-identity-auth.d.ts +16 -0
  30. package/auth/workload-identity-auth.d.ts.map +1 -0
  31. package/auth/workload-identity-auth.js +92 -0
  32. package/auth/workload-identity-auth.js.map +1 -0
  33. package/auth/workload-identity-auth.mjs +87 -0
  34. package/auth/workload-identity-auth.mjs.map +1 -0
  35. package/azure.d.mts +2 -1
  36. package/azure.d.mts.map +1 -1
  37. package/azure.d.ts +2 -1
  38. package/azure.d.ts.map +1 -1
  39. package/azure.js.map +1 -1
  40. package/azure.mjs.map +1 -1
  41. package/client.d.mts +11 -1
  42. package/client.d.mts.map +1 -1
  43. package/client.d.ts +11 -1
  44. package/client.d.ts.map +1 -1
  45. package/client.js +73 -10
  46. package/client.js.map +1 -1
  47. package/client.mjs +73 -10
  48. package/client.mjs.map +1 -1
  49. package/core/error.d.mts +15 -0
  50. package/core/error.d.mts.map +1 -1
  51. package/core/error.d.ts +15 -0
  52. package/core/error.d.ts.map +1 -1
  53. package/core/error.js +34 -1
  54. package/core/error.js.map +1 -1
  55. package/core/error.mjs +31 -0
  56. package/core/error.mjs.map +1 -1
  57. package/index.d.mts +1 -1
  58. package/index.d.mts.map +1 -1
  59. package/index.d.ts +1 -1
  60. package/index.d.ts.map +1 -1
  61. package/index.js +3 -1
  62. package/index.js.map +1 -1
  63. package/index.mjs +1 -1
  64. package/index.mjs.map +1 -1
  65. package/package.json +11 -1
  66. package/resources/conversations/conversations.d.mts +7 -0
  67. package/resources/conversations/conversations.d.mts.map +1 -1
  68. package/resources/conversations/conversations.d.ts +7 -0
  69. package/resources/conversations/conversations.d.ts.map +1 -1
  70. package/resources/conversations/conversations.js.map +1 -1
  71. package/resources/conversations/conversations.mjs.map +1 -1
  72. package/resources/realtime/calls.d.mts +3 -2
  73. package/resources/realtime/calls.d.mts.map +1 -1
  74. package/resources/realtime/calls.d.ts +3 -2
  75. package/resources/realtime/calls.d.ts.map +1 -1
  76. package/resources/realtime/client-secrets.d.mts +3 -2
  77. package/resources/realtime/client-secrets.d.mts.map +1 -1
  78. package/resources/realtime/client-secrets.d.ts +3 -2
  79. package/resources/realtime/client-secrets.d.ts.map +1 -1
  80. package/resources/realtime/realtime.d.mts +6 -4
  81. package/resources/realtime/realtime.d.mts.map +1 -1
  82. package/resources/realtime/realtime.d.ts +6 -4
  83. package/resources/realtime/realtime.d.ts.map +1 -1
  84. package/resources/realtime/realtime.js.map +1 -1
  85. package/resources/realtime/realtime.mjs.map +1 -1
  86. package/resources/shared.d.mts +1 -0
  87. package/resources/shared.d.mts.map +1 -1
  88. package/resources/shared.d.ts +1 -0
  89. package/resources/shared.d.ts.map +1 -1
  90. package/resources/vector-stores/file-batches.d.mts +9 -5
  91. package/resources/vector-stores/file-batches.d.mts.map +1 -1
  92. package/resources/vector-stores/file-batches.d.ts +9 -5
  93. package/resources/vector-stores/file-batches.d.ts.map +1 -1
  94. package/resources/vector-stores/files.d.mts +3 -1
  95. package/resources/vector-stores/files.d.mts.map +1 -1
  96. package/resources/vector-stores/files.d.ts +3 -1
  97. package/resources/vector-stores/files.d.ts.map +1 -1
  98. package/src/auth/index.ts +9 -0
  99. package/src/auth/subject-token-providers.ts +185 -0
  100. package/src/auth/types.ts +28 -0
  101. package/src/auth/workload-identity-auth.ts +118 -0
  102. package/src/azure.ts +2 -1
  103. package/src/client.ts +112 -9
  104. package/src/core/error.ts +40 -0
  105. package/src/index.ts +2 -0
  106. package/src/resources/conversations/conversations.ts +8 -0
  107. package/src/resources/realtime/calls.ts +3 -2
  108. package/src/resources/realtime/client-secrets.ts +3 -2
  109. package/src/resources/realtime/realtime.ts +6 -4
  110. package/src/resources/shared.ts +2 -0
  111. package/src/resources/vector-stores/file-batches.ts +9 -5
  112. package/src/resources/vector-stores/files.ts +3 -1
  113. package/src/version.ts +1 -1
  114. package/version.d.mts +1 -1
  115. package/version.d.ts +1 -1
  116. package/version.js +1 -1
  117. 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
@@ -21,6 +21,8 @@ export {
21
21
  PermissionDeniedError,
22
22
  UnprocessableEntityError,
23
23
  InvalidWebhookSignatureError,
24
+ OAuthError,
25
+ SubjectTokenProviderError,
24
26
  } from './core/error';
25
27
 
26
28
  export { AzureOpenAI } from './azure';
@@ -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 disable tracing. Once
176
- * tracing is enabled for a session, the configuration cannot be modified.
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 disable tracing. Once
157
- * tracing is enabled for a session, the configuration cannot be modified.
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 disable tracing. Once
3140
- * tracing is enabled for a session, the configuration cannot be modified.
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 disable tracing. Once
3353
- * tracing is enabled for a session, the configuration cannot be modified.
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.
@@ -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. Mutually
278
- * exclusive with `files`.
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. Mutually
287
- * exclusive with `file_ids`.
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.33.0'; // x-release-please-version
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.33.0";
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.33.0";
1
+ export declare const VERSION = "6.34.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '6.33.0'; // x-release-please-version
4
+ exports.VERSION = '6.34.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '6.33.0'; // x-release-please-version
1
+ export const VERSION = '6.34.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map