From c1dd50576da14f1ed9e988fc5e4704b87d2d14b1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Mar 2025 19:21:32 +0000 Subject: [PATCH 1/2] chore(internal): remove CI condition (#1381) --- .github/workflows/ci.yml | 5 ++- .github/workflows/create-releases.yml | 50 --------------------------- .github/workflows/publish-jsr.yml | 8 +++-- .github/workflows/publish-npm.yml | 8 +++-- .github/workflows/release-doctor.yml | 1 - .release-please-manifest.json | 2 +- .stats.yml | 2 +- bin/check-release-environment | 4 --- jsr.json | 2 +- package.json | 2 +- src/version.ts | 2 +- 11 files changed, 19 insertions(+), 67 deletions(-) delete mode 100644 .github/workflows/create-releases.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a2ee42033..cd67d9265 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: lint: name: lint runs-on: ubuntu-latest - if: github.repository == 'openai/openai-node' + steps: - uses: actions/checkout@v4 @@ -31,7 +31,7 @@ jobs: build: name: build runs-on: ubuntu-latest - if: github.repository == 'openai/openai-node' + steps: - uses: actions/checkout@v4 @@ -49,7 +49,6 @@ jobs: test: name: test runs-on: ubuntu-latest - if: github.repository == 'openai/openai-node' steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/create-releases.yml b/.github/workflows/create-releases.yml deleted file mode 100644 index 19b7dd831..000000000 --- a/.github/workflows/create-releases.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Create releases -on: - schedule: - - cron: '0 5 * * *' # every day at 5am UTC - push: - branches: - - master - -jobs: - release: - name: release - if: github.ref == 'refs/heads/master' && github.repository == 'openai/openai-node' - runs-on: ubuntu-latest - environment: publish - permissions: - contents: read - id-token: write - - steps: - - uses: actions/checkout@v4 - - - uses: stainless-api/trigger-release-please@v1 - id: release - with: - repo: ${{ github.event.repository.full_name }} - stainless-api-key: ${{ secrets.STAINLESS_API_KEY }} - - - name: Set up Node - if: ${{ steps.release.outputs.releases_created }} - uses: actions/setup-node@v3 - with: - node-version: '18' - - - name: Install dependencies - if: ${{ steps.release.outputs.releases_created }} - run: | - yarn install - - - name: Publish to NPM - if: ${{ steps.release.outputs.releases_created }} - run: | - bash ./bin/publish-npm - env: - NPM_TOKEN: ${{ secrets.OPENAI_NPM_TOKEN || secrets.NPM_TOKEN }} - - - name: Publish to JSR - if: ${{ steps.release.outputs.releases_created }} - run: | - bash ./bin/publish-jsr - diff --git a/.github/workflows/publish-jsr.yml b/.github/workflows/publish-jsr.yml index 1e46d6bfb..dc5fe0a2a 100644 --- a/.github/workflows/publish-jsr.yml +++ b/.github/workflows/publish-jsr.yml @@ -1,9 +1,13 @@ -# workflow for re-running publishing to JSR in case it fails for some reason -# you can run this workflow by navigating to https://www.github.com/openai/openai-node/actions/workflows/publish-jsr.yml +# This workflow is triggered when a GitHub release is created. +# It can also be run manually to re-publish to JSR in case it failed for some reason. +# You can run this workflow by navigating to https://www.github.com/openai/openai-node/actions/workflows/publish-jsr.yml name: Publish JSR on: workflow_dispatch: + release: + types: [published] + jobs: publish: name: publish diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 5a3711b53..d3b184555 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -1,9 +1,13 @@ -# workflow for re-running publishing to NPM in case it fails for some reason -# you can run this workflow by navigating to https://www.github.com/openai/openai-node/actions/workflows/publish-npm.yml +# This workflow is triggered when a GitHub release is created. +# It can also be run manually to re-publish to NPM in case it failed for some reason. +# You can run this workflow by navigating to https://www.github.com/openai/openai-node/actions/workflows/publish-npm.yml name: Publish NPM on: workflow_dispatch: + release: + types: [published] + jobs: publish: name: publish diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 37bc09e80..754a44931 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -19,6 +19,5 @@ jobs: run: | bash ./bin/check-release-environment env: - STAINLESS_API_KEY: ${{ secrets.STAINLESS_API_KEY }} NPM_TOKEN: ${{ secrets.OPENAI_NPM_TOKEN || secrets.NPM_TOKEN }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 9516f2682..0c7a85094 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.47.1" + ".": "4.87.3" } diff --git a/.stats.yml b/.stats.yml index edc2aaf89..53c73037d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 81 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-c8579861bc21d4d2155a5b9e8e7d54faee8083730673c4d32cbbe573d7fb4116.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-c8579861bc21d4d2155a5b9e8e7d54faee8083730673c4d32cbbe573d7fb4116.yml diff --git a/bin/check-release-environment b/bin/check-release-environment index dbfd546bf..e51564b7d 100644 --- a/bin/check-release-environment +++ b/bin/check-release-environment @@ -2,10 +2,6 @@ errors=() -if [ -z "${STAINLESS_API_KEY}" ]; then - errors+=("The STAINLESS_API_KEY secret has not been set. Please contact Stainless for an API key & set it in your organization secrets on GitHub.") -fi - if [ -z "${NPM_TOKEN}" ]; then errors+=("The OPENAI_NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets") fi diff --git a/jsr.json b/jsr.json index fefb5b291..980657e4e 100644 --- a/jsr.json +++ b/jsr.json @@ -1,6 +1,6 @@ { "name": "@openai/openai", - "version": "4.47.1", + "version": "4.87.3", "exports": "./index.ts", "publish": { "exclude": ["!."] diff --git a/package.json b/package.json index da00d4a4f..25d2b6c52 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openai", - "version": "4.47.1", + "version": "4.87.3", "description": "The official TypeScript library for the OpenAI API", "author": "OpenAI ", "types": "dist/index.d.ts", diff --git a/src/version.ts b/src/version.ts index 710b8f27e..e84192528 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '4.47.1'; // x-release-please-version +export const VERSION = '4.87.3'; // x-release-please-version From 423607e5c43653f340fba25c5e0b37e1d2df16b2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 18 Mar 2025 14:56:08 +0000 Subject: [PATCH 2/2] chore: add missing type alias exports --- src/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/index.ts b/src/index.ts index c9b2d4415..bf329be41 100644 --- a/src/index.ts +++ b/src/index.ts @@ -118,6 +118,7 @@ import { ChatCompletionModality, ChatCompletionNamedToolChoice, ChatCompletionPredictionContent, + ChatCompletionReasoningEffort, ChatCompletionRole, ChatCompletionStoreMessage, ChatCompletionStreamOptions, @@ -129,6 +130,7 @@ import { ChatCompletionUpdateParams, ChatCompletionUserMessageParam, ChatCompletionsPage, + CreateChatCompletionRequestMessage, } from './resources/chat/completions/completions'; export interface ClientOptions { @@ -404,6 +406,8 @@ export declare namespace OpenAI { type ChatCompletionToolChoiceOption as ChatCompletionToolChoiceOption, type ChatCompletionToolMessageParam as ChatCompletionToolMessageParam, type ChatCompletionUserMessageParam as ChatCompletionUserMessageParam, + type CreateChatCompletionRequestMessage as CreateChatCompletionRequestMessage, + type ChatCompletionReasoningEffort as ChatCompletionReasoningEffort, ChatCompletionsPage as ChatCompletionsPage, type ChatCompletionCreateParams as ChatCompletionCreateParams, type ChatCompletionCreateParamsNonStreaming as ChatCompletionCreateParamsNonStreaming,