Skip to content

Commit 2023b3a

Browse files
authored
Azure OpenAI: 2.5.0-beta.1 release (Azure#52890)
* initial compiling draft; some test failures to fix but mostly functional * assistants fixes and a few test updates * preparation updates
1 parent 5935272 commit 2023b3a

21 files changed

+362
-234
lines changed

eng/Packages.Data.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@
203203
</ItemGroup>
204204

205205
<ItemGroup Condition="$(MSBuildProjectName.StartsWith('Azure.AI.OpenAI'))">
206-
<PackageReference Update="OpenAI" Version="2.3.0" />
206+
<PackageReference Update="OpenAI" Version="2.5.0" />
207207
</ItemGroup>
208208

209209
<ItemGroup Condition="$(MSBuildProjectName.StartsWith('Azure.Developer.Playwright'))">

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Release History
22

3+
## 2.5.0-beta.1 (2025-10-03)
4+
5+
This update restores compatibility with the latest `2.5.0` release of `OpenAI` and enables access to the latest features. For details, please see [the full OpenAI 2.5.0 release notes](https://github.com/openai/openai-dotnet/blob/main/CHANGELOG.md#250-2025-09-23).
6+
7+
### Features Added
8+
9+
- A substantial number of new features are carried forward from the `OpenAI` library. Please see [the full OpenAI 2.5.0 release notes](https://github.com/openai/openai-dotnet/blob/main/CHANGELOG.md#250-2025-09-23) for details.
10+
311
## 2.3.0-beta.2 (2025-08-21)
412

513
### Features Added

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_7f3c805663"
5+
"Tag": "net/openai/Azure.AI.OpenAI_a192ea056f"
66
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
</When>
4141
<Otherwise>
4242
<PropertyGroup>
43-
<VersionPrefix>2.3.0</VersionPrefix>
44-
<VersionSuffix>beta.2</VersionSuffix>
43+
<VersionPrefix>2.5.0</VersionPrefix>
44+
<VersionSuffix>beta.1</VersionSuffix>
4545
</PropertyGroup>
4646
</Otherwise>
4747
</Choose>

sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/AzureAssistantClient.Protocol.cs

Lines changed: 184 additions & 51 deletions
Large diffs are not rendered by default.

sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/AzureAssistantClient.cs

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#if !AZURE_OPENAI_GA
55

6+
using System.ClientModel;
67
using System.ClientModel.Primitives;
78

89
namespace Azure.AI.OpenAI.Assistants;
@@ -31,6 +32,30 @@ internal AzureAssistantClient(ClientPipeline pipeline, Uri endpoint, AzureOpenAI
3132

3233
protected AzureAssistantClient()
3334
{ }
35+
36+
public override async Task<ClientResult<ThreadRun>> GetRunAsync(string threadId, string runId, CancellationToken cancellationToken = default)
37+
{
38+
ClientResult protocolResult = await GetRunAsync(threadId, runId, cancellationToken.ToRequestOptions()).ConfigureAwait(false);
39+
return ClientResult.FromValue(ModelReaderWriter.Read<ThreadRun>(protocolResult.GetRawResponse().Content, ModelReaderWriterOptions.Json, OpenAIContext.Default), protocolResult.GetRawResponse());
40+
}
41+
42+
public override ClientResult<ThreadRun> GetRun(string threadId, string runId, CancellationToken cancellationToken = default)
43+
{
44+
ClientResult protocolResult = GetRun(threadId, runId, cancellationToken.ToRequestOptions());
45+
return ClientResult.FromValue(ModelReaderWriter.Read<ThreadRun>(protocolResult.GetRawResponse().Content, ModelReaderWriterOptions.Json, OpenAIContext.Default), protocolResult.GetRawResponse());
46+
}
47+
48+
public override async Task<ClientResult<RunStep>> GetRunStepAsync(string threadId, string runId, string stepId, CancellationToken cancellationToken = default)
49+
{
50+
ClientResult protocolResult = await GetRunStepAsync(threadId, runId, stepId, cancellationToken.ToRequestOptions()).ConfigureAwait(false);
51+
return ClientResult.FromValue(ModelReaderWriter.Read<RunStep>(protocolResult.GetRawResponse().Content, ModelReaderWriterOptions.Json, OpenAIContext.Default), protocolResult.GetRawResponse());
52+
}
53+
54+
public override ClientResult<RunStep> GetRunStep(string threadId, string runId, string stepId, CancellationToken cancellationToken = default)
55+
{
56+
ClientResult protocolResult = GetRunStep(threadId, runId, stepId, cancellationToken.ToRequestOptions());
57+
return ClientResult.FromValue(ModelReaderWriter.Read<RunStep>(protocolResult.GetRawResponse().Content, ModelReaderWriterOptions.Json, OpenAIContext.Default), protocolResult.GetRawResponse());
58+
}
3459
}
3560

36-
#endif
61+
#endif

sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureOpenAIFile.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ internal partial class AzureOpenAIFile : OpenAIFile
6161
/// <param name="azureStatus"></param>
6262
/// <exception cref="ArgumentNullException"> <paramref name="id"/>, <paramref name="filename"/> or <paramref name="purpose"/> is null. </exception>
6363
internal AzureOpenAIFile(string id, long? bytes, DateTimeOffset createdAt, string filename, string purpose, AzureOpenAIFileStatus azureStatus)
64-
: base(id, createdAt, filename, purpose.ToFilePurpose(), bytes, azureStatus.ToFileStatus())
64+
: base(id, bytes, createdAt, filename, purpose.ToFilePurpose(), azureStatus.ToFileStatus())
6565
{
6666
_object = "file";
6767
_purpose = purpose;
@@ -80,7 +80,7 @@ internal AzureOpenAIFile(string id, long? bytes, DateTimeOffset createdAt, strin
8080
/// <param name="expiresAt"></param>
8181
/// <param name="additionalBinaryDataProperties"> Keeps track of any properties unknown to the library. </param>
8282
internal AzureOpenAIFile(string id, long? bytes, DateTimeOffset createdAt, DateTimeOffset? expiresAt, string filename, string @object, string purpose, string statusDetails, AzureOpenAIFileStatus azureStatus, IDictionary<string, BinaryData> additionalBinaryDataProperties)
83-
: base(id, createdAt, expiresAt, filename, purpose.ToFilePurpose(), @object, bytes, azureStatus.ToFileStatus(), statusDetails, additionalBinaryDataProperties)
83+
: base(id, bytes, createdAt, expiresAt, filename, @object, purpose.ToFilePurpose(), azureStatus.ToFileStatus(), statusDetails, additionalBinaryDataProperties)
8484
{
8585
_object = @object;
8686
_purpose = purpose;

sdk/openai/Azure.AI.OpenAI/src/Custom/FineTuning/AzureFineTuningClient.Protocol.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,10 @@ internal override AsyncCollectionResult GetJobsAsync(string afterJobId, int? pag
5353
{
5454
return new AzureAsyncCollectionResult<FineTuningJob, FineTuningCollectionPageToken>(
5555
Pipeline,
56-
options,
5756
continuation => GetJobsPipelineMessage(continuation?.After, pageSize, options),
5857
page => FineTuningCollectionPageToken.FromResponse(page, pageSize),
5958
page => GetJobsFromResponse(page.GetRawResponse()),
60-
options?.CancellationToken ?? default
61-
);
59+
options?.CancellationToken ?? default);
6260
}
6361

6462
private IEnumerable<FineTuningJob> GetJobsFromResponse(PipelineResponse response)
@@ -116,4 +114,4 @@ private static bool TryGetLastId(ClientResult previous, out string lastId)
116114
}
117115
}
118116

119-
#endif
117+
#endif

sdk/openai/Azure.AI.OpenAI/src/Custom/FineTuning/AzureFineTuningJob.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ public override ClientResult CancelAndUpdate(CancellationToken cancellationToken
3737
{
3838
using PipelineMessage message = CancelPipelineMessage(JobId, cancellationToken.ToRequestOptions());
3939
PipelineResponse response = _pipeline.ProcessMessage(message, cancellationToken.ToRequestOptions());
40-
CopyLocalParameters(response, InternalFineTuningJob.FromClientResult(ClientResult.FromResponse(response)));
40+
CopyLocalParameters(response, ModelReaderWriter.Read<InternalFineTuningJob>(response.Content, ModelReaderWriterOptions.Json, OpenAIContext.Default)!);
4141
return ClientResult.FromResponse(response);
4242
}
4343

4444
public override async Task<ClientResult> CancelAndUpdateAsync(CancellationToken cancellationToken = default)
4545
{
4646
using PipelineMessage message = CancelPipelineMessage(JobId, cancellationToken.ToRequestOptions());
4747
PipelineResponse response = await _pipeline.ProcessMessageAsync(message, cancellationToken.ToRequestOptions()).ConfigureAwait(false);
48-
CopyLocalParameters(response, InternalFineTuningJob.FromClientResult(ClientResult.FromResponse(response)));
48+
CopyLocalParameters(response, ModelReaderWriter.Read<InternalFineTuningJob>(response.Content, ModelReaderWriterOptions.Json, OpenAIContext.Default)!);
4949
return ClientResult.FromResponse(response);
5050
}
5151
}

sdk/openai/Azure.AI.OpenAI/src/Custom/Internal/AzureAsyncCollectionResult.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ namespace Azure.AI.OpenAI.Utility;
1616
internal class AzureAsyncCollectionResult<TItem, TContinuation> : AsyncCollectionResult<TItem> where TContinuation : ContinuationToken
1717
{
1818
private readonly ClientPipeline _pipeline;
19-
private readonly RequestOptions _options;
2019
private readonly Func<TContinuation?, PipelineMessage> _createRequest;
2120
private readonly Func<ClientResult, TContinuation?> _getContinuationToken;
2221
private readonly Func<ClientResult, IEnumerable<TItem>> _getValues;
@@ -26,7 +25,6 @@ internal class AzureAsyncCollectionResult<TItem, TContinuation> : AsyncCollectio
2625
/// Creates a new instance.
2726
/// </summary>
2827
/// <param name="pipeline">The client pipeline to use to send requests.</param>
29-
/// <param name="options">The request options to use.</param>
3028
/// <param name="createRequest">The function used to create the request to get a page of results. The continuation token
3129
/// may be set to null to get the first page. After that it will be set to a value used to get the next page of results.</param>
3230
/// <param name="getContinuationToken">The function used to create a continuation token from a page of results.</param>
@@ -35,14 +33,12 @@ internal class AzureAsyncCollectionResult<TItem, TContinuation> : AsyncCollectio
3533
/// <exception cref="ArgumentNullException">If any of the required arguments are null.</exception>
3634
public AzureAsyncCollectionResult(
3735
ClientPipeline pipeline,
38-
RequestOptions options,
3936
Func<TContinuation?, PipelineMessage> createRequest,
4037
Func<ClientResult, TContinuation?> getContinuationToken,
4138
Func<ClientResult, IEnumerable<TItem>> getValues,
4239
CancellationToken cancellation)
4340
{
4441
_pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline));
45-
_options = options ?? new();
4642
_getContinuationToken = getContinuationToken ?? throw new ArgumentNullException(nameof(_getContinuationToken));
4743
_createRequest = createRequest ?? throw new ArgumentNullException(nameof(_createRequest));
4844
_getValues = getValues ?? throw new ArgumentNullException(nameof(_getContinuationToken));
@@ -78,7 +74,7 @@ protected override IAsyncEnumerable<TItem> GetValuesFromPageAsync(ClientResult p
7874
protected virtual async Task<ClientResult> SendRequestAsync(TContinuation? continuationToken)
7975
{
8076
using PipelineMessage message = _createRequest(continuationToken);
81-
PipelineResponse response = await _pipeline.ProcessMessageAsync(message, _options).ConfigureAwait(false);
77+
PipelineResponse response = await _pipeline.ProcessMessageAsync(message, _cancellation.ToRequestOptions()).ConfigureAwait(false);
8278
return ClientResult.FromResponse(response);
8379
}
8480
}

0 commit comments

Comments
 (0)