Skip to content

Commit

Permalink
[OpenAI] Stable v2 (#31469)
Browse files Browse the repository at this point in the history
### Packages impacted by this PR
@azure/openai

### Issues associated with this PR
N/A

### Describe the problem that is addressed by this PR
Preparing for releasing v2.0 that targets API
[v2024-10-21](https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/stable/2024-10-21/inference.json).

### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?
N/A

### Are there test cases added in this PR? _(If not, why?)_
N/A

### Provide a list of related PRs _(if any)_
N/A

### Command used to generate this PR:**_(Applicable only to SDK release
request PRs)_

### Checklists
- [x] Added impacted package name to the issue description
- [ ] Does this PR needs any fixes in the SDK Generator?** _(If so,
create an Issue in the
[Autorest/typescript](https://github.com/Azure/autorest.typescript)
repository and link it here)_
- [x] Added a changelog (if necessary)

---------

Co-authored-by: Krista Pratico <[email protected]>
  • Loading branch information
deyaaeldeen and kristapratico authored Nov 15, 2024
1 parent b3e5d58 commit a179d22
Show file tree
Hide file tree
Showing 88 changed files with 1,866 additions and 735 deletions.
13 changes: 8 additions & 5 deletions sdk/openai/openai/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# Release History

## 2.0.0-beta.4 (Unreleased)
## 2.0.0 (2024-11-18)

### Features Added
This release marks the first stable library version for `@azure/openai` and it exposes Azure-exclusive features supported in the latest Azure OpenAI Service stable `api-version` label of `2024-10-21`.

### Breaking Changes
The following features are supported in this release:

### Bugs Fixed
- Azure OpenAI On Your Data which enables you to run advanced AI models, without needing to train or fine-tune models, on your own enterprise data located in an Azure Search index or in an vector store in Azure Cosmos DB.
- Azure OpenAI content filtering which detects and prevents the output of harmful content.

### Other Changes
### Breaking Changes

- Models related to features still in preview have been removed.

## 2.0.0-beta.3 (2024-11-05)

Expand Down
2 changes: 1 addition & 1 deletion sdk/openai/openai/MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Migrated code:
```typescript
import { AzureOpenAI } from "openai";
const deployment = "Your Azure OpenAI deployment";
const apiVersion = "2024-08-01-preview";
const apiVersion = "2024-10-21";
const options = { azureADTokenProvider, deployment, apiVersion }
const client = new AzureOpenAI(options);
```
Expand Down
6 changes: 3 additions & 3 deletions sdk/openai/openai/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ There are several ways to authenticate with the Azure OpenAI service and the rec
import { AzureOpenAI } from "openai";
const deployment = "Your deployment name";
const apiVersion = "2024-08-01-preview";
const apiVersion = "2024-10-21";
const client = new AzureOpenAI({ azureADTokenProvider, deployment, apiVersion });
```
Expand Down Expand Up @@ -126,7 +126,7 @@ export async function main() {
const scope = "https://cognitiveservices.azure.com/.default";
const azureADTokenProvider = getBearerTokenProvider(new DefaultAzureCredential(), scope);
const deployment = "gpt-4-1106-preview";
const apiVersion = "2024-08-01-preview";
const apiVersion = "2024-10-21";
const client = new AzureOpenAI({ azureADTokenProvider, deployment, apiVersion });
const events = await client.chat.completions.create({
stream: true,
Expand Down Expand Up @@ -182,7 +182,7 @@ async function main() {
const scope = "https://cognitiveservices.azure.com/.default";
const azureADTokenProvider = getBearerTokenProvider(new DefaultAzureCredential(), scope);
const deployment = "gpt-35-turbo";
const apiVersion = "2024-08-01-preview";
const apiVersion = "2024-10-21";
const client = new AzureOpenAI({ azureADTokenProvider, deployment, apiVersion });
const events = await client.chat.completions.create({
messages: [
Expand Down
2 changes: 1 addition & 1 deletion sdk/openai/openai/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@azure/openai",
"version": "2.0.0-beta.4",
"version": "2.0.0",
"description": "A companion library to openai for Azure OpenAI.",
"sdk-type": "client",
"main": "./dist/commonjs/index.js",
Expand Down
Loading

0 comments on commit a179d22

Please sign in to comment.