Skip to content

release: 4.98.0 #1493

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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '20'

- name: Bootstrap
run: ./scripts/bootstrap
Expand All @@ -92,7 +92,7 @@ jobs:
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '20'
- name: Install dependencies
run: |
yarn install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-jsr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '18'
node-version: '20'

- name: Install dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '18'
node-version: '20'

- name: Install dependencies
run: |
Expand Down
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.97.0"
".": "4.98.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 97
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-0ee6b36cf3cc278cef4199a6aec5f7d530a6c1f17a74830037e96d50ca1edc50.yml
openapi_spec_hash: e8ec5f46bc0655b34f292422d58a60f6
config_hash: d9b6b6e6bc85744663e300eebc482067
configured_endpoints: 101
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-794a6ed3c3d3d77887564755168056af8a426b17cf1ec721e3a300503dc22a41.yml
openapi_spec_hash: 25a81c220713cd5b0bafc221d1dfa79a
config_hash: 0b768ed1b56c6d82816f0fa40dc4aaf5
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Changelog

## 4.98.0 (2025-05-08)

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

### Features

* **api:** Add reinforcement fine-tuning api support ([4aa7a79](https://github.com/openai/openai-node/commit/4aa7a7954c63caa26cc1640ace56093fe1cafa04))


### Chores

* **ci:** bump node version for release workflows ([2961f63](https://github.com/openai/openai-node/commit/2961f63c4d5b8ae8efdf8ea6581aa83c6b0f722e))
* **internal:** fix formatting ([91a44fe](https://github.com/openai/openai-node/commit/91a44fe11c0847dc50d48a03a8d409ac4bece37a))


### Documentation

* add examples to tsdocs ([7d841b7](https://github.com/openai/openai-node/commit/7d841b7f98eb542a398fb9de12056125e8d6cb22))

## 4.97.0 (2025-05-02)

Full Changelog: [v4.96.2...v4.97.0](https://github.com/openai/openai-node/compare/v4.96.2...v4.97.0)
Expand Down
43 changes: 40 additions & 3 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,17 @@ Methods:

# FineTuning

## Methods

Types:

- <code><a href="./src/resources/fine-tuning/methods.ts">DpoHyperparameters</a></code>
- <code><a href="./src/resources/fine-tuning/methods.ts">DpoMethod</a></code>
- <code><a href="./src/resources/fine-tuning/methods.ts">ReinforcementHyperparameters</a></code>
- <code><a href="./src/resources/fine-tuning/methods.ts">ReinforcementMethod</a></code>
- <code><a href="./src/resources/fine-tuning/methods.ts">SupervisedHyperparameters</a></code>
- <code><a href="./src/resources/fine-tuning/methods.ts">SupervisedMethod</a></code>

## Jobs

Types:
Expand All @@ -224,6 +235,8 @@ Methods:
- <code title="get /fine_tuning/jobs">client.fineTuning.jobs.<a href="./src/resources/fine-tuning/jobs/jobs.ts">list</a>({ ...params }) -> FineTuningJobsPage</code>
- <code title="post /fine_tuning/jobs/{fine_tuning_job_id}/cancel">client.fineTuning.jobs.<a href="./src/resources/fine-tuning/jobs/jobs.ts">cancel</a>(fineTuningJobId) -> FineTuningJob</code>
- <code title="get /fine_tuning/jobs/{fine_tuning_job_id}/events">client.fineTuning.jobs.<a href="./src/resources/fine-tuning/jobs/jobs.ts">listEvents</a>(fineTuningJobId, { ...params }) -> FineTuningJobEventsPage</code>
- <code title="post /fine_tuning/jobs/{fine_tuning_job_id}/pause">client.fineTuning.jobs.<a href="./src/resources/fine-tuning/jobs/jobs.ts">pause</a>(fineTuningJobId) -> FineTuningJob</code>
- <code title="post /fine_tuning/jobs/{fine_tuning_job_id}/resume">client.fineTuning.jobs.<a href="./src/resources/fine-tuning/jobs/jobs.ts">resume</a>(fineTuningJobId) -> FineTuningJob</code>

### Checkpoints

Expand Down Expand Up @@ -251,6 +264,33 @@ Methods:
- <code title="get /fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions">client.fineTuning.checkpoints.permissions.<a href="./src/resources/fine-tuning/checkpoints/permissions.ts">retrieve</a>(fineTunedModelCheckpoint, { ...params }) -> PermissionRetrieveResponse</code>
- <code title="delete /fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions/{permission_id}">client.fineTuning.checkpoints.permissions.<a href="./src/resources/fine-tuning/checkpoints/permissions.ts">del</a>(fineTunedModelCheckpoint, permissionId) -> PermissionDeleteResponse</code>

## Alpha

### Graders

Types:

- <code><a href="./src/resources/fine-tuning/alpha/graders.ts">GraderRunResponse</a></code>
- <code><a href="./src/resources/fine-tuning/alpha/graders.ts">GraderValidateResponse</a></code>

Methods:

- <code title="post /fine_tuning/alpha/graders/run">client.fineTuning.alpha.graders.<a href="./src/resources/fine-tuning/alpha/graders.ts">run</a>({ ...params }) -> GraderRunResponse</code>
- <code title="post /fine_tuning/alpha/graders/validate">client.fineTuning.alpha.graders.<a href="./src/resources/fine-tuning/alpha/graders.ts">validate</a>({ ...params }) -> GraderValidateResponse</code>

# Graders

## GraderModels

Types:

- <code><a href="./src/resources/graders/grader-models.ts">LabelModelGrader</a></code>
- <code><a href="./src/resources/graders/grader-models.ts">MultiGrader</a></code>
- <code><a href="./src/resources/graders/grader-models.ts">PythonGrader</a></code>
- <code><a href="./src/resources/graders/grader-models.ts">ScoreModelGrader</a></code>
- <code><a href="./src/resources/graders/grader-models.ts">StringCheckGrader</a></code>
- <code><a href="./src/resources/graders/grader-models.ts">TextSimilarityGrader</a></code>

# VectorStores

Types:
Expand Down Expand Up @@ -669,10 +709,7 @@ Methods:
Types:

- <code><a href="./src/resources/evals/evals.ts">EvalCustomDataSourceConfig</a></code>
- <code><a href="./src/resources/evals/evals.ts">EvalLabelModelGrader</a></code>
- <code><a href="./src/resources/evals/evals.ts">EvalStoredCompletionsDataSourceConfig</a></code>
- <code><a href="./src/resources/evals/evals.ts">EvalStringCheckGrader</a></code>
- <code><a href="./src/resources/evals/evals.ts">EvalTextSimilarityGrader</a></code>
- <code><a href="./src/resources/evals/evals.ts">EvalCreateResponse</a></code>
- <code><a href="./src/resources/evals/evals.ts">EvalRetrieveResponse</a></code>
- <code><a href="./src/resources/evals/evals.ts">EvalUpdateResponse</a></code>
Expand Down
2 changes: 1 addition & 1 deletion examples/azure/realtime/websocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ async function main() {
rt.socket.addEventListener('close', () => console.log('\nConnection closed!'));
}

main();
main();
2 changes: 1 addition & 1 deletion examples/azure/realtime/ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ async function main() {
rt.socket.on('close', () => console.log('\nConnection closed!'));
}

main();
main();
2 changes: 1 addition & 1 deletion examples/realtime/websocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ async function main() {
rt.socket.addEventListener('close', () => console.log('\nConnection closed!'));
}

main();
main();
2 changes: 1 addition & 1 deletion examples/realtime/ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ async function main() {
rt.socket.on('close', () => console.log('\nConnection closed!'));
}

main();
main();
2 changes: 1 addition & 1 deletion examples/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "../tsconfig.json"
"extends": "../tsconfig.json"
}
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.97.0",
"version": "4.98.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.97.0",
"version": "4.98.0",
"description": "The official TypeScript library for the OpenAI API",
"author": "OpenAI <support@openai.com>",
"types": "dist/index.d.ts",
Expand Down
11 changes: 5 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,17 @@ import {
EvalCreateResponse,
EvalCustomDataSourceConfig,
EvalDeleteResponse,
EvalLabelModelGrader,
EvalListParams,
EvalListResponse,
EvalListResponsesPage,
EvalRetrieveResponse,
EvalStoredCompletionsDataSourceConfig,
EvalStringCheckGrader,
EvalTextSimilarityGrader,
EvalUpdateParams,
EvalUpdateResponse,
Evals,
} from './resources/evals/evals';
import { FineTuning } from './resources/fine-tuning/fine-tuning';
import { Graders } from './resources/graders/graders';
import { Responses } from './resources/responses/responses';
import {
Upload,
Expand Down Expand Up @@ -305,6 +303,7 @@ export class OpenAI extends Core.APIClient {
moderations: API.Moderations = new API.Moderations(this);
models: API.Models = new API.Models(this);
fineTuning: API.FineTuning = new API.FineTuning(this);
graders: API.Graders = new API.Graders(this);
vectorStores: API.VectorStores = new API.VectorStores(this);
beta: API.Beta = new API.Beta(this);
batches: API.Batches = new API.Batches(this);
Expand Down Expand Up @@ -366,6 +365,7 @@ OpenAI.Moderations = Moderations;
OpenAI.Models = Models;
OpenAI.ModelsPage = ModelsPage;
OpenAI.FineTuning = FineTuning;
OpenAI.Graders = Graders;
OpenAI.VectorStores = VectorStores;
OpenAI.VectorStoresPage = VectorStoresPage;
OpenAI.VectorStoreSearchResponsesPage = VectorStoreSearchResponsesPage;
Expand Down Expand Up @@ -487,6 +487,8 @@ export declare namespace OpenAI {

export { FineTuning as FineTuning };

export { Graders as Graders };

export {
VectorStores as VectorStores,
type AutoFileChunkingStrategyParam as AutoFileChunkingStrategyParam,
Expand Down Expand Up @@ -531,10 +533,7 @@ export declare namespace OpenAI {
export {
Evals as Evals,
type EvalCustomDataSourceConfig as EvalCustomDataSourceConfig,
type EvalLabelModelGrader as EvalLabelModelGrader,
type EvalStoredCompletionsDataSourceConfig as EvalStoredCompletionsDataSourceConfig,
type EvalStringCheckGrader as EvalStringCheckGrader,
type EvalTextSimilarityGrader as EvalTextSimilarityGrader,
type EvalCreateResponse as EvalCreateResponse,
type EvalRetrieveResponse as EvalRetrieveResponse,
type EvalUpdateResponse as EvalUpdateResponse,
Expand Down
12 changes: 12 additions & 0 deletions src/resources/audio/speech.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ import { type Response } from '../../_shims/index';
export class Speech extends APIResource {
/**
* Generates audio from the input text.
*
* @example
* ```ts
* const speech = await client.audio.speech.create({
* input: 'input',
* model: 'string',
* voice: 'ash',
* });
*
* const content = await speech.blob();
* console.log(content);
* ```
*/
create(body: SpeechCreateParams, options?: Core.RequestOptions): Core.APIPromise<Response> {
return this._client.post('/audio/speech', {
Expand Down
9 changes: 9 additions & 0 deletions src/resources/audio/transcriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ import { Stream } from '../../streaming';
export class Transcriptions extends APIResource {
/**
* Transcribes audio into the input language.
*
* @example
* ```ts
* const transcription =
* await client.audio.transcriptions.create({
* file: fs.createReadStream('speech.mp3'),
* model: 'gpt-4o-transcribe',
* });
* ```
*/
create(
body: TranscriptionCreateParamsNonStreaming<'json' | undefined>,
Expand Down
8 changes: 8 additions & 0 deletions src/resources/audio/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ import * as TranscriptionsAPI from './transcriptions';
export class Translations extends APIResource {
/**
* Translates audio into English.
*
* @example
* ```ts
* const translation = await client.audio.translations.create({
* file: fs.createReadStream('speech.mp3'),
* model: 'whisper-1',
* });
* ```
*/
create(
body: TranslationCreateParams<'json' | undefined>,
Expand Down
36 changes: 36 additions & 0 deletions src/resources/beta/assistants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ import { AssistantStream } from '../../lib/AssistantStream';
export class Assistants extends APIResource {
/**
* Create an assistant with a model and instructions.
*
* @example
* ```ts
* const assistant = await client.beta.assistants.create({
* model: 'gpt-4o',
* });
* ```
*/
create(body: AssistantCreateParams, options?: Core.RequestOptions): Core.APIPromise<Assistant> {
return this._client.post('/assistants', {
Expand All @@ -25,6 +32,13 @@ export class Assistants extends APIResource {

/**
* Retrieves an assistant.
*
* @example
* ```ts
* const assistant = await client.beta.assistants.retrieve(
* 'assistant_id',
* );
* ```
*/
retrieve(assistantId: string, options?: Core.RequestOptions): Core.APIPromise<Assistant> {
return this._client.get(`/assistants/${assistantId}`, {
Expand All @@ -35,6 +49,13 @@ export class Assistants extends APIResource {

/**
* Modifies an assistant.
*
* @example
* ```ts
* const assistant = await client.beta.assistants.update(
* 'assistant_id',
* );
* ```
*/
update(
assistantId: string,
Expand All @@ -50,6 +71,14 @@ export class Assistants extends APIResource {

/**
* Returns a list of assistants.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const assistant of client.beta.assistants.list()) {
* // ...
* }
* ```
*/
list(
query?: AssistantListParams,
Expand All @@ -72,6 +101,13 @@ export class Assistants extends APIResource {

/**
* Delete an assistant.
*
* @example
* ```ts
* const assistantDeleted = await client.beta.assistants.del(
* 'assistant_id',
* );
* ```
*/
del(assistantId: string, options?: Core.RequestOptions): Core.APIPromise<AssistantDeleted> {
return this._client.delete(`/assistants/${assistantId}`, {
Expand Down
6 changes: 6 additions & 0 deletions src/resources/beta/realtime/sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ export class Sessions extends APIResource {
* It responds with a session object, plus a `client_secret` key which contains a
* usable ephemeral API token that can be used to authenticate browser clients for
* the Realtime API.
*
* @example
* ```ts
* const session =
* await client.beta.realtime.sessions.create();
* ```
*/
create(body: SessionCreateParams, options?: Core.RequestOptions): Core.APIPromise<SessionCreateResponse> {
return this._client.post('/realtime/sessions', {
Expand Down
6 changes: 6 additions & 0 deletions src/resources/beta/realtime/transcription-sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ export class TranscriptionSessions extends APIResource {
* It responds with a session object, plus a `client_secret` key which contains a
* usable ephemeral API token that can be used to authenticate browser clients for
* the Realtime API.
*
* @example
* ```ts
* const transcriptionSession =
* await client.beta.realtime.transcriptionSessions.create();
* ```
*/
create(
body: TranscriptionSessionCreateParams,
Expand Down
Loading