Skip to content

Commit

Permalink
Azure OpenAI: 2.1.0-beta.2 (#46911)
Browse files Browse the repository at this point in the history
* stage updates for 2.1.0-beta.2

* test assets.json

* CHANGELOG update

* changelog link update
  • Loading branch information
trrwilson authored Nov 5, 2024
1 parent bfcccff commit 9e4950e
Show file tree
Hide file tree
Showing 35 changed files with 1,178 additions and 177 deletions.
2 changes: 1 addition & 1 deletion eng/Packages.Data.props
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
</ItemGroup>

<ItemGroup Condition="$(MSBuildProjectName.StartsWith('Azure.AI.OpenAI'))">
<PackageReference Update="OpenAI" Version="2.1.0-beta.1" />
<PackageReference Update="OpenAI" Version="2.1.0-beta.2" />
</ItemGroup>

<ItemGroup Condition="$(MSBuildProjectName.StartsWith('Azure.Developer.MicrosoftPlaywrightTesting'))">
Expand Down
32 changes: 31 additions & 1 deletion sdk/openai/Azure.AI.OpenAI/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
# Release History

## 2.1.0-beta.2 (2024-11-04)

This update brings compatibility with the Azure OpenAI `2024-10-01-preview` service API version as well as the `2.1.0-beta.2` release of the `OpenAI` library.

### Breaking Changes

- `[Experimental]` `ChatCitation` and `ChatRetrievedDocument` have each replaced the `Uri` property of type `System.Uri` with a `string` property named `Url`. This aligns with the REST specification and accounts for the wire value of `url` not always providing a valid RFC 3986 identifier [[azure-sdk-for-net \#46793](https://github.com/Azure/azure-sdk-for-net/issues/46793)]

### Features Added

- The included update via `2024-09-01-preview` brings AOAI support for streaming token usage in chat completions; `Usage` is now automatically populated in `StreamingChatCompletionUpdate` instances.
- Note 1: this feature is not yet compatible when using On Your Data features (after invoking the `.AddDataSource()` extension method on `ChatCompletionOptions`)
- Note 2: this feature is not yet compatible when using image input (a `ChatMessageContentPart` of `Kind` `Image`)
- `2024-10-01-preview` further adds support for ungrounded content detection in chat completion content filter results via the `UngroundedMaterial` property on `ResponseContentFilterResult`, as retrieved from a chat completion via the `GetResponseContentFilterResult()` extension method.

Via `OpenAI 2.0.0-beta.2`:

- Made improvements to the experimental Realtime API. Please note this features area is currently under rapid development and not all changes may be reflected here.
- Several types have been renamed for consistency and clarity.
- ConversationRateLimitsUpdate (previously ConversationRateLimitsUpdatedUpdate) now includes named RequestDetails and TokenDetails properties, mapping to the corresponding named items in the underlying rate_limits command payload.

### Bugs Fixed

- Addressed an HTTP 401 issue that caused certain connection retry attempts, such as those triggered for HTTP 429 rate limiting errors, to sometimes generate a malformed request with multiple `Authorization` headers that would then be rejected. [#46401](https://github.com/Azure/azure-sdk-for-net/pull/46401)
- Addressed an issue that caused `ChatCitation` and `ChatRetrievedDocument` to sometimes throw on deserialization, specifically when a returned value in the `url` JSON field was not populated with an RFC 3986 compliant identifier for `System.Uri` [[azure-sdk-for-net \#46793](https://github.com/Azure/azure-sdk-for-net/issues/46793)]

Via `OpenAI 2.0.0-beta.2`:

- Fixed serialization and deserialization of ConversationToolChoice literal values (such as "required").

## 2.1.0-beta.1 (2024-10-01)

Relative to the prior GA release, this update restores preview surfaces, retargeting to the latest `2024-08-01-preview` service `api-version` label. It also brings early support for the newly-announced `/realtime` capabilities with `gpt-4o-realtime-preview`. You can read more about Azure OpenAI support for `/realtime` in the annoucement post here: https://azure.microsoft.com/blog/announcing-new-products-and-features-for-azure-openai-service-including-gpt-4o-realtime-preview-with-audio-and-speech-capabilities/
Expand All @@ -10,7 +40,7 @@ Relative to the prior GA release, this update restores preview surfaces, retarge
- This maps to the new `/realtime` beta endpoint and is thus marked with a new `[Experimental("OPENAI002")]` diagnostic tag.
- This is a very early version of the convenience surface and thus subject to significant change
- Documentation and samples will arrive soon; in the interim, see the scenario test files (in `/tests`) for basic usage
- You can also find an external sample employing this client, together with Azure OpenAI support, at https://github.com/Azure-Samples/aoai-realtime-audio-sdk/tree/main/dotnet/samples/console
- You can also find an external sample employing this client, together with Azure OpenAI support, at https://github.com/Azure-Samples/aoai-realtime-audio-sdk/tree/main/dotnet/samples

## 2.0.0 (2024-09-30)

Expand Down
1 change: 1 addition & 0 deletions sdk/openai/Azure.AI.OpenAI/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<AzureOpenAILibraryVersion>2.1.0-beta.2</AzureOpenAILibraryVersion>
<!--
During development, we may want to get ahead of the published Nuget package versions. These next property flags
allow you to replace Nuget package references with external assembly .dll references, or even the source code
Expand Down
32 changes: 29 additions & 3 deletions sdk/openai/Azure.AI.OpenAI/api/Azure.AI.OpenAI.netstandard2.0.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,14 @@ public AzureOpenAIClient(System.Uri endpoint, System.ClientModel.ApiKeyCredentia
}
public partial class AzureOpenAIClientOptions : System.ClientModel.Primitives.ClientPipelineOptions
{
public AzureOpenAIClientOptions(Azure.AI.OpenAI.AzureOpenAIClientOptions.ServiceVersion version = Azure.AI.OpenAI.AzureOpenAIClientOptions.ServiceVersion.V2024_08_01_Preview) { }
public AzureOpenAIClientOptions(Azure.AI.OpenAI.AzureOpenAIClientOptions.ServiceVersion version = Azure.AI.OpenAI.AzureOpenAIClientOptions.ServiceVersion.V2024_10_01_Preview) { }
public Azure.AI.OpenAI.AzureOpenAIAudience? Audience { get { throw null; } set { } }
public string UserAgentApplicationId { get { throw null; } set { } }
public enum ServiceVersion
{
V2024_06_01 = 0,
V2024_08_01_Preview = 1,
V2024_09_01_Preview = 2,
V2024_10_01_Preview = 3,
}
}
Expand Down Expand Up @@ -131,6 +132,29 @@ internal ContentFilterSeverityResult() { }
string System.ClientModel.Primitives.IPersistableModel<Azure.AI.OpenAI.ContentFilterSeverityResult>.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
System.BinaryData System.ClientModel.Primitives.IPersistableModel<Azure.AI.OpenAI.ContentFilterSeverityResult>.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
}
public partial class ContentFilterTextSpan : System.ClientModel.Primitives.IJsonModel<Azure.AI.OpenAI.ContentFilterTextSpan>, System.ClientModel.Primitives.IPersistableModel<Azure.AI.OpenAI.ContentFilterTextSpan>
{
internal ContentFilterTextSpan() { }
public int CompletionEndOffset { get { throw null; } }
public int CompletionStartOffset { get { throw null; } }
Azure.AI.OpenAI.ContentFilterTextSpan System.ClientModel.Primitives.IJsonModel<Azure.AI.OpenAI.ContentFilterTextSpan>.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
void System.ClientModel.Primitives.IJsonModel<Azure.AI.OpenAI.ContentFilterTextSpan>.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { }
Azure.AI.OpenAI.ContentFilterTextSpan System.ClientModel.Primitives.IPersistableModel<Azure.AI.OpenAI.ContentFilterTextSpan>.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
string System.ClientModel.Primitives.IPersistableModel<Azure.AI.OpenAI.ContentFilterTextSpan>.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
System.BinaryData System.ClientModel.Primitives.IPersistableModel<Azure.AI.OpenAI.ContentFilterTextSpan>.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
}
public partial class ContentFilterTextSpanResult : System.ClientModel.Primitives.IJsonModel<Azure.AI.OpenAI.ContentFilterTextSpanResult>, System.ClientModel.Primitives.IPersistableModel<Azure.AI.OpenAI.ContentFilterTextSpanResult>
{
internal ContentFilterTextSpanResult() { }
public System.Collections.Generic.IReadOnlyList<Azure.AI.OpenAI.ContentFilterTextSpan> Details { get { throw null; } }
public bool Detected { get { throw null; } }
public bool Filtered { get { throw null; } }
Azure.AI.OpenAI.ContentFilterTextSpanResult System.ClientModel.Primitives.IJsonModel<Azure.AI.OpenAI.ContentFilterTextSpanResult>.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
void System.ClientModel.Primitives.IJsonModel<Azure.AI.OpenAI.ContentFilterTextSpanResult>.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { }
Azure.AI.OpenAI.ContentFilterTextSpanResult System.ClientModel.Primitives.IPersistableModel<Azure.AI.OpenAI.ContentFilterTextSpanResult>.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
string System.ClientModel.Primitives.IPersistableModel<Azure.AI.OpenAI.ContentFilterTextSpanResult>.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
System.BinaryData System.ClientModel.Primitives.IPersistableModel<Azure.AI.OpenAI.ContentFilterTextSpanResult>.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
}
public partial class RequestContentFilterResult : System.ClientModel.Primitives.IJsonModel<Azure.AI.OpenAI.RequestContentFilterResult>, System.ClientModel.Primitives.IPersistableModel<Azure.AI.OpenAI.RequestContentFilterResult>
{
internal RequestContentFilterResult() { }
Expand Down Expand Up @@ -170,6 +194,7 @@ internal ResponseContentFilterResult() { }
public Azure.AI.OpenAI.ContentFilterDetectionResult ProtectedMaterialText { get { throw null; } }
public Azure.AI.OpenAI.ContentFilterSeverityResult SelfHarm { get { throw null; } }
public Azure.AI.OpenAI.ContentFilterSeverityResult Sexual { get { throw null; } }
public Azure.AI.OpenAI.ContentFilterTextSpanResult UngroundedMaterial { get { throw null; } }
public Azure.AI.OpenAI.ContentFilterSeverityResult Violence { get { throw null; } }
Azure.AI.OpenAI.ResponseContentFilterResult System.ClientModel.Primitives.IJsonModel<Azure.AI.OpenAI.ResponseContentFilterResult>.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
void System.ClientModel.Primitives.IJsonModel<Azure.AI.OpenAI.ResponseContentFilterResult>.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { }
Expand Down Expand Up @@ -203,6 +228,7 @@ public static void AddDataSource(this OpenAI.Chat.ChatCompletionOptions options,
public static Azure.AI.OpenAI.RequestContentFilterResult GetRequestContentFilterResult(this OpenAI.Chat.StreamingChatCompletionUpdate chatUpdate) { throw null; }
public static Azure.AI.OpenAI.ResponseContentFilterResult GetResponseContentFilterResult(this OpenAI.Chat.ChatCompletion chatCompletion) { throw null; }
public static Azure.AI.OpenAI.ResponseContentFilterResult GetResponseContentFilterResult(this OpenAI.Chat.StreamingChatCompletionUpdate chatUpdate) { throw null; }
public static void SetNewMaxCompletionTokensPropertyEnabled(this OpenAI.Chat.ChatCompletionOptions options, bool newPropertyEnabled = true) { }
}
public partial class AzureSearchChatDataSource : Azure.AI.OpenAI.Chat.ChatDataSource, System.ClientModel.Primitives.IJsonModel<Azure.AI.OpenAI.Chat.AzureSearchChatDataSource>, System.ClientModel.Primitives.IPersistableModel<Azure.AI.OpenAI.Chat.AzureSearchChatDataSource>
{
Expand Down Expand Up @@ -236,7 +262,7 @@ internal ChatCitation() { }
public string FilePath { get { throw null; } }
public double? RerankScore { get { throw null; } }
public string Title { get { throw null; } }
public System.Uri Uri { get { throw null; } }
public string Url { get { throw null; } }
Azure.AI.OpenAI.Chat.ChatCitation System.ClientModel.Primitives.IJsonModel<Azure.AI.OpenAI.Chat.ChatCitation>.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
void System.ClientModel.Primitives.IJsonModel<Azure.AI.OpenAI.Chat.ChatCitation>.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { }
Azure.AI.OpenAI.Chat.ChatCitation System.ClientModel.Primitives.IPersistableModel<Azure.AI.OpenAI.Chat.ChatCitation>.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
Expand Down Expand Up @@ -294,7 +320,7 @@ internal ChatRetrievedDocument() { }
public double? RerankScore { get { throw null; } }
public System.Collections.Generic.IReadOnlyList<string> SearchQueries { get { throw null; } }
public string Title { get { throw null; } }
public System.Uri Uri { get { throw null; } }
public string Url { get { throw null; } }
Azure.AI.OpenAI.Chat.ChatRetrievedDocument System.ClientModel.Primitives.IJsonModel<Azure.AI.OpenAI.Chat.ChatRetrievedDocument>.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
void System.ClientModel.Primitives.IJsonModel<Azure.AI.OpenAI.Chat.ChatRetrievedDocument>.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { }
Azure.AI.OpenAI.Chat.ChatRetrievedDocument System.ClientModel.Primitives.IPersistableModel<Azure.AI.OpenAI.Chat.ChatRetrievedDocument>.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
Expand Down
2 changes: 1 addition & 1 deletion sdk/openai/Azure.AI.OpenAI/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "net",
"TagPrefix": "net/openai/Azure.AI.OpenAI",
"Tag": "net/openai/Azure.AI.OpenAI_4c6b1909d6"
"Tag": "net/openai/Azure.AI.OpenAI_c44e368d37"
}
9 changes: 2 additions & 7 deletions sdk/openai/Azure.AI.OpenAI/src/Azure.AI.OpenAI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
Azure OpenAI's official extension package for using OpenAI's .NET library with the Azure OpenAI Service.
</Description>
<AssemblyTitle>Azure.AI.OpenAI Client Library</AssemblyTitle>
<VersionPrefix>2.1.0</VersionPrefix>
<PackageTags>Microsoft Azure OpenAI</PackageTags>
<Version>2.1.0-beta.2</Version>
<!--The ApiCompatVersion is managed automatically and should not generally be modified manually.-->
<DisableEnhancedAnalysis>true</DisableEnhancedAnalysis>
<TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks>
<GenerateAPIListing>true</GenerateAPIListing>
Expand All @@ -26,14 +27,8 @@
<When Condition="'$(GAServiceVersionLabel)' != ''">
<PropertyGroup>
<DefineConstants>AZURE_OPENAI_GA</DefineConstants>
<VersionSuffix />
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<VersionSuffix>beta.1</VersionSuffix>
</PropertyGroup>
</Otherwise>
</Choose>

<!-- Which Azure.Core library/code should we use? -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public AzureOpenAIClientOptions(ServiceVersion version = LatestVersion)
{
#if !AZURE_OPENAI_GA
ServiceVersion.V2024_08_01_Preview => "2024-08-01-preview",
ServiceVersion.V2024_09_01_Preview => "2024-09-01-preview",
ServiceVersion.V2024_10_01_Preview => "2024-10-01-preview",
#endif
ServiceVersion.V2024_06_01 => "2024-06-01",
Expand All @@ -70,6 +71,7 @@ public enum ServiceVersion
V2024_06_01 = 0,
#if !AZURE_OPENAI_GA
V2024_08_01_Preview = 1,
V2024_09_01_Preview = 2,
V2024_10_01_Preview = 3,
#endif
}
Expand Down Expand Up @@ -103,7 +105,7 @@ protected override TimeSpan GetNextDelay(PipelineMessage message, int tryCount)
}

#if !AZURE_OPENAI_GA
private const ServiceVersion LatestVersion = ServiceVersion.V2024_08_01_Preview;
private const ServiceVersion LatestVersion = ServiceVersion.V2024_10_01_Preview;
#else
private const ServiceVersion LatestVersion = ServiceVersion.V2024_06_01;
#endif
Expand Down
Loading

0 comments on commit 9e4950e

Please sign in to comment.