Skip to content

Commit 9e4950e

Browse files
authored
Azure OpenAI: 2.1.0-beta.2 (Azure#46911)
* stage updates for 2.1.0-beta.2 * test assets.json * CHANGELOG update * changelog link update
1 parent bfcccff commit 9e4950e

35 files changed

+1178
-177
lines changed

eng/Packages.Data.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@
184184
</ItemGroup>
185185

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

190190
<ItemGroup Condition="$(MSBuildProjectName.StartsWith('Azure.Developer.MicrosoftPlaywrightTesting'))">

sdk/openai/Azure.AI.OpenAI/CHANGELOG.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,35 @@
11
# Release History
22

3+
## 2.1.0-beta.2 (2024-11-04)
4+
5+
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.
6+
7+
### Breaking Changes
8+
9+
- `[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)]
10+
11+
### Features Added
12+
13+
- 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.
14+
- Note 1: this feature is not yet compatible when using On Your Data features (after invoking the `.AddDataSource()` extension method on `ChatCompletionOptions`)
15+
- Note 2: this feature is not yet compatible when using image input (a `ChatMessageContentPart` of `Kind` `Image`)
16+
- `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.
17+
18+
Via `OpenAI 2.0.0-beta.2`:
19+
20+
- 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.
21+
- Several types have been renamed for consistency and clarity.
22+
- ConversationRateLimitsUpdate (previously ConversationRateLimitsUpdatedUpdate) now includes named RequestDetails and TokenDetails properties, mapping to the corresponding named items in the underlying rate_limits command payload.
23+
24+
### Bugs Fixed
25+
26+
- 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)
27+
- 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)]
28+
29+
Via `OpenAI 2.0.0-beta.2`:
30+
31+
- Fixed serialization and deserialization of ConversationToolChoice literal values (such as "required").
32+
333
## 2.1.0-beta.1 (2024-10-01)
434

535
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/
@@ -10,7 +40,7 @@ Relative to the prior GA release, this update restores preview surfaces, retarge
1040
- This maps to the new `/realtime` beta endpoint and is thus marked with a new `[Experimental("OPENAI002")]` diagnostic tag.
1141
- This is a very early version of the convenience surface and thus subject to significant change
1242
- Documentation and samples will arrive soon; in the interim, see the scenario test files (in `/tests`) for basic usage
13-
- 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
43+
- 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
1444

1545
## 2.0.0 (2024-09-30)
1646

sdk/openai/Azure.AI.OpenAI/Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
22
<PropertyGroup>
3+
<AzureOpenAILibraryVersion>2.1.0-beta.2</AzureOpenAILibraryVersion>
34
<!--
45
During development, we may want to get ahead of the published Nuget package versions. These next property flags
56
allow you to replace Nuget package references with external assembly .dll references, or even the source code

