Skip to content

Commit 31c2ba6

Browse files
authored
Prepare 2.0.0 release (Part 1) (#233)
- Implemented `ChatMessageContent` to encapsulate the representation of content parts in `ChatMessage`, `ChatCompletion`, and `StreamingChatCompletionUpdate`. - Changed the representation of function arguments to `BinaryData` in `ChatToolCall`, `StreamingChatToolCallUpdate`, `ChatFunctionCall`, and `StreamingChatFunctionCallUpdate`. - Renamed `OpenAIClientOptions`'s `ApplicationId` to `UserAgentApplicationId` (commit_hash) - Renamed `StreamingChatToolCallUpdate`'s `Id` to `ToolCallId` - Renamed `StreamingChatCompletionUpdate`'s `Id` to `CompletionId` - Replaced `Auto` and `None` in the deprecated `ChatFunctionChoice` with `CreateAutoChoice()` and `CreateNoneChoice()` - Replaced the deprecated `ChatFunctionChoice(ChatFunction)` constructor with `CreateNamedChoice(string functionName)` - Renamed `FileClient` to `OpenAIFileClient` and the corresponding `GetFileClient()` method in `OpenAIClient` to `GetOpenAIFileClient()`. - Renamed `ModelClient` to `OpenAIModelClient` and the corresponding `GetModelClient()` method in `OpenAIClient` to `GetOpenAIModelClient()`.
1 parent eb0e82f commit 31c2ba6

File tree

125 files changed

+1478
-1106
lines changed

Some content is hidden

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

125 files changed

+1478
-1106
lines changed

CHANGELOG.md

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

3+
## 2.0.0-beta.14 (Unreleased)
4+
5+
### Breaking Changes
6+
7+
- Implemented `ChatMessageContent` to encapsulate the representation of content parts in `ChatMessage`, `ChatCompletion`, and `StreamingChatCompletionUpdate`. (commit_hash)
8+
- Changed the representation of function arguments to `BinaryData` in `ChatToolCall`, `StreamingChatToolCallUpdate`, `ChatFunctionCall`, and `StreamingChatFunctionCallUpdate`. (commit_hash)
9+
- Renamed `OpenAIClientOptions`'s `ApplicationId` to `UserAgentApplicationId` (commit_hash)
10+
- Renamed `StreamingChatToolCallUpdate`'s `Id` to `ToolCallId` (commit_hash)
11+
- Renamed `StreamingChatCompletionUpdate`'s `Id` to `CompletionId` (commit_hash)
12+
- Replaced `Auto` and `None` in the deprecated `ChatFunctionChoice` with `CreateAutoChoice()` and `CreateNoneChoice()` (commit_hash)
13+
- Replaced the deprecated `ChatFunctionChoice(ChatFunction)` constructor with `CreateNamedChoice(string functionName)` (commit_hash)
14+
- Renamed `FileClient` to `OpenAIFileClient` and the corresponding `GetFileClient()` method in `OpenAIClient` to `GetOpenAIFileClient()`. (commit_hash)
15+
- Renamed `ModelClient` to `OpenAIModelClient` and the corresponding `GetModelClient()` method in `OpenAIClient` to `GetOpenAIModelClient()`. (commit_hash)
16+
317
## 2.0.0-beta.13 (2024-09-27)
418

519
### Breaking Changes

MigrationGuide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ Old library's endpoint|New library's client
4848
|Translations | AudioClient
4949
|Moderation | ModerationClient
5050
|Embeddings | EmbeddingClient
51-
|Files | FileClient
52-
|Models | ModelClient
51+
|Files | OpenAIFileClient
52+
|Models | OpenAIModelClient
5353
|Completions | Not supported
5454

5555
## Authentication

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ The library is organized into several namespaces corresponding to OpenAI feature
7474
| `OpenAI.Chat` | `ChatClient` | |
7575
| `OpenAI.Embeddings` | `EmbeddingClient` | |
7676
| `OpenAI.FineTuning` | `FineTuningClient` | ![Experimental](https://img.shields.io/badge/experimental-purple) |
77-
| `OpenAI.Files` | `FileClient` | |
77+
| `OpenAI.Files` | `OpenAIFileClient` | |
7878
| `OpenAI.Images` | `ImageClient` | |
79-
| `OpenAI.Models` | `ModelClient` | |
79+
| `OpenAI.Models` | `OpenAIModelClient` | |
8080
| `OpenAI.Moderations` | `ModerationClient` | |
8181
| `OpenAI.VectorStores` | `VectorStoreClient` | ![Experimental](https://img.shields.io/badge/experimental-purple) |
8282

@@ -466,7 +466,7 @@ foreach (TranscribedSegment segment in transcription.Segments)
466466

467467
In this example, you have a JSON document with the monthly sales information of different products, and you want to build an assistant capable of analyzing it and answering questions about it.
468468

469-
To achieve this, use both `FileClient` from the `OpenAI.Files` namespace and `AssistantClient` from the `OpenAI.Assistants` namespace.
469+
To achieve this, use both `OpenAIFileClient` from the `OpenAI.Files` namespace and `AssistantClient` from the `OpenAI.Assistants` namespace.
470470

471471
Important: The Assistants REST API is currently in beta. As such, the details are subject to change, and correspondingly the `AssistantClient` is attributed as `[Experimental]`. To use it, suppress the `OPENAI001` warning at either the project level or, as below, in the code itself.
472472

@@ -477,7 +477,7 @@ using OpenAI.Files;
477477
// Assistants is a beta API and subject to change; acknowledge its experimental status by suppressing the matching warning.
478478
#pragma warning disable OPENAI001
479479
OpenAIClient openAIClient = new(Environment.GetEnvironmentVariable("OPENAI_API_KEY"));
480-
FileClient fileClient = openAIClient.GetFileClient();
480+
OpenAIFileClient fileClient = openAIClient.GetOpenAIFileClient();
481481
AssistantClient assistantClient = openAIClient.GetAssistantClient();
482482
```
483483

@@ -514,7 +514,7 @@ using Stream document = BinaryData.FromString("""
514514
""").ToStream();
515515
```
516516

517-
Upload this document to OpenAI using the `FileClient`'s `UploadFile` method, ensuring that you use `FileUploadPurpose.Assistants` to allow your assistant to access it later:
517+
Upload this document to OpenAI using the `OpenAIFileClient`'s `UploadFile` method, ensuring that you use `FileUploadPurpose.Assistants` to allow your assistant to access it later:
518518

519519
```csharp
520520
OpenAIFile salesFile = fileClient.UploadFile(
@@ -654,13 +654,13 @@ The graph above visualizes this trend, showing a peak in sales during February.
654654

655655
This example shows how to use the v2 Assistants API to provide image data to an assistant and then stream the run's response.
656656

657-
As before, you will use a `FileClient` and an `AssistantClient`:
657+
As before, you will use a `OpenAIFileClient` and an `AssistantClient`:
658658

659659
```csharp
660660
// Assistants is a beta API and subject to change; acknowledge its experimental status by suppressing the matching warning.
661661
#pragma warning disable OPENAI001
662662
OpenAIClient openAIClient = new(Environment.GetEnvironmentVariable("OPENAI_API_KEY"));
663-
FileClient fileClient = openAIClient.GetFileClient();
663+
OpenAIFileClient fileClient = openAIClient.GetOpenAIFileClient();
664664
AssistantClient assistantClient = openAIClient.GetAssistantClient();
665665
```
666666

0 commit comments

Comments
 (0)