openai 7.7.0 → 7.9.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 +39 -0
- package/README.md +15 -30
- package/auth/index.d.mts +1 -1
- package/auth/index.d.mts.map +1 -1
- package/auth/index.d.ts +1 -1
- package/auth/index.d.ts.map +1 -1
- package/auth/index.js.map +1 -1
- package/auth/index.mjs.map +1 -1
- package/auth/types.d.mts +9 -4
- package/auth/types.d.mts.map +1 -1
- package/auth/types.d.ts +9 -4
- package/auth/types.d.ts.map +1 -1
- package/auth/workload-identity-auth.d.mts +1 -1
- package/auth/workload-identity-auth.d.mts.map +1 -1
- package/auth/workload-identity-auth.d.ts +1 -1
- package/auth/workload-identity-auth.d.ts.map +1 -1
- package/auth/workload-identity-auth.js +23 -6
- package/auth/workload-identity-auth.js.map +1 -1
- package/auth/workload-identity-auth.mjs +23 -6
- package/auth/workload-identity-auth.mjs.map +1 -1
- package/auth/x509-transport.d.mts +36 -1
- package/auth/x509-transport.d.mts.map +1 -1
- package/auth/x509-transport.d.ts +36 -1
- package/auth/x509-transport.d.ts.map +1 -1
- package/auth/x509-transport.js +224 -1
- package/auth/x509-transport.js.map +1 -1
- package/auth/x509-transport.mjs +222 -1
- package/auth/x509-transport.mjs.map +1 -1
- package/azure.d.mts +3 -1
- package/azure.d.mts.map +1 -1
- package/azure.d.ts +3 -1
- package/azure.d.ts.map +1 -1
- package/azure.js.map +1 -1
- package/azure.mjs.map +1 -1
- package/bedrock.d.mts +3 -1
- package/bedrock.d.mts.map +1 -1
- package/bedrock.d.ts +3 -1
- package/bedrock.d.ts.map +1 -1
- package/bedrock.js.map +1 -1
- package/bedrock.mjs.map +1 -1
- package/beta/realtime/ws.d.mts.map +1 -1
- package/beta/realtime/ws.d.ts.map +1 -1
- package/beta/realtime/ws.js +2 -0
- package/beta/realtime/ws.js.map +1 -1
- package/beta/realtime/ws.mjs +2 -0
- package/beta/realtime/ws.mjs.map +1 -1
- package/client.d.mts +3 -1
- package/client.d.mts.map +1 -1
- package/client.d.ts +3 -1
- package/client.d.ts.map +1 -1
- package/client.js +31 -38
- package/client.js.map +1 -1
- package/client.mjs +31 -38
- package/client.mjs.map +1 -1
- package/core/EventEmitter.d.mts.map +1 -1
- package/core/EventEmitter.d.ts.map +1 -1
- package/core/EventEmitter.js +14 -1
- package/core/EventEmitter.js.map +1 -1
- package/core/EventEmitter.mjs +14 -1
- package/core/EventEmitter.mjs.map +1 -1
- package/internal/auth/x509-api-origin.d.mts +5 -0
- package/internal/auth/x509-api-origin.d.mts.map +1 -0
- package/internal/auth/x509-api-origin.d.ts +5 -0
- package/internal/auth/x509-api-origin.d.ts.map +1 -0
- package/internal/auth/x509-api-origin.js +28 -0
- package/internal/auth/x509-api-origin.js.map +1 -0
- package/internal/auth/x509-api-origin.mjs +24 -0
- package/internal/auth/x509-api-origin.mjs.map +1 -0
- package/internal/auth/x509-credential-options.d.mts +13 -0
- package/internal/auth/x509-credential-options.d.mts.map +1 -0
- package/internal/auth/x509-credential-options.d.ts +13 -0
- package/internal/auth/x509-credential-options.d.ts.map +1 -0
- package/internal/auth/x509-credential-options.js +122 -0
- package/internal/auth/x509-credential-options.js.map +1 -0
- package/internal/auth/x509-credential-options.mjs +118 -0
- package/internal/auth/x509-credential-options.mjs.map +1 -0
- package/internal/auth/x509-token-exchange.js +1 -1
- package/internal/auth/x509-token-exchange.mjs +1 -1
- package/internal/auth/x509-transport-capability.d.mts +12 -5
- package/internal/auth/x509-transport-capability.d.mts.map +1 -1
- package/internal/auth/x509-transport-capability.d.ts +12 -5
- package/internal/auth/x509-transport-capability.d.ts.map +1 -1
- package/internal/auth/x509-transport-capability.js +6 -5
- package/internal/auth/x509-transport-capability.js.map +1 -1
- package/internal/auth/x509-transport-capability.mjs +6 -5
- package/internal/auth/x509-transport-capability.mjs.map +1 -1
- package/internal/auth/x509-transport-registry.d.mts +8 -0
- package/internal/auth/x509-transport-registry.d.mts.map +1 -1
- package/internal/auth/x509-transport-registry.d.ts +8 -0
- package/internal/auth/x509-transport-registry.d.ts.map +1 -1
- package/internal/auth/x509-transport-registry.js +1 -1
- package/internal/auth/x509-transport-registry.js.map +1 -1
- package/internal/auth/x509-transport-registry.mjs +1 -1
- package/internal/auth/x509-transport-registry.mjs.map +1 -1
- package/internal/auth/x509-transport-state-browser.d.mts +4 -0
- package/internal/auth/x509-transport-state-browser.d.mts.map +1 -1
- package/internal/auth/x509-transport-state-browser.d.ts +4 -0
- package/internal/auth/x509-transport-state-browser.d.ts.map +1 -1
- package/internal/auth/x509-transport-state-browser.js +6 -1
- package/internal/auth/x509-transport-state-browser.js.map +1 -1
- package/internal/auth/x509-transport-state-browser.mjs +5 -0
- package/internal/auth/x509-transport-state-browser.mjs.map +1 -1
- package/internal/auth/x509-transport-state.cjs +6 -1
- package/internal/auth/x509-transport-state.cjs.map +1 -1
- package/internal/auth/x509-transport-state.d.cts +4 -0
- package/internal/auth/x509-transport-state.d.cts.map +1 -1
- package/internal/auth/x509-transport-state.js +36 -0
- package/internal/auth/x509-transport-state.mjs +19 -0
- package/internal/auth/x509-workload-identity-auth.d.mts +2 -4
- package/internal/auth/x509-workload-identity-auth.d.mts.map +1 -1
- package/internal/auth/x509-workload-identity-auth.d.ts +2 -4
- package/internal/auth/x509-workload-identity-auth.d.ts.map +1 -1
- package/internal/auth/x509-workload-identity-auth.js +44 -35
- package/internal/auth/x509-workload-identity-auth.js.map +1 -1
- package/internal/auth/x509-workload-identity-auth.mjs +40 -30
- package/internal/auth/x509-workload-identity-auth.mjs.map +1 -1
- package/internal/uploads.js +4 -2
- package/internal/uploads.js.map +1 -1
- package/internal/uploads.mjs +4 -2
- package/internal/uploads.mjs.map +1 -1
- package/internal/utils/log.d.mts +6 -0
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts +6 -0
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js +72 -11
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs +69 -11
- package/internal/utils/log.mjs.map +1 -1
- package/lib/EventEmitter.d.mts.map +1 -1
- package/lib/EventEmitter.d.ts.map +1 -1
- package/lib/EventEmitter.js +14 -1
- package/lib/EventEmitter.js.map +1 -1
- package/lib/EventEmitter.mjs +14 -1
- package/lib/EventEmitter.mjs.map +1 -1
- package/package.json +10 -6
- package/realtime/ws.d.mts.map +1 -1
- package/realtime/ws.d.ts.map +1 -1
- package/realtime/ws.js +2 -0
- package/realtime/ws.js.map +1 -1
- package/realtime/ws.mjs +2 -0
- package/realtime/ws.mjs.map +1 -1
- package/resources/admin/organization/audit-logs.d.mts +2 -2
- package/resources/admin/organization/audit-logs.d.mts.map +1 -1
- package/resources/admin/organization/audit-logs.d.ts +2 -2
- package/resources/admin/organization/audit-logs.d.ts.map +1 -1
- package/resources/admin/organization/usage.d.mts +5 -0
- package/resources/admin/organization/usage.d.mts.map +1 -1
- package/resources/admin/organization/usage.d.ts +5 -0
- package/resources/admin/organization/usage.d.ts.map +1 -1
- package/resources/batches.d.mts +3 -3
- package/resources/batches.d.ts +3 -3
- package/resources/beta/responses/responses.d.mts +11 -23
- package/resources/beta/responses/responses.d.mts.map +1 -1
- package/resources/beta/responses/responses.d.ts +11 -23
- package/resources/beta/responses/responses.d.ts.map +1 -1
- package/resources/beta/responses/responses.js.map +1 -1
- package/resources/beta/responses/responses.mjs.map +1 -1
- package/resources/beta/responses/ws.d.mts.map +1 -1
- package/resources/beta/responses/ws.d.ts.map +1 -1
- package/resources/beta/responses/ws.js +3 -0
- package/resources/beta/responses/ws.js.map +1 -1
- package/resources/beta/responses/ws.mjs +3 -0
- package/resources/beta/responses/ws.mjs.map +1 -1
- package/resources/chat/completions/completions.d.mts +4 -4
- package/resources/chat/completions/completions.d.ts +4 -4
- package/resources/evals/evals.d.mts +4 -4
- package/resources/evals/evals.d.ts +4 -4
- package/resources/evals/runs/runs.d.mts +1 -1
- package/resources/evals/runs/runs.d.ts +1 -1
- package/resources/responses/responses.d.mts +13 -19
- package/resources/responses/responses.d.mts.map +1 -1
- package/resources/responses/responses.d.ts +13 -19
- package/resources/responses/responses.d.ts.map +1 -1
- package/resources/responses/responses.js.map +1 -1
- package/resources/responses/responses.mjs.map +1 -1
- package/resources/responses/ws.d.mts.map +1 -1
- package/resources/responses/ws.d.ts.map +1 -1
- package/resources/responses/ws.js +3 -0
- package/resources/responses/ws.js.map +1 -1
- package/resources/responses/ws.mjs +3 -0
- package/resources/responses/ws.mjs.map +1 -1
- package/resources/shared.d.mts +0 -2
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +0 -2
- package/resources/shared.d.ts.map +1 -1
- package/src/_vendor/partial-json-parser/LICENSE +21 -0
- package/src/_vendor/partial-json-parser/README.md +11 -1
- package/src/auth/index.ts +1 -0
- package/src/auth/types.ts +10 -4
- package/src/auth/workload-identity-auth.ts +30 -6
- package/src/auth/x509-transport.ts +311 -2
- package/src/azure.ts +4 -1
- package/src/bedrock.ts +4 -1
- package/src/beta/realtime/ws.ts +2 -0
- package/src/client.ts +39 -34
- package/src/core/EventEmitter.ts +13 -1
- package/src/internal/auth/x509-api-origin.ts +27 -0
- package/src/internal/auth/x509-credential-options.ts +146 -0
- package/src/internal/auth/x509-transport-capability.ts +12 -5
- package/src/internal/auth/x509-transport-registry.ts +9 -0
- package/src/internal/auth/x509-transport-state-browser.ts +7 -0
- package/src/internal/auth/x509-transport-state.cts +7 -0
- package/src/internal/auth/x509-workload-identity-auth.ts +42 -33
- package/src/internal/uploads.ts +4 -2
- package/src/internal/utils/log.ts +76 -11
- package/src/lib/EventEmitter.ts +13 -1
- package/src/realtime/ws.ts +2 -0
- package/src/resources/admin/organization/audit-logs.ts +4 -0
- package/src/resources/admin/organization/usage.ts +6 -0
- package/src/resources/batches.ts +3 -3
- package/src/resources/beta/responses/responses.ts +11 -23
- package/src/resources/beta/responses/ws.ts +4 -0
- package/src/resources/chat/completions/completions.ts +4 -4
- package/src/resources/evals/evals.ts +4 -4
- package/src/resources/evals/runs/runs.ts +1 -1
- package/src/resources/responses/responses.ts +13 -19
- package/src/resources/responses/ws.ts +4 -0
- package/src/resources/shared.ts +0 -2
- 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
|
@@ -82,6 +82,62 @@ export function loggerFor(client: OpenAI): Logger {
|
|
|
82
82
|
return levelLogger;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
+
const sensitiveQueryNames = new Set([
|
|
86
|
+
'apikey',
|
|
87
|
+
'accesstoken',
|
|
88
|
+
'refreshtoken',
|
|
89
|
+
'sessiontoken',
|
|
90
|
+
'sessionid',
|
|
91
|
+
'idtoken',
|
|
92
|
+
'authtoken',
|
|
93
|
+
'authorization',
|
|
94
|
+
'token',
|
|
95
|
+
'password',
|
|
96
|
+
'clientsecret',
|
|
97
|
+
'xamzsecuritytoken',
|
|
98
|
+
'xamzsignature',
|
|
99
|
+
'xamzcredential',
|
|
100
|
+
]);
|
|
101
|
+
|
|
102
|
+
/** Recognizes credential-bearing query names across ordinary and provider authentication. */
|
|
103
|
+
export function isSensitiveQueryParameter(name: string): boolean {
|
|
104
|
+
const normalized = name.toLowerCase().replace(/[-_]/gu, '');
|
|
105
|
+
return sensitiveQueryNames.has(normalized) || sensitiveQueryNames.has(normalized.replace(/^x/u, ''));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const sensitiveHeaderNames = new Set([
|
|
109
|
+
'authorization',
|
|
110
|
+
'proxy-authorization',
|
|
111
|
+
'api-key',
|
|
112
|
+
'x-api-key',
|
|
113
|
+
'x-amz-security-token',
|
|
114
|
+
'cookie',
|
|
115
|
+
'set-cookie',
|
|
116
|
+
'x-session-token',
|
|
117
|
+
'x-session-id',
|
|
118
|
+
'x-auth-token',
|
|
119
|
+
'x-id-token',
|
|
120
|
+
]);
|
|
121
|
+
|
|
122
|
+
/** Recognizes credential-bearing request headers across provider and workload authentication. */
|
|
123
|
+
export function isSensitiveHeader(name: string): boolean {
|
|
124
|
+
return sensitiveHeaderNames.has(name.toLowerCase().replace(/_/gu, '-')) || isSensitiveQueryParameter(name);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/** Removes credential-valued query parameters before a request URL reaches any logger. */
|
|
128
|
+
export function redactURL(value: string): string {
|
|
129
|
+
const url = new URL(value);
|
|
130
|
+
url.username = '';
|
|
131
|
+
url.password = '';
|
|
132
|
+
url.hash = '';
|
|
133
|
+
for (const name of url.searchParams.keys()) {
|
|
134
|
+
if (isSensitiveQueryParameter(name)) {
|
|
135
|
+
url.searchParams.set(name, '***');
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return url.href;
|
|
139
|
+
}
|
|
140
|
+
|
|
85
141
|
export const formatRequestDetails = (details: {
|
|
86
142
|
options?: RequestOptions | undefined;
|
|
87
143
|
headers?: Headers | Record<string, string> | undefined;
|
|
@@ -97,21 +153,30 @@ export const formatRequestDetails = (details: {
|
|
|
97
153
|
if (details.options) {
|
|
98
154
|
details.options = { ...details.options };
|
|
99
155
|
delete details.options['headers']; // redundant + leaks internals
|
|
156
|
+
if (details.options.path) {
|
|
157
|
+
const path = details.options.path;
|
|
158
|
+
const redacted = new URL(redactURL(new URL(path, 'https://redacted.invalid').href));
|
|
159
|
+
details.options.path =
|
|
160
|
+
redacted.origin === 'https://redacted.invalid'
|
|
161
|
+
? `${path.startsWith('/') ? '/' : ''}${redacted.pathname.slice(1)}${redacted.search}`
|
|
162
|
+
: redacted.href;
|
|
163
|
+
}
|
|
164
|
+
if (details.options.query) {
|
|
165
|
+
details.options.query = Object.fromEntries(
|
|
166
|
+
Object.entries(details.options.query).map(([name, value]) => [
|
|
167
|
+
name,
|
|
168
|
+
isSensitiveQueryParameter(name) ? '***' : value,
|
|
169
|
+
]),
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
if (details.url) {
|
|
174
|
+
details.url = redactURL(details.url);
|
|
100
175
|
}
|
|
101
176
|
if (details.headers) {
|
|
102
177
|
details.headers = Object.fromEntries(
|
|
103
178
|
(details.headers instanceof Headers ? [...details.headers] : Object.entries(details.headers)).map(
|
|
104
|
-
([name, value]) => [
|
|
105
|
-
name,
|
|
106
|
-
name.toLowerCase() === 'authorization' ||
|
|
107
|
-
name.toLowerCase() === 'api-key' ||
|
|
108
|
-
name.toLowerCase() === 'x-api-key' ||
|
|
109
|
-
name.toLowerCase() === 'x-amz-security-token' ||
|
|
110
|
-
name.toLowerCase() === 'cookie' ||
|
|
111
|
-
name.toLowerCase() === 'set-cookie'
|
|
112
|
-
? '***'
|
|
113
|
-
: value,
|
|
114
|
-
],
|
|
179
|
+
([name, value]) => [name, isSensitiveHeader(name) ? '***' : value],
|
|
115
180
|
),
|
|
116
181
|
);
|
|
117
182
|
}
|
package/src/lib/EventEmitter.ts
CHANGED
|
@@ -184,11 +184,20 @@ export class EventEmitter<EventTypes extends Record<string, (...args: any) => an
|
|
|
184
184
|
}
|
|
185
185
|
return !listener.once && !listener.removed;
|
|
186
186
|
}) as any;
|
|
187
|
+
let listenerThrew = false;
|
|
188
|
+
let firstListenerError: unknown;
|
|
187
189
|
this.#listenerDispatchDepth += 1;
|
|
188
190
|
try {
|
|
189
191
|
for (const registration of listeners as any) {
|
|
190
192
|
if (!registration.removed) {
|
|
191
|
-
|
|
193
|
+
try {
|
|
194
|
+
registration.listener(...(args as any));
|
|
195
|
+
} catch (error) {
|
|
196
|
+
if (!listenerThrew) {
|
|
197
|
+
listenerThrew = true;
|
|
198
|
+
firstListenerError = error;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
192
201
|
}
|
|
193
202
|
}
|
|
194
203
|
} finally {
|
|
@@ -197,6 +206,9 @@ export class EventEmitter<EventTypes extends Record<string, (...args: any) => an
|
|
|
197
206
|
this.#cleanupEmittedListeners();
|
|
198
207
|
}
|
|
199
208
|
}
|
|
209
|
+
if (listenerThrew) {
|
|
210
|
+
throw firstListenerError;
|
|
211
|
+
}
|
|
200
212
|
}
|
|
201
213
|
}
|
|
202
214
|
|
package/src/realtime/ws.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { assertBedrockWebSocketOrigin } from '../internal/bedrock';
|
|
|
3
3
|
import { protectWebSocketOptionsFromCredentialRedirects } from '../internal/ws';
|
|
4
4
|
import type { AzureOpenAI } from '../index';
|
|
5
5
|
import { OpenAI } from '../index';
|
|
6
|
+
import { VERSION } from '../version';
|
|
6
7
|
import type { RealtimeClientEvent } from '../resources/realtime/realtime';
|
|
7
8
|
import {
|
|
8
9
|
OpenAIRealtimeEmitter,
|
|
@@ -62,6 +63,7 @@ export class OpenAIRealtimeWS extends OpenAIRealtimeEmitter {
|
|
|
62
63
|
this.url = buildRealtimeURL(client, props);
|
|
63
64
|
assertBedrockWebSocketOrigin(client, this.url);
|
|
64
65
|
const headers = {
|
|
66
|
+
'User-Agent': `${client.constructor.name}/JS ${VERSION}`,
|
|
65
67
|
...props.options?.headers,
|
|
66
68
|
...(isAzure(client) && !props.__resolvedApiKey ? {} : { Authorization: `Bearer ${client.apiKey}` }),
|
|
67
69
|
};
|
|
@@ -130,6 +130,8 @@ export interface AuditLogListResponse {
|
|
|
130
130
|
| 'tenant.admin_api_key.updated'
|
|
131
131
|
| 'tenant.admin_api_key.deleted'
|
|
132
132
|
| 'tenant.project_api_key.created'
|
|
133
|
+
| 'tenant.trusted_access.business_verification.started'
|
|
134
|
+
| 'tenant.trusted_access.application.submitted'
|
|
133
135
|
| 'tenant.chatgpt_access_token.revoked'
|
|
134
136
|
| 'tenant.migration.completed'
|
|
135
137
|
| 'tenant.sso.migrated'
|
|
@@ -1936,6 +1938,8 @@ export interface AuditLogListParams extends ConversationCursorPageParams {
|
|
|
1936
1938
|
| 'tenant.admin_api_key.updated'
|
|
1937
1939
|
| 'tenant.admin_api_key.deleted'
|
|
1938
1940
|
| 'tenant.project_api_key.created'
|
|
1941
|
+
| 'tenant.trusted_access.business_verification.started'
|
|
1942
|
+
| 'tenant.trusted_access.application.submitted'
|
|
1939
1943
|
| 'tenant.chatgpt_access_token.revoked'
|
|
1940
1944
|
| 'tenant.migration.completed'
|
|
1941
1945
|
| 'tenant.sso.migrated'
|
|
@@ -6638,6 +6638,12 @@ export interface UsageCostsParams {
|
|
|
6638
6638
|
*/
|
|
6639
6639
|
limit?: number;
|
|
6640
6640
|
|
|
6641
|
+
/**
|
|
6642
|
+
* Return only costs for these exact line item names. Each value must match the
|
|
6643
|
+
* complete `line_item` value, for example `gpt-5.6-sol, input_tokens`.
|
|
6644
|
+
*/
|
|
6645
|
+
line_items?: Array<string>;
|
|
6646
|
+
|
|
6641
6647
|
/**
|
|
6642
6648
|
* A cursor for use in pagination. Corresponding to the `next_page` field from the
|
|
6643
6649
|
* previous response.
|
package/src/resources/batches.ts
CHANGED
|
@@ -154,9 +154,9 @@ export interface Batch {
|
|
|
154
154
|
metadata?: Shared.Metadata | null;
|
|
155
155
|
|
|
156
156
|
/**
|
|
157
|
-
* Model ID used to process the batch, like `gpt-5-
|
|
158
|
-
*
|
|
159
|
-
*
|
|
157
|
+
* Model ID used to process the batch, like `gpt-5.6-sol`. OpenAI offers a wide
|
|
158
|
+
* range of models with different capabilities, performance characteristics, and
|
|
159
|
+
* price points. Refer to the
|
|
160
160
|
* [model guide](https://platform.openai.com/docs/models) to browse and compare
|
|
161
161
|
* available models.
|
|
162
162
|
*/
|
|
@@ -1122,9 +1122,9 @@ export interface BetaResponse {
|
|
|
1122
1122
|
metadata: { [key: string]: string } | null;
|
|
1123
1123
|
|
|
1124
1124
|
/**
|
|
1125
|
-
* Model ID used to generate the response, like `gpt-
|
|
1126
|
-
*
|
|
1127
|
-
*
|
|
1125
|
+
* Model ID used to generate the response, like `gpt-5.6-sol`. OpenAI offers a wide
|
|
1126
|
+
* range of models with different capabilities, performance characteristics, and
|
|
1127
|
+
* price points. Refer to the
|
|
1128
1128
|
* [model guide](https://platform.openai.com/docs/models) to browse and compare
|
|
1129
1129
|
* available models.
|
|
1130
1130
|
*/
|
|
@@ -1398,8 +1398,6 @@ export interface BetaResponse {
|
|
|
1398
1398
|
prompt_cache_retention?: 'in_memory' | '24h' | null;
|
|
1399
1399
|
|
|
1400
1400
|
/**
|
|
1401
|
-
* **gpt-5 and o-series models only**
|
|
1402
|
-
*
|
|
1403
1401
|
* Configuration options for
|
|
1404
1402
|
* [reasoning models](https://platform.openai.com/docs/guides/reasoning).
|
|
1405
1403
|
*/
|
|
@@ -1501,7 +1499,7 @@ export namespace BetaResponse {
|
|
|
1501
1499
|
/**
|
|
1502
1500
|
* The reason why the response is incomplete.
|
|
1503
1501
|
*/
|
|
1504
|
-
reason?: 'max_output_tokens' | 'content_filter';
|
|
1502
|
+
reason?: 'max_output_tokens' | 'max_messages' | 'content_filter';
|
|
1505
1503
|
}
|
|
1506
1504
|
|
|
1507
1505
|
export interface BetaSpecificProgrammaticToolCallingParam {
|
|
@@ -1671,8 +1669,6 @@ export namespace BetaResponse {
|
|
|
1671
1669
|
}
|
|
1672
1670
|
|
|
1673
1671
|
/**
|
|
1674
|
-
* **gpt-5 and o-series models only**
|
|
1675
|
-
*
|
|
1676
1672
|
* Configuration options for
|
|
1677
1673
|
* [reasoning models](https://platform.openai.com/docs/guides/reasoning).
|
|
1678
1674
|
*/
|
|
@@ -10793,9 +10789,9 @@ export namespace BetaResponsesClientEvent {
|
|
|
10793
10789
|
metadata?: { [key: string]: string } | null;
|
|
10794
10790
|
|
|
10795
10791
|
/**
|
|
10796
|
-
* Model ID used to generate the response, like `gpt-
|
|
10797
|
-
*
|
|
10798
|
-
*
|
|
10792
|
+
* Model ID used to generate the response, like `gpt-5.6-sol`. OpenAI offers a wide
|
|
10793
|
+
* range of models with different capabilities, performance characteristics, and
|
|
10794
|
+
* price points. Refer to the
|
|
10799
10795
|
* [model guide](https://platform.openai.com/docs/models) to browse and compare
|
|
10800
10796
|
* available models.
|
|
10801
10797
|
*/
|
|
@@ -10975,8 +10971,6 @@ export namespace BetaResponsesClientEvent {
|
|
|
10975
10971
|
prompt_cache_retention?: 'in_memory' | '24h' | null;
|
|
10976
10972
|
|
|
10977
10973
|
/**
|
|
10978
|
-
* **gpt-5 and o-series models only**
|
|
10979
|
-
*
|
|
10980
10974
|
* Configuration options for
|
|
10981
10975
|
* [reasoning models](https://platform.openai.com/docs/guides/reasoning).
|
|
10982
10976
|
*/
|
|
@@ -11256,8 +11250,6 @@ export namespace BetaResponsesClientEvent {
|
|
|
11256
11250
|
}
|
|
11257
11251
|
|
|
11258
11252
|
/**
|
|
11259
|
-
* **gpt-5 and o-series models only**
|
|
11260
|
-
*
|
|
11261
11253
|
* Configuration options for
|
|
11262
11254
|
* [reasoning models](https://platform.openai.com/docs/guides/reasoning).
|
|
11263
11255
|
*/
|
|
@@ -12956,8 +12948,8 @@ export interface ResponseCreateParamsBase {
|
|
|
12956
12948
|
metadata?: { [key: string]: string } | null;
|
|
12957
12949
|
|
|
12958
12950
|
/**
|
|
12959
|
-
* Body param: Model ID used to generate the response, like `gpt-
|
|
12960
|
-
*
|
|
12951
|
+
* Body param: Model ID used to generate the response, like `gpt-5.6-sol`. OpenAI
|
|
12952
|
+
* offers a wide range of models with different capabilities, performance
|
|
12961
12953
|
* characteristics, and price points. Refer to the
|
|
12962
12954
|
* [model guide](https://platform.openai.com/docs/models) to browse and compare
|
|
12963
12955
|
* available models.
|
|
@@ -13140,9 +13132,7 @@ export interface ResponseCreateParamsBase {
|
|
|
13140
13132
|
prompt_cache_retention?: 'in_memory' | '24h' | null;
|
|
13141
13133
|
|
|
13142
13134
|
/**
|
|
13143
|
-
* Body param:
|
|
13144
|
-
*
|
|
13145
|
-
* Configuration options for
|
|
13135
|
+
* Body param: Configuration options for
|
|
13146
13136
|
* [reasoning models](https://platform.openai.com/docs/guides/reasoning).
|
|
13147
13137
|
*/
|
|
13148
13138
|
reasoning?: ResponseCreateParams.Reasoning | null;
|
|
@@ -13421,8 +13411,6 @@ export namespace ResponseCreateParams {
|
|
|
13421
13411
|
}
|
|
13422
13412
|
|
|
13423
13413
|
/**
|
|
13424
|
-
* **gpt-5 and o-series models only**
|
|
13425
|
-
*
|
|
13426
13414
|
* Configuration options for
|
|
13427
13415
|
* [reasoning models](https://platform.openai.com/docs/guides/reasoning).
|
|
13428
13416
|
*/
|
|
@@ -13610,7 +13598,7 @@ export interface ResponseCancelParams {
|
|
|
13610
13598
|
|
|
13611
13599
|
export interface ResponseCompactParams {
|
|
13612
13600
|
/**
|
|
13613
|
-
* Body param: Model ID used to generate the response, like `gpt-5
|
|
13601
|
+
* Body param: Model ID used to generate the response, like `gpt-5.6-sol`. OpenAI
|
|
13614
13602
|
* offers a wide range of models with different capabilities, performance
|
|
13615
13603
|
* characteristics, and price points. Refer to the
|
|
13616
13604
|
* [model guide](https://platform.openai.com/docs/models) to browse and compare
|
|
@@ -4,6 +4,7 @@ import * as WS from 'ws';
|
|
|
4
4
|
import { NodeWebSocket } from '../../../internal/ws-adapter-node';
|
|
5
5
|
import { ResponsesWSBase, type ResponsesWSBaseOptions } from './ws-base';
|
|
6
6
|
import { OpenAI } from '../../../client';
|
|
7
|
+
import { VERSION } from '../../../version';
|
|
7
8
|
|
|
8
9
|
export type { ResponsesWSReconnectOptions } from './ws-base';
|
|
9
10
|
|
|
@@ -29,9 +30,12 @@ export class ResponsesWS extends ResponsesWSBase<NodeWebSocket> {
|
|
|
29
30
|
const ws = new WS.WebSocket(url, {
|
|
30
31
|
...this._wsOptions,
|
|
31
32
|
headers: {
|
|
33
|
+
'User-Agent': `${this._client.constructor.name}/JS ${VERSION}`,
|
|
34
|
+
|
|
32
35
|
...authHeaders,
|
|
33
36
|
...this._wsOptions?.headers,
|
|
34
37
|
},
|
|
38
|
+
followRedirects: false,
|
|
35
39
|
});
|
|
36
40
|
return new NodeWebSocket(ws);
|
|
37
41
|
}
|
|
@@ -60,7 +60,7 @@ export class Completions extends APIResource {
|
|
|
60
60
|
* const chatCompletion = await client.chat.completions.create(
|
|
61
61
|
* {
|
|
62
62
|
* messages: [{ content: 'string', role: 'developer' }],
|
|
63
|
-
* model: 'gpt-5.
|
|
63
|
+
* model: 'gpt-5.6-sol',
|
|
64
64
|
* },
|
|
65
65
|
* );
|
|
66
66
|
* ```
|
|
@@ -2079,9 +2079,9 @@ export interface ChatCompletionCreateParamsBase {
|
|
|
2079
2079
|
messages: Array<ChatCompletionMessageParam>;
|
|
2080
2080
|
|
|
2081
2081
|
/**
|
|
2082
|
-
* Model ID used to generate the response, like `gpt-
|
|
2083
|
-
* wide range of models with different capabilities, performance
|
|
2084
|
-
* and price points. Refer to the
|
|
2082
|
+
* Model ID used to generate the response, like `gpt-5.6-sol` or `o3`. OpenAI
|
|
2083
|
+
* offers a wide range of models with different capabilities, performance
|
|
2084
|
+
* characteristics, and price points. Refer to the
|
|
2085
2085
|
* [model guide](https://platform.openai.com/docs/models) to browse and compare
|
|
2086
2086
|
* available models.
|
|
2087
2087
|
*/
|
|
@@ -136,7 +136,7 @@ export interface EvalStoredCompletionsDataSourceConfig {
|
|
|
136
136
|
*
|
|
137
137
|
* - Improve the quality of my chatbot
|
|
138
138
|
* - See how well my chatbot handles customer support
|
|
139
|
-
* - Check if o4-mini is better at my usecase than gpt-
|
|
139
|
+
* - Check if o4-mini is better at my usecase than gpt-5.6-sol
|
|
140
140
|
*/
|
|
141
141
|
export interface EvalCreateResponse {
|
|
142
142
|
/**
|
|
@@ -257,7 +257,7 @@ export namespace EvalCreateResponse {
|
|
|
257
257
|
*
|
|
258
258
|
* - Improve the quality of my chatbot
|
|
259
259
|
* - See how well my chatbot handles customer support
|
|
260
|
-
* - Check if o4-mini is better at my usecase than gpt-
|
|
260
|
+
* - Check if o4-mini is better at my usecase than gpt-5.6-sol
|
|
261
261
|
*/
|
|
262
262
|
export interface EvalRetrieveResponse {
|
|
263
263
|
/**
|
|
@@ -378,7 +378,7 @@ export namespace EvalRetrieveResponse {
|
|
|
378
378
|
*
|
|
379
379
|
* - Improve the quality of my chatbot
|
|
380
380
|
* - See how well my chatbot handles customer support
|
|
381
|
-
* - Check if o4-mini is better at my usecase than gpt-
|
|
381
|
+
* - Check if o4-mini is better at my usecase than gpt-5.6-sol
|
|
382
382
|
*/
|
|
383
383
|
export interface EvalUpdateResponse {
|
|
384
384
|
/**
|
|
@@ -499,7 +499,7 @@ export namespace EvalUpdateResponse {
|
|
|
499
499
|
*
|
|
500
500
|
* - Improve the quality of my chatbot
|
|
501
501
|
* - See how well my chatbot handles customer support
|
|
502
|
-
* - Check if o4-mini is better at my usecase than gpt-
|
|
502
|
+
* - Check if o4-mini is better at my usecase than gpt-5.6-sol
|
|
503
503
|
*/
|
|
504
504
|
export interface EvalListResponse {
|
|
505
505
|
/**
|
|
@@ -196,7 +196,7 @@ export namespace CreateEvalCompletionsRunDataSource {
|
|
|
196
196
|
metadata?: Shared.Metadata | null;
|
|
197
197
|
|
|
198
198
|
/**
|
|
199
|
-
* An optional model to filter by (e.g., 'gpt-
|
|
199
|
+
* An optional model to filter by (e.g., 'gpt-5.6-sol').
|
|
200
200
|
*/
|
|
201
201
|
model?: string | null;
|
|
202
202
|
}
|
|
@@ -1068,9 +1068,9 @@ export interface Response {
|
|
|
1068
1068
|
metadata: Shared.Metadata | null;
|
|
1069
1069
|
|
|
1070
1070
|
/**
|
|
1071
|
-
* Model ID used to generate the response, like `gpt-
|
|
1072
|
-
*
|
|
1073
|
-
*
|
|
1071
|
+
* Model ID used to generate the response, like `gpt-5.6-sol`. OpenAI offers a wide
|
|
1072
|
+
* range of models with different capabilities, performance characteristics, and
|
|
1073
|
+
* price points. Refer to the
|
|
1074
1074
|
* [model guide](https://platform.openai.com/docs/models) to browse and compare
|
|
1075
1075
|
* available models.
|
|
1076
1076
|
*/
|
|
@@ -1233,8 +1233,6 @@ export interface Response {
|
|
|
1233
1233
|
prompt_cache_retention?: 'in_memory' | '24h' | null;
|
|
1234
1234
|
|
|
1235
1235
|
/**
|
|
1236
|
-
* **gpt-5 and o-series models only**
|
|
1237
|
-
*
|
|
1238
1236
|
* Configuration options for
|
|
1239
1237
|
* [reasoning models](https://platform.openai.com/docs/guides/reasoning).
|
|
1240
1238
|
*/
|
|
@@ -1335,7 +1333,7 @@ export namespace Response {
|
|
|
1335
1333
|
/**
|
|
1336
1334
|
* The reason why the response is incomplete.
|
|
1337
1335
|
*/
|
|
1338
|
-
reason?: 'max_output_tokens' | 'content_filter';
|
|
1336
|
+
reason?: 'max_output_tokens' | 'max_messages' | 'content_filter';
|
|
1339
1337
|
}
|
|
1340
1338
|
|
|
1341
1339
|
export interface SpecificProgrammaticToolCallingParam {
|
|
@@ -7899,9 +7897,9 @@ export interface ResponsesClientEvent {
|
|
|
7899
7897
|
metadata?: Shared.Metadata | null;
|
|
7900
7898
|
|
|
7901
7899
|
/**
|
|
7902
|
-
* Model ID used to generate the response, like `gpt-
|
|
7903
|
-
*
|
|
7904
|
-
*
|
|
7900
|
+
* Model ID used to generate the response, like `gpt-5.6-sol`. OpenAI offers a wide
|
|
7901
|
+
* range of models with different capabilities, performance characteristics, and
|
|
7902
|
+
* price points. Refer to the
|
|
7905
7903
|
* [model guide](https://platform.openai.com/docs/models) to browse and compare
|
|
7906
7904
|
* available models.
|
|
7907
7905
|
*/
|
|
@@ -7973,8 +7971,6 @@ export interface ResponsesClientEvent {
|
|
|
7973
7971
|
prompt_cache_retention?: 'in_memory' | '24h' | null;
|
|
7974
7972
|
|
|
7975
7973
|
/**
|
|
7976
|
-
* **gpt-5 and o-series models only**
|
|
7977
|
-
*
|
|
7978
7974
|
* Configuration options for
|
|
7979
7975
|
* [reasoning models](https://platform.openai.com/docs/guides/reasoning).
|
|
7980
7976
|
*/
|
|
@@ -9850,9 +9846,9 @@ export interface ResponseCreateParamsBase {
|
|
|
9850
9846
|
metadata?: Shared.Metadata | null;
|
|
9851
9847
|
|
|
9852
9848
|
/**
|
|
9853
|
-
* Model ID used to generate the response, like `gpt-
|
|
9854
|
-
*
|
|
9855
|
-
*
|
|
9849
|
+
* Model ID used to generate the response, like `gpt-5.6-sol`. OpenAI offers a wide
|
|
9850
|
+
* range of models with different capabilities, performance characteristics, and
|
|
9851
|
+
* price points. Refer to the
|
|
9856
9852
|
* [model guide](https://platform.openai.com/docs/models) to browse and compare
|
|
9857
9853
|
* available models.
|
|
9858
9854
|
*/
|
|
@@ -9924,8 +9920,6 @@ export interface ResponseCreateParamsBase {
|
|
|
9924
9920
|
prompt_cache_retention?: 'in_memory' | '24h' | null;
|
|
9925
9921
|
|
|
9926
9922
|
/**
|
|
9927
|
-
* **gpt-5 and o-series models only**
|
|
9928
|
-
*
|
|
9929
9923
|
* Configuration options for
|
|
9930
9924
|
* [reasoning models](https://platform.openai.com/docs/guides/reasoning).
|
|
9931
9925
|
*/
|
|
@@ -10290,9 +10284,9 @@ export interface ResponseRetrieveParamsStreaming extends ResponseRetrieveParamsB
|
|
|
10290
10284
|
|
|
10291
10285
|
export interface ResponseCompactParams {
|
|
10292
10286
|
/**
|
|
10293
|
-
* Model ID used to generate the response, like `gpt-5
|
|
10294
|
-
*
|
|
10295
|
-
*
|
|
10287
|
+
* Model ID used to generate the response, like `gpt-5.6-sol`. OpenAI offers a wide
|
|
10288
|
+
* range of models with different capabilities, performance characteristics, and
|
|
10289
|
+
* price points. Refer to the
|
|
10296
10290
|
* [model guide](https://platform.openai.com/docs/models) to browse and compare
|
|
10297
10291
|
* available models.
|
|
10298
10292
|
*/
|
|
@@ -4,6 +4,7 @@ import * as WS from 'ws';
|
|
|
4
4
|
import { NodeWebSocket } from '../../internal/ws-adapter-node';
|
|
5
5
|
import { ResponsesWSBase, type ResponsesWSBaseOptions } from './ws-base';
|
|
6
6
|
import { OpenAI } from '../../client';
|
|
7
|
+
import { VERSION } from '../../version';
|
|
7
8
|
|
|
8
9
|
export type { ResponsesWSReconnectOptions } from './ws-base';
|
|
9
10
|
|
|
@@ -29,9 +30,12 @@ export class ResponsesWS extends ResponsesWSBase<NodeWebSocket> {
|
|
|
29
30
|
const ws = new WS.WebSocket(url, {
|
|
30
31
|
...this._wsOptions,
|
|
31
32
|
headers: {
|
|
33
|
+
'User-Agent': `${this._client.constructor.name}/JS ${VERSION}`,
|
|
34
|
+
|
|
32
35
|
...authHeaders,
|
|
33
36
|
...this._wsOptions?.headers,
|
|
34
37
|
},
|
|
38
|
+
followRedirects: false,
|
|
35
39
|
});
|
|
36
40
|
return new NodeWebSocket(ws);
|
|
37
41
|
}
|
package/src/resources/shared.ts
CHANGED
|
@@ -261,8 +261,6 @@ export type Metadata = { [key: string]: string };
|
|
|
261
261
|
export type OAuthErrorCode = 'invalid_grant' | 'invalid_subject_token' | (string & {});
|
|
262
262
|
|
|
263
263
|
/**
|
|
264
|
-
* **gpt-5 and o-series models only**
|
|
265
|
-
*
|
|
266
264
|
* Configuration options for
|
|
267
265
|
* [reasoning models](https://platform.openai.com/docs/guides/reasoning).
|
|
268
266
|
*/
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Version of the installed OpenAI SDK package. */
|
|
2
|
-
export const VERSION = '7.
|
|
2
|
+
export const VERSION = '7.9.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
package/version.d.ts
CHANGED
package/version.js
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VERSION = void 0;
|
|
4
4
|
/** Version of the installed OpenAI SDK package. */
|
|
5
|
-
exports.VERSION = '7.
|
|
5
|
+
exports.VERSION = '7.9.0'; // x-release-please-version
|
|
6
6
|
//# sourceMappingURL=version.js.map
|
package/version.mjs
CHANGED