Skip to content

Commit 5dce104

Browse files
authored
Prepare 2.2.0 release (Part 1) (#502)
1 parent af4ca83 commit 5dce104

File tree

2,596 files changed

+99682
-48025
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,596 files changed

+99682
-48025
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

CHANGELOG.md

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,116 @@
11
# Release History
22

3+
## 2.2.0 (Unreleased)
4+
5+
### Features Added
6+
7+
- OpenAI.Audio:
8+
- Enabled support for streaming audio transcriptions:
9+
- Added new methods to `AudioClient`:
10+
- `TranscribeAudioStreaming` and `TranscribeAudioStreamingAsync`
11+
- Added new types of `StreamingAudioTranscriptionUpdate` to work with streaming transcriptions:
12+
- `StreamingAudioTranscriptionTextDeltaUpdate`
13+
- `StreamingAudioTranscriptionTextDoneUpdate`
14+
- Added the `TranscriptionTokenLogProbabilities` property to `AudioTranscription` to represent token-level log probability information.
15+
- Added the `AudioTranscriptionIncludes` enum and `Includes` property to `AudioTranscriptionOptions` to request additional information in the transcription response.
16+
- Added new voices to `GeneratedSpeechVoice`.
17+
- Added the `Instructions` property to `SpeechGenerationOptions` to control the voice of the generated audio with additional instructions.
18+
- OpenAI.Batch:
19+
- Added new `Rehydrate` method overloads that receive a batch ID instead of rehydration token.
20+
- OpenAI.Chat:
21+
- Added new methods to `ChatClient`:
22+
- `DeleteChatCompletion` and `DeleteChatCompletionAsync`
23+
- `GetChatCompletion` and `GetChatCompletionAsync`
24+
- Added `Aac` format to `ChatOutputAudioFormat`.
25+
- Added new voices to `ChatOutputAudioVoice`.
26+
- OpenAI.Evals:
27+
- Introduced the new `EvaluationClient` to support the Evaluations API with protocol methods for the following operations:
28+
- `CreateEvaluation` and `CreateEvaluationAsync`
29+
- `GetEvaluation` and `GetEvaluationAsync`
30+
- `GetEvaluations` and `GetEvaluationsAsync`
31+
- `UpdateEvaluation` and `UpdateEvaluationAsync`
32+
- `DeleteEvaluation` and `DeleteEvaluationAsync`
33+
- `CreateEvaluatinRun` and `CreateEvaluationRunAsync`
34+
- `GetEvaluationRun` and `GetEvaluationRunAsync`
35+
- `GetEvaluationRuns` and `GetEvaluationRunsAsync`
36+
- `CancelEvaluationRun` and `CancelEvaluationRunAsync`
37+
- `DeleteEvaluationRun` and `DeleteEvaluationRunAsync`
38+
- `GetEvaluationRunOutputItem` and `GetEvaluationRunOutputItemAsync`
39+
- `GetEvaluationRunOutputItems` and `GetEvaluationRunOutputItemsAsync`
40+
- OpenAI.FineTuning:
41+
- Added new methods to `FineTuningClient`:
42+
- `GetFineTuningCheckpointPermissions` and `GetFineTuningCheckpointPermissionsAsync`
43+
- `CreateFineTuningCheckpointPermission` and `CreateFineTuningCheckpointPermissionAsync`
44+
- `DeleteFineTuningCheckpointPermission` and `DeleteFineTuningCheckpointPermission`
45+
- `PauseFineTuningJob` and `PauseFineTuningJobAsync`
46+
- `ResumeFineTuningJob` and `ResumeFineTuningJobAsync`
47+
- Added new experimental types to support fine-tuning workflows.
48+
- OpenAI.Images:
49+
- Added the `Usage` property to `GeneratedImageCollection` to represent image token usage information.
50+
- Added the `Background` property to `ImageGenerationOptions` to set transparency for the background of the generated image(s).
51+
- Added the `ModerationLevel` property to `ImageGenerationOptions` to control the content-moderation level for generated image(s).
52+
- Added the `OutputCompressionFactor` property to `ImageGenerationOptions` to set the compression level (0-100%) for the generated images.
53+
- Added the `OutputFileFormat` property to `ImageGenerationOptions` to set the file format in which the generated images are returned.
54+
- Added support for new values to the `GeneratedImageSize` enum.
55+
- OpenAI.Responses:
56+
- Added new methods to the `OpenAIResponseClient`:
57+
- `CancelResponse` and `CancelResponseAsync`
58+
- `GetResponseStreaming` and `GetResponseStreamingAsync`.
59+
- Added `Linux` property to `ComputerToolEnvironment`.
60+
- Added `Background` property to `ResponseCreationOptions` to support background mode.
61+
- Added `SequenceNumber` property to `StreamingResponseUpdate` to support background mode while streaming.
62+
- Added `InputTokenDetails` property to `ResponseTokenUsage` to represent token usage information.
63+
- Added `EncryptedContent` property to `ReasoningResponseItem` to represent the encrypted content of the reasoning item.
64+
- OpenAI.VectorStores:
65+
- Added new methods to `VectorStoreClient`:
66+
- `RetrieveVectorStoreFileContent` and `RetrieveVectorStoreFileContentAsync`
67+
- `SearchVectorStore` and `SearchVectorStoreAsync`
68+
- `UpdateVectorStoreFileAttributes` and `UpdateVectorStoreFileAttributes`
69+
70+
### Bugs fixed
71+
72+
- OpenAI.Files:
73+
- Added a `SizeInBytesLong` property to `OpenAIFile` to correctly represent the size of a file.
74+
- OpenAI.Responses:
75+
- Fixed an issue where setting the `ReasoningSummaryVerbosity` property of `ResponseReasoningOptions` was sending the wrong property to the service.
76+
- Fixed an issue with the `CreateInputFilePart` method of `ResponseContentPart` not being able to send files as `BinaryData`.
77+
78+
### Breaking changes in Preview APIs
79+
80+
- Removed the implicit operator from all models that converts a model to `BinaryContent`.
81+
- Removed the explicit operator from all models that converts a `ClientResult` to a model.
82+
- OpenAI:
83+
- Renamed the `GetRealtimeConversationClient` method from `OpenAIClient` to `GetRealtimeClient`.
84+
- OpenAI.FineTuning:
85+
- Renamed the `FineTuningJobOperation` class to `FineTuningJob`.
86+
- Removed protocol methods for `CreateFineTuningJob`, `GetJob`, and `GetJobs` and added convenience methods for them.
87+
- OpenAI.Realtime:
88+
- Updated namespace from `OpenAI.Conversations` to `OpenAI.Realtime`. All APIs and types related to real-time conversations have been moved to the new `OpenAI.Realtime` namespace.
89+
- OpenAI.Responses:
90+
- Removed the `SummaryTextParts` property of `ReasoningResponseItem` in favor a new property called `SummaryParts`.
91+
- Removed the following public constructors:
92+
- `FileSearchCallResponseItem(IEnumerable<string> queries, IEnumerable<FileSearchCallResult> results)`
93+
- `FunctionCallOutputResponseItem(string callId, string functionOutput)`
94+
- `FunctionCallResponseItem(string callId, string functionName, BinaryData functionArguments)`
95+
- Made several properties read-only that were previously settable:
96+
- `CallId` and `Output` in `ComputerCallOutputResponseItem`
97+
- `Action`, `CallId`, and `Status` in `ComputerCallResponseItem`
98+
- `Results` and `Status` in `FileSearchCallResponseItem`
99+
- `CallId` in `FunctionCallOutputResponseItem`
100+
- `CallId` in `FunctionCallResponseItem`
101+
- Changed the following property types:
102+
- `Attributes` in `FileSearchCallResult` is now `IReadOnlyDictionary<string, BinaryData>` instead of `IDictionary<string, BinaryData>`.
103+
- `Status` properties are now nullable in multiple response item types.
104+
- `Code` in `ResponseError` is now `ResponseErrorCode` instead of `string`.
105+
- Renamed the `WebSearchToolContextSize` extensible enum to `WebSearchContextSize`.
106+
- Renamed the `WebSearchToolLocation` class to `WebSearchUserLocation`.
107+
- OpenAI.VectorStores:
108+
- Renamed method parameters from `vectorStore` to `options` in `CreateVectorStore` and `ModifyVectorStore` methods in `VectorStoreClient`.
109+
3110
## 2.2.0-beta.4 (2025-03-18)
4111

112+
### Features Added
113+
5114
- OpenAI.Chat:
6115
- Enabled support for file inputs. When using models with vision capabilities, you can now also provide PDF files as inputs, either as a file ID or as base64-encoded data. ([aaa924e](https://github.com/openai/openai-dotnet/commit/aaa924ecde1b2281257f26824fea038a3b1efe35))
7116
- Added the `CreateFilePart(string fileId)` and `CreateFilePart(BinaryData fileBytes, string fileBytesMediaType, string filename)` factory methods to `ChatMessageContentPart`.

README.md

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,15 @@ While you can pass your API key directly as a string, it is highly recommended t
7373
If you need to connect to an alternative API endpoint (for example, a proxy or self-hosted OpenAI-compatible LLM), you can specify a custom base URL and API key using the `ApiKeyCredential` and `OpenAIClientOptions`:
7474

7575
```csharp
76-
using OpenAI.Chat;
7776
using OpenAI;
77+
using OpenAI.Chat;
7878

79-
var client = new ChatClient(
80-
model: CHAT_MODEL,
81-
credential: new ApiKeyCredential(Environment.GetEnvironmentVariable("API_KEY") ?? ""),
82-
options: new OpenAIClientOptions
83-
{
84-
Endpoint = new Uri(BASE_URL),
79+
ChatClient client = new(
80+
model: "MODEL_NAME",
81+
credential: new ApiKeyCredential(Environment.GetEnvironmentVariable("OPENAI_API_KEY")),
82+
options: new OpenAIClientOptions()
83+
{
84+
Endpoint = new Uri("BASE_URL")
8585
}
8686
);
8787
```
@@ -92,20 +92,22 @@ Replace `CHAT_MODEL` with your model name and `BASE_URL` with your endpoint URI.
9292

9393
The library is organized into namespaces by feature areas in the OpenAI REST API. Each namespace contains a corresponding client class.
9494

95-
| Namespace | Client class | Notes |
96-
| ------------------------------|------------------------------|-------------------------------------------------------------------|
97-
| `OpenAI.Assistants` | `AssistantClient` | ![Experimental](https://img.shields.io/badge/experimental-purple) |
98-
| `OpenAI.Audio` | `AudioClient` | |
99-
| `OpenAI.Batch` | `BatchClient` | ![Experimental](https://img.shields.io/badge/experimental-purple) |
100-
| `OpenAI.Chat` | `ChatClient` | |
101-
| `OpenAI.Embeddings` | `EmbeddingClient` | |
102-
| `OpenAI.FineTuning` | `FineTuningClient` | ![Experimental](https://img.shields.io/badge/experimental-purple) |
103-
| `OpenAI.Files` | `OpenAIFileClient` | |
104-
| `OpenAI.Images` | `ImageClient` | |
105-
| `OpenAI.Models` | `OpenAIModelClient` | |
106-
| `OpenAI.Moderations` | `ModerationClient` | |
107-
| `OpenAI.Responses` | `OpenAIResponseClient` | |
108-
| `OpenAI.VectorStores` | `VectorStoreClient` | ![Experimental](https://img.shields.io/badge/experimental-purple) |
95+
| Namespace | Client class |
96+
| ------------------------------|------------------------------|
97+
| `OpenAI.Assistants` | `AssistantClient` |
98+
| `OpenAI.Audio` | `AudioClient` |
99+
| `OpenAI.Batch` | `BatchClient` |
100+
| `OpenAI.Chat` | `ChatClient` |
101+
| `OpenAI.Embeddings` | `EmbeddingClient` |
102+
| `OpenAI.Evals` | `EvaluationClient` |
103+
| `OpenAI.FineTuning` | `FineTuningClient` |
104+
| `OpenAI.Files` | `OpenAIFileClient` |
105+
| `OpenAI.Images` | `ImageClient` |
106+
| `OpenAI.Models` | `OpenAIModelClient` |
107+
| `OpenAI.Moderations` | `ModerationClient` |
108+
| `OpenAI.Realtime` | `RealtimeClient` |
109+
| `OpenAI.Responses` | `OpenAIResponseClient` |
110+
| `OpenAI.VectorStores` | `VectorStoreClient` |
109111

110112
### Using the async API
111113

0 commit comments

Comments
 (0)