Skip to content

Commit 95f3690

Browse files
authored
Merge pull request #837 from openai/release-please--branches--master--changes--next--components--openai
2 parents 2a12cfd + 1a4d37a commit 95f3690

File tree

12 files changed

+380
-81
lines changed

12 files changed

+380
-81
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "4.44.0"
2+
".": "4.45.0"
33
}

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
## 4.45.0 (2024-05-11)
4+
5+
Full Changelog: [v4.44.0...v4.45.0](https://github.com/openai/openai-node/compare/v4.44.0...v4.45.0)
6+
7+
### Features
8+
9+
* **azure:** batch api ([#839](https://github.com/openai/openai-node/issues/839)) ([e279f8c](https://github.com/openai/openai-node/commit/e279f8c51aa80cb913ccb6df647407bea1f2f071))
10+
11+
12+
### Chores
13+
14+
* **dependency:** bumped Next.js version ([#836](https://github.com/openai/openai-node/issues/836)) ([babb140](https://github.com/openai/openai-node/commit/babb1404751059bdd171b792d03fd21272dd8f8b))
15+
* **docs:** add SECURITY.md ([#838](https://github.com/openai/openai-node/issues/838)) ([6e556d9](https://github.com/openai/openai-node/commit/6e556d9e12341155cc13fe226ab110d63858370e))
16+
317
## 4.44.0 (2024-05-09)
418

519
Full Changelog: [v4.43.0...v4.44.0](https://github.com/openai/openai-node/compare/v4.43.0...v4.44.0)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ You can import in Deno via:
1919
<!-- x-release-please-start-version -->
2020

2121
```ts
22-
import OpenAI from 'https://deno.land/x/openai@v4.44.0/mod.ts';
22+
import OpenAI from 'https://deno.land/x/openai@v4.45.0/mod.ts';
2323
```
2424

2525
<!-- x-release-please-end -->

SECURITY.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Security Policy
2+
3+
## Reporting Security Issues
4+
5+
This SDK is generated by [Stainless Software Inc](http://stainlessapi.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken.
6+
7+
To report a security issue, please contact the Stainless team at [email protected].
8+
9+
## Responsible Disclosure
10+
11+
We appreciate the efforts of security researchers and individuals who help us maintain the security of
12+
SDKs we generate. If you believe you have found a security vulnerability, please adhere to responsible
13+
disclosure practices by allowing us a reasonable amount of time to investigate and address the issue
14+
before making any information public.
15+
16+
## Reporting Non-SDK Related Security Issues
17+
18+
If you encounter security issues that are not directly related to SDKs but pertain to the services
19+
or products provided by OpenAI please follow the respective company's security reporting guidelines.
20+
21+
### OpenAI Terms and Policies
22+
23+
Our Security Policy can be found at [Security Policy URL](https://openai.com/policies/coordinated-vulnerability-disclosure-policy).
24+
25+
Please contact [email protected] for any questions or concerns regarding security of our services.
26+
27+
---
28+
29+
Thank you for helping us keep the SDKs and systems they interact with secure.

ecosystem-tests/vercel-edge/package-lock.json

Lines changed: 51 additions & 68 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ecosystem-tests/vercel-edge/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"dependencies": {
1717
"ai": "2.1.34",
18-
"next": "13.5.6",
18+
"next": "14.1.1",
1919
"react": "18.2.0",
2020
"react-dom": "18.2.0"
2121
},

examples/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"private": true,
88
"dependencies": {
99
"express": "^4.18.2",
10-
"next": "^13.5.5",
10+
"next": "^14.1.1",
1111
"openai": "file:..",
1212
"zod-to-json-schema": "^3.21.4"
1313
},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "openai",
3-
"version": "4.44.0",
3+
"version": "4.45.0",
44
"description": "The official TypeScript library for the OpenAI API",
55
"author": "OpenAI <[email protected]>",
66
"types": "dist/index.d.ts",

scripts/build-deno

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This is a build produced from https://github.com/openai/openai-node – please g
1616
Usage:
1717
1818
\`\`\`ts
19-
import OpenAI from "https://deno.land/x/openai@v4.44.0/mod.ts";
19+
import OpenAI from "https://deno.land/x/openai@v4.45.0/mod.ts";
2020
2121
const client = new OpenAI();
2222
\`\`\`

src/index.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ export interface AzureClientOptions extends ClientOptions {
346346
/** API Client for interfacing with the Azure OpenAI API. */
347347
export class AzureOpenAI extends OpenAI {
348348
private _azureADTokenProvider: (() => Promise<string>) | undefined;
349+
private _deployment: string | undefined;
349350
apiVersion: string = '';
350351
/**
351352
* API Client for interfacing with the Azure OpenAI API.
@@ -412,11 +413,7 @@ export class AzureOpenAI extends OpenAI {
412413
);
413414
}
414415

415-
if (deployment) {
416-
baseURL = `${endpoint}/openai/deployments/${deployment}`;
417-
} else {
418-
baseURL = `${endpoint}/openai`;
419-
}
416+
baseURL = `${endpoint}/openai`;
420417
} else {
421418
if (endpoint) {
422419
throw new Errors.OpenAIError('baseURL and endpoint are mutually exclusive');
@@ -432,6 +429,7 @@ export class AzureOpenAI extends OpenAI {
432429

433430
this._azureADTokenProvider = azureADTokenProvider;
434431
this.apiVersion = apiVersion;
432+
this._deployment = deployment;
435433
}
436434

437435
override buildRequest(options: Core.FinalRequestOptions<unknown>): {
@@ -443,7 +441,7 @@ export class AzureOpenAI extends OpenAI {
443441
if (!Core.isObj(options.body)) {
444442
throw new Error('Expected request body to be an object');
445443
}
446-
const model = options.body['model'];
444+
const model = this._deployment || options.body['model'];
447445
delete options.body['model'];
448446
if (model !== undefined && !this.baseURL.includes('/deployments')) {
449447
options.path = `/deployments/${model}${options.path}`;
@@ -494,6 +492,7 @@ const _deployments_endpoints = new Set([
494492
'/audio/translations',
495493
'/audio/speech',
496494
'/images/generations',
495+
'/batches',
497496
]);
498497

499498
const API_KEY_SENTINEL = '<Missing Key>';

0 commit comments

Comments
 (0)