Skip to content

release: 4.90.0 #1421

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "4.89.1"
".": "4.90.0"
}
4 changes: 3 additions & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
configured_endpoints: 82
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-5ad6884898c07591750dde560118baf7074a59aecd1f367f930c5e42b04e848a.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-6663c59193eb95b201e492de17dcbd5e126ba03d18ce66287a3e2c632ca56fe7.yml
openapi_spec_hash: 7996d2c34cc44fe2ce9ffe93c0ab774e
config_hash: 9351ea829c2b41da3b48a38c934c92ee
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

## 4.90.0 (2025-03-27)

Full Changelog: [v4.89.1...v4.90.0](https://github.com/openai/openai-node/compare/v4.89.1...v4.90.0)

### Features

* **api:** add `get /chat/completions` endpoint ([2d6710a](https://github.com/openai/openai-node/commit/2d6710a1f9dd4f768d9c73e9c9f5f93c737cdc66))


### Bug Fixes

* **audio:** correctly handle transcription streaming ([2a9b603](https://github.com/openai/openai-node/commit/2a9b60336cd40a4d4fb9b898ece49170ad648fd0))
* **internal:** work around https://github.com/vercel/next.js/issues/76881 ([#1427](https://github.com/openai/openai-node/issues/1427)) ([b467e94](https://github.com/openai/openai-node/commit/b467e949476621e8e92587a83c9de6fab35b2b9d))


### Chores

* add hash of OpenAPI spec/config inputs to .stats.yml ([45db35e](https://github.com/openai/openai-node/commit/45db35e34be560c75bf36224cc153c6d0e6e2a88))
* **api:** updates to supported Voice IDs ([#1424](https://github.com/openai/openai-node/issues/1424)) ([404f4db](https://github.com/openai/openai-node/commit/404f4db41a2ee651f5bfdaa7b8881e1bf015f058))
* **client:** expose headers on some streaming errors ([#1423](https://github.com/openai/openai-node/issues/1423)) ([b0783cc](https://github.com/openai/openai-node/commit/b0783cc6221b68f1738e759b393756a7d0e540a3))

## 4.89.1 (2025-03-26)

Full Changelog: [v4.89.0...v4.89.1](https://github.com/openai/openai-node/compare/v4.89.0...v4.89.1)
Expand Down
2 changes: 1 addition & 1 deletion jsr.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openai/openai",
"version": "4.89.1",
"version": "4.90.0",
"exports": {
".": "./index.ts",
"./helpers/zod": "./helpers/zod.ts",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "openai",
"version": "4.89.1",
"version": "4.90.0",
"description": "The official TypeScript library for the OpenAI API",
"author": "OpenAI <[email protected]>",
"types": "dist/index.d.ts",
Expand Down
2 changes: 2 additions & 0 deletions src/_shims/index-deno.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,5 @@ export declare class FsReadStream extends Readable {
const _ReadableStream = ReadableStream;
type _ReadableStream = ReadableStream;
export { _ReadableStream as ReadableStream };

export const init = () => {};
2 changes: 2 additions & 0 deletions src/_shims/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,5 @@ export function fileFromPath(path: string, options?: FileFromPathOptions): Promi
export function fileFromPath(path: string, filename?: string, options?: FileFromPathOptions): Promise<File>;

export function isFsReadStream(value: any): value is FsReadStream;

export const init: () => void;
6 changes: 5 additions & 1 deletion src/_shims/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
*/
const shims = require('./registry');
const auto = require('openai/_shims/auto/runtime');
if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true });
exports.init = () => {
if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true });
};
for (const property of Object.keys(shims)) {
Object.defineProperty(exports, property, {
get() {
return shims[property];
},
});
}

exports.init();
6 changes: 5 additions & 1 deletion src/_shims/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,9 @@
*/
import * as shims from './registry.mjs';
import * as auto from 'openai/_shims/auto/runtime';
if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true });
export const init = () => {
if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true });
};
export * from './registry.mjs';

init();
5 changes: 5 additions & 0 deletions src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ import {
type RequestInit,
type Response,
type HeadersInit,
init,
} from './_shims/index';

// try running side effects outside of _shims/index to workaround https://github.com/vercel/next.js/issues/76881
init();

export { type Response };
import { BlobLike, isBlobLike, isMultipartBody } from './uploads';
export {
Expand Down
18 changes: 15 additions & 3 deletions src/resources/audio/speech.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,23 @@ export interface SpeechCreateParams {

/**
* The voice to use when generating the audio. Supported voices are `alloy`, `ash`,
* `coral`, `echo`, `fable`, `onyx`, `nova`, `sage` and `shimmer`. Previews of the
* voices are available in the
* `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and
* `verse`. Previews of the voices are available in the
* [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
*/
voice: 'alloy' | 'ash' | 'coral' | 'echo' | 'fable' | 'onyx' | 'nova' | 'sage' | 'shimmer';
voice:
| (string & {})
| 'alloy'
| 'ash'
| 'ballad'
| 'coral'
| 'echo'
| 'fable'
| 'onyx'
| 'nova'
| 'sage'
| 'shimmer'
| 'verse';

/**
* Control the voice of your generated audio with additional instructions. Does not
Expand Down
7 changes: 6 additions & 1 deletion src/resources/audio/transcriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ export class Transcriptions extends APIResource {
): Core.APIPromise<TranscriptionCreateResponse | string | Stream<TranscriptionStreamEvent>> {
return this._client.post(
'/audio/transcriptions',
Core.multipartFormRequestOptions({ body, ...options, __metadata: { model: body.model } }),
Core.multipartFormRequestOptions({
body,
...options,
stream: body.stream ?? false,
__metadata: { model: body.model },
}),
);
}
}
Expand Down
61 changes: 50 additions & 11 deletions src/resources/beta/realtime/realtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1005,9 +1005,22 @@ export interface RealtimeResponse {

/**
* The voice the model used to respond. Current voice options are `alloy`, `ash`,
* `ballad`, `coral`, `echo` `sage`, `shimmer` and `verse`.
*/
voice?: 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse';
* `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and
* `verse`.
*/
voice?:
| (string & {})
| 'alloy'
| 'ash'
| 'ballad'
| 'coral'
| 'echo'
| 'fable'
| 'onyx'
| 'nova'
| 'sage'
| 'shimmer'
| 'verse';
}

/**
Expand Down Expand Up @@ -1620,9 +1633,22 @@ export namespace ResponseCreateEvent {
/**
* The voice the model uses to respond. Voice cannot be changed during the session
* once the model has responded with audio at least once. Current voice options are
* `alloy`, `ash`, `ballad`, `coral`, `echo` `sage`, `shimmer` and `verse`.
*/
voice?: 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse';
* `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`,
* `shimmer`, and `verse`.
*/
voice?:
| (string & {})
| 'alloy'
| 'ash'
| 'ballad'
| 'coral'
| 'echo'
| 'fable'
| 'onyx'
| 'nova'
| 'sage'
| 'shimmer'
| 'verse';
}

export namespace Response {
Expand Down Expand Up @@ -2078,9 +2104,22 @@ export namespace SessionUpdateEvent {
/**
* The voice the model uses to respond. Voice cannot be changed during the session
* once the model has responded with audio at least once. Current voice options are
* `alloy`, `ash`, `ballad`, `coral`, `echo` `sage`, `shimmer` and `verse`.
*/
voice?: 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse';
* `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`,
* `shimmer`, and `verse`.
*/
voice?:
| (string & {})
| 'alloy'
| 'ash'
| 'ballad'
| 'coral'
| 'echo'
| 'fable'
| 'onyx'
| 'nova'
| 'sage'
| 'shimmer'
| 'verse';
}

export namespace Session {
Expand Down Expand Up @@ -2376,7 +2415,7 @@ export namespace TranscriptionSessionUpdate {
export interface TurnDetection {
/**
* Whether or not to automatically generate a response when a VAD stop event
* occurs.
* occurs. Not available for transcription sessions.
*/
create_response?: boolean;

Expand All @@ -2390,7 +2429,7 @@ export namespace TranscriptionSessionUpdate {
/**
* Whether or not to automatically interrupt any ongoing response with output to
* the default conversation (i.e. `conversation` of `auto`) when a VAD start event
* occurs.
* occurs. Not available for transcription sessions.
*/
interrupt_response?: boolean;

Expand Down
47 changes: 42 additions & 5 deletions src/resources/beta/realtime/sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,19 @@ export interface Session {
* once the model has responded with audio at least once. Current voice options are
* `alloy`, `ash`, `ballad`, `coral`, `echo` `sage`, `shimmer` and `verse`.
*/
voice?: 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse';
voice?:
| (string & {})
| 'alloy'
| 'ash'
| 'ballad'
| 'coral'
| 'echo'
| 'fable'
| 'onyx'
| 'nova'
| 'sage'
| 'shimmer'
| 'verse';
}

export namespace Session {
Expand Down Expand Up @@ -361,7 +373,19 @@ export interface SessionCreateResponse {
* once the model has responded with audio at least once. Current voice options are
* `alloy`, `ash`, `ballad`, `coral`, `echo` `sage`, `shimmer` and `verse`.
*/
voice?: 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse';
voice?:
| (string & {})
| 'alloy'
| 'ash'
| 'ballad'
| 'coral'
| 'echo'
| 'fable'
| 'onyx'
| 'nova'
| 'sage'
| 'shimmer'
| 'verse';
}

export namespace SessionCreateResponse {
Expand Down Expand Up @@ -561,9 +585,22 @@ export interface SessionCreateParams {
/**
* The voice the model uses to respond. Voice cannot be changed during the session
* once the model has responded with audio at least once. Current voice options are
* `alloy`, `ash`, `ballad`, `coral`, `echo` `sage`, `shimmer` and `verse`.
*/
voice?: 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse';
* `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`,
* `shimmer`, and `verse`.
*/
voice?:
| (string & {})
| 'alloy'
| 'ash'
| 'ballad'
| 'coral'
| 'echo'
| 'fable'
| 'onyx'
| 'nova'
| 'sage'
| 'shimmer'
| 'verse';
}

export namespace SessionCreateParams {
Expand Down
4 changes: 2 additions & 2 deletions src/resources/beta/realtime/transcription-sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ export namespace TranscriptionSessionCreateParams {
export interface TurnDetection {
/**
* Whether or not to automatically generate a response when a VAD stop event
* occurs.
* occurs. Not available for transcription sessions.
*/
create_response?: boolean;

Expand All @@ -269,7 +269,7 @@ export namespace TranscriptionSessionCreateParams {
/**
* Whether or not to automatically interrupt any ongoing response with output to
* the default conversation (i.e. `conversation` of `auto`) when a VAD start event
* occurs.
* occurs. Not available for transcription sessions.
*/
interrupt_response?: boolean;

Expand Down
14 changes: 13 additions & 1 deletion src/resources/chat/completions/completions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,19 @@ export interface ChatCompletionAudioParam {
* The voice the model uses to respond. Supported voices are `alloy`, `ash`,
* `ballad`, `coral`, `echo`, `sage`, and `shimmer`.
*/
voice: 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse';
voice:
| (string & {})
| 'alloy'
| 'ash'
| 'ballad'
| 'coral'
| 'echo'
| 'fable'
| 'onyx'
| 'nova'
| 'sage'
| 'shimmer'
| 'verse';
}

/**
Expand Down
6 changes: 6 additions & 0 deletions src/resources/responses/input-items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ export interface InputItemListParams extends CursorPageParams {
*/
before?: string;

/**
* Additional fields to include in the response. See the `include` parameter for
* Response creation above for more information.
*/
include?: Array<ResponsesAPI.ResponseIncludable>;

/**
* The order to return the input items in. Default is `asc`.
*
Expand Down
Loading