Skip to content

Commit 982086b

Browse files
committed
Merge branch 'main' of https://github.com/openai/openai-dotnet into shreja/AddJsonPath
2 parents b08cc8b + 15638d4 commit 982086b

File tree

6 files changed

+9017
-9042
lines changed

6 files changed

+9017
-9042
lines changed

CHANGELOG.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,21 @@
22

33
## 2.6.0-beta.1 (Unreleased)
44

5+
### Acknowledgments
6+
7+
Thank you to our developer community members who helped to make the OpenAI client library better with their contributions to this release:
8+
9+
- Maksim Kurnakov _([GitHub](https://github.com/kurnakovv))_
10+
- Benjamin Pinter _([GitHub](https://github.com/BenjaminDavidPinter))_
11+
512
### Features Added
613

714
- OpenAI.Chat:
8-
- Added the `Minimal` property to `ChatReasoningEffortLevel`
15+
- Added the `Minimal` property to `ChatReasoningEffortLevel`_(A community contribution, courtesy of [kurnakovv](https://github.com/kurnakovv))_
916

1017
- OpenAI.Responses:
11-
- Added the `Minimal` property to `ResponseReasoningEffortLevel`
18+
- Added the `Minimal` property to `ResponseReasoningEffortLevel` _(A community contribution, courtesy of [kurnakovv](https://github.com/kurnakovv))_
19+
- Added the `Model` property to `OpenAIResponseClient` _(A community contribution, courtesy of [BenjaminDavidPinter](https://github.com/BenjaminDavidPinter))_
1220

1321
## 2.5.0 (2025-09-23)
1422

api/OpenAI.net8.0.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,6 +1157,8 @@ public class AudioTranscription : IJsonModel<AudioTranscription>, IPersistableMo
11571157
[Experimental("OPENAI001")]
11581158
protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options);
11591159
[Experimental("OPENAI001")]
1160+
public static explicit operator AudioTranscription(ClientResult result);
1161+
[Experimental("OPENAI001")]
11601162
protected virtual AudioTranscription PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options);
11611163
[Experimental("OPENAI001")]
11621164
protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options);

api/OpenAI.netstandard2.0.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,6 +1051,7 @@ public class AudioTranscription : IJsonModel<AudioTranscription>, IPersistableMo
10511051
public IReadOnlyList<TranscribedWord> Words { get; }
10521052
protected virtual AudioTranscription JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
10531053
protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1054+
public static explicit operator AudioTranscription(ClientResult result);
10541055
protected virtual AudioTranscription PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options);
10551056
protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options);
10561057
}

specification/base/typespec/audio/operations.tsp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@ interface Audio {
4040
| CreateTranscriptionResponseVerboseJson
4141
| CreateTranscriptionResponseJson
4242
| SseResponseOf<CreateTranscriptionResponseStreamEvent>
43-
| {
44-
// TODO: This response is not defined in the OpenAPI spec.
45-
@header contentType: "text/plain";
46-
47-
@body responseBody: string;
48-
}
4943
| ErrorResponse;
5044

5145
@route("translations")

src/Custom/Audio/AudioTranscription.Serialization.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
using System;
2+
using System.ClientModel;
23
using System.ClientModel.Primitives;
34
using System.Collections.Generic;
5+
using System.Diagnostics.CodeAnalysis;
46
using System.Text.Json;
57

68
namespace OpenAI.Audio;
@@ -27,4 +29,12 @@ internal static AudioTranscription FromResponse(PipelineResponse response)
2729
using var document = JsonDocument.Parse(response.Content);
2830
return DeserializeAudioTranscription(document.RootElement, null);
2931
}
32+
33+
[Experimental("OPENAI001")]
34+
public static explicit operator AudioTranscription(ClientResult result)
35+
{
36+
using PipelineResponse response = result.GetRawResponse();
37+
using JsonDocument document = JsonDocument.Parse(response.Content);
38+
return DeserializeAudioTranscription(document.RootElement, ModelSerializationExtensions.WireOptions);
39+
}
3040
}

0 commit comments

Comments
 (0)