sdk/openai/Azure.AI.OpenAI/api/Azure.AI.OpenAI.netstandard2.0.cs

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,14 @@ public AzureOpenAIClient(System.Uri endpoint, System.ClientModel.ApiKeyCredentia
4545
}
4646
public partial class AzureOpenAIClientOptions : System.ClientModel.Primitives.ClientPipelineOptions
4747
{
48-
public AzureOpenAIClientOptions(Azure.AI.OpenAI.AzureOpenAIClientOptions.ServiceVersion version = Azure.AI.OpenAI.AzureOpenAIClientOptions.ServiceVersion.V2024_08_01_Preview) { }
48+
public AzureOpenAIClientOptions(Azure.AI.OpenAI.AzureOpenAIClientOptions.ServiceVersion version = Azure.AI.OpenAI.AzureOpenAIClientOptions.ServiceVersion.V2024_10_01_Preview) { }
4949
public Azure.AI.OpenAI.AzureOpenAIAudience? Audience { get { throw null; } set { } }
5050
public string UserAgentApplicationId { get { throw null; } set { } }
5151
public enum ServiceVersion
5252
{
5353
V2024_06_01 = 0,
5454
V2024_08_01_Preview = 1,
55+
V2024_09_01_Preview = 2,
5556
V2024_10_01_Preview = 3,
5657
}
5758
}
@@ -131,6 +132,29 @@ internal ContentFilterSeverityResult() { }
131132
string System.ClientModel.Primitives.IPersistableModel<Azure.AI.OpenAI.ContentFilterSeverityResult>.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
132133
System.BinaryData System.ClientModel.Primitives.IPersistableModel<Azure.AI.OpenAI.ContentFilterSeverityResult>.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
133134
}
135+
public partial class ContentFilterTextSpan : System.ClientModel.Primitives.IJsonModel<Azure.AI.OpenAI.ContentFilterTextSpan>, System.ClientModel.Primitives.IPersistableModel<Azure.AI.OpenAI.ContentFilterTextSpan>
136+
{
137+
internal ContentFilterTextSpan() { }
138+
public int CompletionEndOffset { get { throw null; } }
139+
public int CompletionStartOffset { get { throw null; } }
140+
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; }
141+
void System.ClientModel.Primitives.IJsonModel<Azure.AI.OpenAI.ContentFilterTextSpan>.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { }
142+
Azure.AI.OpenAI.ContentFilterTextSpan System.ClientModel.Primitives.IPersistableModel<Azure.AI.OpenAI.ContentFilterTextSpan>.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
143+
string System.ClientModel.Primitives.IPersistableModel<Azure.AI.OpenAI.ContentFilterTextSpan>.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
144+
System.BinaryData System.ClientModel.Primitives.IPersistableModel<Azure.AI.OpenAI.ContentFilterTextSpan>.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
145+
}
146+
public partial class ContentFilterTextSpanResult : System.ClientModel.Primitives.IJsonModel<Azure.AI.OpenAI.ContentFilterTextSpanResult>, System.ClientModel.Primitives.IPersistableModel<Azure.AI.OpenAI.ContentFilterTextSpanResult>
147+
{
148+
internal ContentFilterTextSpanResult() { }
149+
public System.Collections.Generic.IReadOnlyList<Azure.AI.OpenAI.ContentFilterTextSpan> Details { get { throw null; } }
150+
public bool Detected { get { throw null; } }
151+
public bool Filtered { get { throw null; } }
152+
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; }
153+
void System.ClientModel.Primitives.IJsonModel<Azure.AI.OpenAI.ContentFilterTextSpanResult>.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { }
154+
Azure.AI.OpenAI.ContentFilterTextSpanResult System.ClientModel.Primitives.IPersistableModel<Azure.AI.OpenAI.ContentFilterTextSpanResult>.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
155+
string System.ClientModel.Primitives.IPersistableModel<Azure.AI.OpenAI.ContentFilterTextSpanResult>.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
156+
System.BinaryData System.ClientModel.Primitives.IPersistableModel<Azure.AI.OpenAI.ContentFilterTextSpanResult>.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
157+
}
134158
public partial class RequestContentFilterResult : System.ClientModel.Primitives.IJsonModel<Azure.AI.OpenAI.RequestContentFilterResult>, System.ClientModel.Primitives.IPersistableModel<Azure.AI.OpenAI.RequestContentFilterResult>
135159
{
136160
internal RequestContentFilterResult() { }
@@ -170,6 +194,7 @@ internal ResponseContentFilterResult() { }
170194
public Azure.AI.OpenAI.ContentFilterDetectionResult ProtectedMaterialText { get { throw null; } }
171195
public Azure.AI.OpenAI.ContentFilterSeverityResult SelfHarm { get { throw null; } }
172196
public Azure.AI.OpenAI.ContentFilterSeverityResult Sexual { get { throw null; } }
197+
public Azure.AI.OpenAI.ContentFilterTextSpanResult UngroundedMaterial { get { throw null; } }
173198
public Azure.AI.OpenAI.ContentFilterSeverityResult Violence { get { throw null; } }
174199
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; }
175200
void System.ClientModel.Primitives.IJsonModel<Azure.AI.OpenAI.ResponseContentFilterResult>.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { }
@@ -203,6 +228,7 @@ public static void AddDataSource(this OpenAI.Chat.ChatCompletionOptions options,
203228
public static Azure.AI.OpenAI.RequestContentFilterResult GetRequestContentFilterResult(this OpenAI.Chat.StreamingChatCompletionUpdate chatUpdate) { throw null; }
204229
public static Azure.AI.OpenAI.ResponseContentFilterResult GetResponseContentFilterResult(this OpenAI.Chat.ChatCompletion chatCompletion) { throw null; }
205230
public static Azure.AI.OpenAI.ResponseContentFilterResult GetResponseContentFilterResult(this OpenAI.Chat.StreamingChatCompletionUpdate chatUpdate) { throw null; }
231+
public static void SetNewMaxCompletionTokensPropertyEnabled(this OpenAI.Chat.ChatCompletionOptions options, bool newPropertyEnabled = true) { }
206232
}
207233
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>
208234
{
@@ -236,7 +262,7 @@ internal ChatCitation() { }
236262
public string FilePath { get { throw null; } }
237263
public double? RerankScore { get { throw null; } }
238264
public string Title { get { throw null; } }
239-
public System.Uri Uri { get { throw null; } }
265+
public string Url { get { throw null; } }
240266
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; }
241267
void System.ClientModel.Primitives.IJsonModel<Azure.AI.OpenAI.Chat.ChatCitation>.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { }
242268
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; }
@@ -294,7 +320,7 @@ internal ChatRetrievedDocument() { }
294320
public double? RerankScore { get { throw null; } }
295321
public System.Collections.Generic.IReadOnlyList<string> SearchQueries { get { throw null; } }
296322
public string Title { get { throw null; } }
297-
public System.Uri Uri { get { throw null; } }
323+
public string Url { get { throw null; } }
298324
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; }
299325
void System.ClientModel.Primitives.IJsonModel<Azure.AI.OpenAI.Chat.ChatRetrievedDocument>.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { }
300326
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; }

