Skip to content

Commit 2a1d36b

Browse files
feat(api): add gpt-4.5-preview (#1349)
1 parent a1a1253 commit 2a1d36b

File tree

7 files changed

+50
-11
lines changed

7 files changed

+50
-11
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 74
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-4aa6ee65ba9efc789e05e6a5ef0883b2cadf06def8efd863dbf75e9e233067e1.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-5d30684c3118d049682ea30cdb4dbef39b97d51667da484689193dc40162af32.yml

src/resources/beta/assistants.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1310,6 +1310,8 @@ export interface AssistantUpdateParams {
13101310
| 'gpt-4o-2024-05-13'
13111311
| 'gpt-4o-mini'
13121312
| 'gpt-4o-mini-2024-07-18'
1313+
| 'gpt-4.5-preview'
1314+
| 'gpt-4.5-preview-2025-02-27'
13131315
| 'gpt-4-turbo'
13141316
| 'gpt-4-turbo-2024-04-09'
13151317
| 'gpt-4-0125-preview'

src/resources/beta/realtime/realtime.ts

+17-7
Original file line numberDiff line numberDiff line change
@@ -1796,11 +1796,14 @@ export interface SessionCreatedEvent {
17961796

17971797
/**
17981798
* Send this event to update the session’s default configuration. The client may
1799-
* send this event at any time to update the session configuration, and any field
1800-
* may be updated at any time, except for "voice". The server will respond with a
1801-
* `session.updated` event that shows the full effective configuration. Only fields
1802-
* that are present are updated, thus the correct way to clear a field like
1803-
* "instructions" is to pass an empty string.
1799+
* send this event at any time to update any field, except for `voice`. However,
1800+
* note that once a session has been initialized with a particular `model`, it
1801+
* can’t be changed to another model using `session.update`.
1802+
*
1803+
* When the server receives a `session.update`, it will respond with a
1804+
* `session.updated` event showing the full, effective configuration. Only the
1805+
* fields that are present are updated. To clear a field like `instructions`, pass
1806+
* an empty string.
18041807
*/
18051808
export interface SessionUpdateEvent {
18061809
/**
@@ -1982,11 +1985,18 @@ export namespace SessionUpdateEvent {
19821985
*/
19831986
export interface TurnDetection {
19841987
/**
1985-
* Whether or not to automatically generate a response when VAD is enabled. `true`
1986-
* by default.
1988+
* Whether or not to automatically generate a response when a VAD stop event
1989+
* occurs. `true` by default.
19871990
*/
19881991
create_response?: boolean;
19891992

1993+
/**
1994+
* Whether or not to automatically interrupt any ongoing response with output to
1995+
* the default conversation (i.e. `conversation` of `auto`) when a VAD start event
1996+
* occurs. `true` by default.
1997+
*/
1998+
interrupt_response?: boolean;
1999+
19902000
/**
19912001
* Amount of audio to include before the VAD detected speech (in milliseconds).
19922002
* Defaults to 300ms.

src/resources/beta/realtime/sessions.ts

+22-2
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,19 @@ export namespace Session {
168168
* volume and respond at the end of user speech.
169169
*/
170170
export interface TurnDetection {
171+
/**
172+
* Whether or not to automatically generate a response when a VAD stop event
173+
* occurs. `true` by default.
174+
*/
175+
create_response?: boolean;
176+
177+
/**
178+
* Whether or not to automatically interrupt any ongoing response with output to
179+
* the default conversation (i.e. `conversation` of `auto`) when a VAD start event
180+
* occurs. `true` by default.
181+
*/
182+
interrupt_response?: boolean;
183+
171184
/**
172185
* Amount of audio to include before the VAD detected speech (in milliseconds).
173186
* Defaults to 300ms.
@@ -532,11 +545,18 @@ export namespace SessionCreateParams {
532545
*/
533546
export interface TurnDetection {
534547
/**
535-
* Whether or not to automatically generate a response when VAD is enabled. `true`
536-
* by default.
548+
* Whether or not to automatically generate a response when a VAD stop event
549+
* occurs. `true` by default.
537550
*/
538551
create_response?: boolean;
539552

553+
/**
554+
* Whether or not to automatically interrupt any ongoing response with output to
555+
* the default conversation (i.e. `conversation` of `auto`) when a VAD start event
556+
* occurs. `true` by default.
557+
*/
558+
interrupt_response?: boolean;
559+
540560
/**
541561
* Amount of audio to include before the VAD detected speech (in milliseconds).
542562
* Defaults to 300ms.

src/resources/chat/chat.ts

+2
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ export type ChatModel =
6161
| 'o1-preview-2024-09-12'
6262
| 'o1-mini'
6363
| 'o1-mini-2024-09-12'
64+
| 'gpt-4.5-preview'
65+
| 'gpt-4.5-preview-2025-02-27'
6466
| 'gpt-4o'
6567
| 'gpt-4o-2024-11-20'
6668
| 'gpt-4o-2024-08-06'

src/resources/files.ts

+5
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,11 @@ export interface FileObject {
173173
*/
174174
status: 'uploaded' | 'processed' | 'error';
175175

176+
/**
177+
* The Unix timestamp (in seconds) for when the file will expire.
178+
*/
179+
expires_at?: number;
180+
176181
/**
177182
* @deprecated Deprecated. For details on why a fine-tuning training file failed
178183
* validation, see the `error` field on `fine_tuning.job`.

src/resources/uploads/uploads.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export interface Upload {
8686
created_at: number;
8787

8888
/**
89-
* The Unix timestamp (in seconds) for when the Upload was created.
89+
* The Unix timestamp (in seconds) for when the Upload will expire.
9090
*/
9191
expires_at: number;
9292

0 commit comments

Comments
 (0)