sdk/openai/Azure.AI.OpenAI/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "net",
44
"TagPrefix": "net/openai/Azure.AI.OpenAI",
5-
"Tag": "net/openai/Azure.AI.OpenAI_4c6b1909d6"
5+
"Tag": "net/openai/Azure.AI.OpenAI_c44e368d37"
66
}

sdk/openai/Azure.AI.OpenAI/src/Azure.AI.OpenAI.csproj

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
Azure OpenAI's official extension package for using OpenAI's .NET library with the Azure OpenAI Service.
66
</Description>
77
<AssemblyTitle>Azure.AI.OpenAI Client Library</AssemblyTitle>
8-
<VersionPrefix>2.1.0</VersionPrefix>
98
<PackageTags>Microsoft Azure OpenAI</PackageTags>
9+
<Version>2.1.0-beta.2</Version>
10+
<!--The ApiCompatVersion is managed automatically and should not generally be modified manually.-->
1011
<DisableEnhancedAnalysis>true</DisableEnhancedAnalysis>
1112
<TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks>
1213
<GenerateAPIListing>true</GenerateAPIListing>
@@ -26,14 +27,8 @@
2627
<When Condition="'$(GAServiceVersionLabel)' != ''">
2728
<PropertyGroup>
2829
<DefineConstants>AZURE_OPENAI_GA</DefineConstants>
29-
<VersionSuffix />
3030
</PropertyGroup>
3131
</When>
32-
<Otherwise>
33-
<PropertyGroup>
34-
<VersionSuffix>beta.1</VersionSuffix>
35-
</PropertyGroup>
36-
</Otherwise>
3732
</Choose>
3833

3934
<!-- Which Azure.Core library/code should we use? -->

sdk/openai/Azure.AI.OpenAI/src/Custom/AzureOpenAIClientOptions.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ public AzureOpenAIClientOptions(ServiceVersion version = LatestVersion)
5656
{
5757
#if !AZURE_OPENAI_GA
5858
ServiceVersion.V2024_08_01_Preview => "2024-08-01-preview",
59+
ServiceVersion.V2024_09_01_Preview => "2024-09-01-preview",
5960
ServiceVersion.V2024_10_01_Preview => "2024-10-01-preview",
6061
#endif
6162
ServiceVersion.V2024_06_01 => "2024-06-01",
@@ -70,6 +71,7 @@ public enum ServiceVersion
7071
V2024_06_01 = 0,
7172
#if !AZURE_OPENAI_GA
7273
V2024_08_01_Preview = 1,
74+
V2024_09_01_Preview = 2,
7375
V2024_10_01_Preview = 3,
7476
#endif
7577
}
@@ -103,7 +105,7 @@ protected override TimeSpan GetNextDelay(PipelineMessage message, int tryCount)
103105
}
104106

105107
#if !AZURE_OPENAI_GA
106-
private const ServiceVersion LatestVersion = ServiceVersion.V2024_08_01_Preview;
108+
private const ServiceVersion LatestVersion = ServiceVersion.V2024_10_01_Preview;
107109
#else
108110
private const ServiceVersion LatestVersion = ServiceVersion.V2024_06_01;
109111
#endif

0 commit comments

Comments
 (0)