Skip to content

Latest commit

 

History

History
376 lines (267 loc) · 39.7 KB

CHANGELOG.md

File metadata and controls

376 lines (267 loc) · 39.7 KB

Release History

2.1.0 (2024-12-04)

Features added

  • OpenAI.Assistants:

Breaking Changes in Preview APIs

  • OpenAI.RealtimeConversation:
    • Renamed the From*() factory methods on ConversationContentPart to Create*Part() for consistency. (bf3f0ed)
    • Removed an extraneous toolCallId parameter from ConversationItem.CreateSystemMessage(). (bf3f0ed)
  • OpenAI.Assistants:
    • Renamed RunStepType to RunStepKind. (bf3f0ed)
    • Changed RunStepKind from an "extensible enum" to a regular enum. (bf3f0ed)
    • Renamed the ToolCallId property of RunStepToolCall to Id. (bf3f0ed)
    • Renamed the ToolKind property of RunStepToolCall to Kind. (bf3f0ed)
    • Replaced the FileSearchRanker and FileSearchScoreThreshold properties of RunStepToolCall with a new FileSearchRankingOptions property that contains both values to make it clearer how they are related. (bf3f0ed)

Bugs fixed

  • OpenAI.RealtimeConversation:
    • Fixed serialization issues with ConversationItem creation of system and assistant messages. (bf3f0ed)
    • Fixed an issue causing a deadlock when calling the RealtimeConversationSession's SendInputAudio method overload that takes a BinaryData parameter. (f491c2d)

2.1.0-beta.2 (2024-11-04)

Features added

  • OpenAI.Chat:
    • Added a StoredOutputEnabled property to ChatCompletionOptions (store in the REST API). (b0f9e5c)
      • Use this property to indicate whether or not to store the output of the chat completion for use in model distillation or evals.
    • Added a Metadata property to ChatCompletionOptions (metadata in the REST API). (b0f9e5c)
      • Use this property to add custom tags and values to the chat completions for filtering in the OpenAI dashboard.
    • Added an InputTokenDetails property to ChatTokenUsage (usage.prompt_token_details in the REST API). (b0f9e5c)
      • The property is of a new type called ChatInputTokenUsageDetails, which contains properties for AudioTokenCount and CachedTokenCount for usage with supported models.
    • Added an AudioTokenCount property to ChatOutputTokenUsageDetails (usage.completion_token_details in the REST API). Audio support in chat completions is coming soon. (b0f9e5c)
  • OpenAI.Moderations:
    • Added Illicit and IllicitViolent properties ModerationResult to represent these two new moderation categories. (b0f9e5c)

Breaking Changes in Preview APIs

  • OpenAI.RealtimeConversation:
    • 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. (b0f9e5c)
      • Several types have been renamed for consistency and clarity.
      • ConversationRateLimitsUpdate (previously ConversationRateLimitsUpdatedUpdate) now includes named RequestDetails and TokenDetails properties, mapping to the corresponding named items in the underlying rate_limits command payload.

Bugs Fixed

  • OpenAI.RealtimeConversation:
    • Fixed serialization and deserialization of ConversationToolChoice literal values (such as "required"). (9de3709)

Other Changes

  • Updated the System.ClientModel dependency to version 1.2.1. (b0f9e5c)
    • This updates the System.Text.Json transitive dependency to version 6.0.10, which includes a security compliance fix for CVE-2024-43485. Please note that the OpenAI library was not impacted by this vulnerability since it does not use the [JsonExtensionData] feature.

2.1.0-beta.1 (2024-10-01)

Note

With this updated preview library release, we're excited to bring early support for the newly-announced /realtime beta API. You can read more about /realtime here: https://openai.com/index/introducing-the-realtime-api/. Given the scope and recency of the feature area, the new RealtimeConversationClient is subject to substantial refinement and change over the coming weeks -- this release is purely intended to empower early development against gpt-4o-realtime-preview as quickly and efficiently as possible.

Features Added

2.0.0 (2024-09-30)

Note

First stable version of the official OpenAI library for .NET.

Features Added

  • Support for OpenAI's latest flagship models, including GPT-4o, GPT-4o mini, o1-preview, and o1-mini
  • Support for the entire OpenAI REST API, including:
    • Structured outputs
    • Reasoning tokens
    • Experimental support for Assistants beta v2
  • Support for sync and async APIs
  • Convenient APIs to facilitate working with streaming chat completions and assistants
  • Tons of other quality-of-life features for ease of use and productivity

Breaking Changes

Note

The following breaking changes only apply when upgrading from the previous 2.0.0-beta.* versions.

  • Implemented ChatMessageContent to encapsulate the representation of content parts in ChatMessage, ChatCompletion, and StreamingChatCompletionUpdate. (31c2ba6)
  • Changed the representation of function arguments to BinaryData in ChatToolCall, StreamingChatToolCallUpdate, ChatFunctionCall, and StreamingChatFunctionCallUpdate. (31c2ba6)
  • Renamed OpenAIClientOptions's ApplicationId to UserAgentApplicationId. (31c2ba6)
  • Renamed StreamingChatToolCallUpdate's Id to ToolCallId. (31c2ba6)
  • Renamed StreamingChatCompletionUpdate's Id to CompletionId. (31c2ba6)
  • Replaced Auto and None in the deprecated ChatFunctionChoice with CreateAutoChoice() and CreateNoneChoice(). (31c2ba6)
  • Replaced the deprecated ChatFunctionChoice(ChatFunction) constructor with CreateNamedChoice(string functionName). (31c2ba6)
  • Renamed FileClient to OpenAIFileClient and the corresponding GetFileClient() method in OpenAIClient to GetOpenAIFileClient(). (31c2ba6)
  • Renamed ModelClient to OpenAIModelClient and the corresponding GetModelClient() method in OpenAIClient to GetOpenAIModelClient(). (31c2ba6)

2.0.0-beta.13 (2024-09-27)

Breaking Changes

  • Refactored ModerationResult by merging ModerationCategories and ModerationCategoryScores into individual ModerationCategory properties, each with Flagged and Score properties. (19ceae4)
  • Renamed type OpenAIFileInfo to OpenAIFile and OpenAIFileInfoCollection to OpenAIFileCollection. (19ceae4)
  • Renamed type OpenAIModelInfo to OpenAIModel and OpenAIModelInfoCollection to OpenAIModelCollection. (19ceae4)
  • Renamed type Embedding to OpenAIEmbedding and EmbeddingCollection to OpenAIEmbeddingCollection. (19ceae4)
  • Renamed property ImageUrl to ImageUri and method FromImageUrl to FromImageUri in the MessageContent type. (19ceae4)
  • Renamed property ParallelToolCallsEnabled to AllowParallelToolCalls in the RunCreationOptions, ThreadRun, and ChatCompletionOptions types. (19ceae4)
  • Renamed properties PromptTokens to InputTokenCount, CompletionTokens to OutputTokenCount, and TotalTokens to TotalTokenCount in the RunTokenUsage and RunStepTokenUsage types. (19ceae4)
  • Renamed properties InputTokens to InputTokenCount and TotalTokens to TotalTokenCount in the EmbeddingTokenUsage type. (19ceae4)
  • Renamed properties MaxPromptTokens to MaxInputTokenCount and MaxCompletionTokens to MaxOutputTokenCount in the ThreadRun, RunCreationOptions, and RunIncompleteReason types. (19ceae4)
  • Removed the virtual keyword from the Pipeline property across all clients. (75eded5)
  • Renamed the Granularities property of AudioTranscriptionOptions to TimestampGranularities. (a330c2e)
  • Changed AudioTranscriptionFormat from an enum to an "extensible enum". (a330c2e)
  • Changed AudioTranslationFormat from an enum to an "extensible enum". (a330c2e)
  • Changed GenerateImageFormat from an enum to an "extensible enum". (a330c2e)
  • Changed GeneratedImageQuality from an enum to an "extensible enum". (a330c2e)
  • Changed GeneratedImageStyle from an enum to an "extensible enum". (a330c2e)
  • Removed method overloads in AssistantClient and VectorStoreClient that take complex parameters in favor of methods that take simple string IDs. (a330c2e)
  • Updated the TokenIds property type in the TranscribedSegment type from IReadOnlyList<int> to ReadOnlyMemory<int>. (a330c2e)
  • Updated the inputs parameter type in the GenerateEmbeddings and GenerateEmbeddingsAsync methods of EmbeddingClient from IEnumerable<IEnumerable<int>> to IEnumerable<ReadOnlyMemory<int>>. (a330c2e)
  • Changed ChatMessageContentPartKind from an extensible enum to an enum. (a330c2e)
  • Changed ChatToolCallKind from an extensible enum to an enum. (a330c2e)
  • Changed ChatToolKind from an extensible enum to an enum. (a330c2e)
  • Changed OpenAIFilePurpose from an extensible enum to an enum. (a330c2e)
  • Changed OpenAIFileStatus from an extensible enum to an enum. (a330c2e)
  • Renamed OpenAIFilePurpose to FilePurpose. (a330c2e)
  • Renamed OpenAIFileStatus to FileStatus. (a330c2e)
  • Removed constructors that take string API key and options. (a330c2e)

2.0.0-beta.12 (2024-09-20)

Features Added

  • The library now includes support for the new OpenAI o1 model family. (2ab1a94)
    • ChatCompletionOptions will automatically apply its MaxOutputTokenCount value (renamed from MaxTokens) to the new max_completion_tokens request body property
    • Usage includes a new OutputTokenDetails property with a ReasoningTokenCount value that will reflect o1 model use of this new subcategory of output tokens.
    • Note that OutputTokenCount (completion_tokens) is the sum of displayed tokens generated by the model and (when applicable) these new reasoning tokens
  • Assistants file search now includes support for RankingOptions. (2ab1a94)
    • Use of the include[] query string parameter and retrieval of run step detail result content is currently only available via protocol methods
  • Added support for the Uploads API in FileClient. This Experimental feature allows uploading large files in multiple parts. (2ab1a94)
    • The feature is supported by the CreateUpload, AddUploadPart, CompleteUpload, and CancelUpload protocol methods.

Breaking Changes

  • Renamed ChatMessageContentPart's CreateTextMessageContentPart factory method to CreateTextPart. (2ab1a94)
  • Renamed ChatMessageContentPart's CreateImageMessageContentPart factory method to CreateImagePart. (2ab1a94)
  • Renamed ChatMessageContentPart's CreateRefusalMessageContentPart factory method to CreateRefusalPart. (2ab1a94)
  • Renamed ImageChatMessageContentPartDetail to ChatImageDetailLevel. (2ab1a94)
  • Removed ChatMessageContentPart's ToString overload. (2ab1a94)
  • Renamed the MaxTokens property in ChatCompletionOptions to MaxOutputTokenCount. (2ab1a94)
  • Renamed properties in ChatTokenUsage:
    • InputTokens is renamed to InputTokenCount. (2ab1a94)
    • OutputTokens is renamed to OutputTokenCount. (2ab1a94)
    • TotalTokens is renamed to TotalTokenCount. (2ab1a94)
  • Removed the common ListOrder enum from the top-level OpenAI namespace in favor of individual enums in their corresponding sub-namespace. (2ab1a94)
  • Renamed the PageSize property to PageSizeLimit. (2ab1a94)
  • Updated deletion methods to return a result object instead of a bool. Affected methods:
    • DeleteAssitant, DeleteMessage, and DeleteThread in AssistantClient. (2ab1a94)
    • DeleteVectorStore and RemoveFileFromStore in VectorStoreClient. (2ab1a94)
    • DeleteModel in ModelClient. (2ab1a94)
    • DeleteFile in FileClient. (2ab1a94)
  • Removed setters from collection properties. (2ab1a94)
  • Renamed ChatTokenLogProbabilityInfo to ChatTokenLogProbabilityDetails. (2ab1a94)
  • Renamed ChatTokenTopLogProbabilityInfo to ChatTokenTopLogProbabilityDetails. (2ab1a94)
  • Renamed the Utf8ByteValues properties of ChatTokenLogProbabilityDetails and ChatTokenTopLogProbabilityDetails to Utf8Bytes and changed their type from IReadOnlyList<int> to ReadOnlyMemory<byte>?. (2ab1a94)
  • Renamed the Start and End properties of TranscribedSegment and TranscribedWord to StartTime and EndTime. (2ab1a94)
  • Changed the type of TranscribedSegment's AverageLogProbability and NoSpeechProbability properties from double to float. (2ab1a94)
  • Changed the type of TranscribedSegment's SeekOffset property from long to int. (2ab1a94)
  • Changed the type of TranscribedSegment's TokenIds property from IReadOnlyList<long> to IReadOnlyList<int>. (2ab1a94)
  • Updated the Embedding.Vector property to the Embedding.ToFloats() method. (2ab1a94)
  • Removed the optional parameter from the constructors of VectorStoreCreationHelper, AssistantChatMessage, and ChatFunction. (2ab1a94)
  • Removed the optional purpose parameter from FileClient.GetFilesAsync and FileClient.GetFiles methods, and added overloads where purpose is required. (2ab1a94)
  • Renamed ModerationClient's ClassifyTextInput methods to ClassifyText. (2ab1a94)
  • Removed duplicated Created property from GeneratedImageCollection. (2ab1a94)

Bugs Fixed

  • Addressed an issue that caused multi-page queries of fine-tuning jobs, checkpoints, and events to fail. (2ab1a94)
  • ChatCompletionOptions can now be serialized via ModelReaderWriter.Write() prior to calling CompleteChat using the options. (2ab1a94)

Other Changes

  • Added support for CancellationToken to ModelClient methods. (2ab1a94)
  • Applied the Obsolete attribute where appropriate to align with the existing deprecations in the REST API. (2ab1a94)

2.0.0-beta.11 (2024-09-03)

Features Added

  • Added the OpenAIChatModelFactory in the OpenAI.Chat namespace (a static class that can be used to instantiate OpenAI models for mocking in non-live test scenarios). (79014ab)

Breaking Changes

  • Updated fine-tuning pagination methods GetJobs, GetEvents, and GetJobCheckpoints to return IEnumerable<ClientResult> instead of ClientResult. (5773292)
  • Updated the batching pagination method GetBatches to return IEnumerable<ClientResult> instead of ClientResult. (5773292)
  • Changed GeneratedSpeechVoice from an enum to an "extensible enum". (79014ab)
  • Changed GeneratedSpeechFormat from an enum to an "extensible enum". (cc9169a)
  • Renamed SpeechGenerationOptions's Speed property to SpeedRatio. (cc9169a)

Bugs Fixed

  • Corrected an internal deserialization issue that caused recent updates to Assistants file_search to fail when streaming a run. Strongly typed support for ranking_options is not included but will arrive soon. (cc9169a)
  • Mitigated a .NET runtime issue that prevented ChatResponseFormat from serializing correct on targets including Unity. (cc9169a)

Other Changes

  • Reverted the removal of the version path parameter "v1" from the default endpoint URL. (583e9f6)
  • Added the Experimental attribute to the following APIs:
    • All public APIs in the OpenAI.Assistants namespace. (79014ab)
    • All public APIs in the OpenAI.VectorStores namespace. (79014ab)
    • All public APIs in the OpenAI.Batch namespace. (0f5e024)
    • All public APIs in the OpenAI.FineTuning namespace. (0f5e024)
    • The ChatCompletionOptions.Seed property. (0f5e024)

2.0.0-beta.10 (2024-08-26)

Breaking Changes

  • Renamed AudioClient's GenerateSpeechFromText methods to simply GenerateSpeech. (d84bf54)
  • Changed the type of OpenAIFileInfo's SizeInBytes property from long? to int?. (d84bf54)

Bugs Fixed

  • Fixed a newly introduced bug (#185) where providing OpenAIClientOptions to a top-level OpenAIClient did not carry over to scenario clients (e.g. ChatClient) created via that top-level client (d84bf54)

Other Changes

  • Removed the version path parameter "v1" from the default endpoint URL. (d84bf54)

2.0.0-beta.9 (2024-08-23)

Features Added

  • Added support for the new structured outputs response format feature, which enables chat completions, assistants, and tools on each of those clients to provide a specific JSON Schema that generated content should adhere to. (3467b53)
    • To enable top-level structured outputs for response content, use ChatResponseFormat.CreateJsonSchemaFormat() and AssistantResponseFormat.CreateJsonSchemaFormat() as the ResponseFormat in method options like ChatCompletionOptions
    • To enable structured outputs for function tools, set StrictParameterSchemaEnabled to true on the tool definition
    • For more information, please see the new section in readme.md
  • Chat completions: the request message types of AssistantChatMessage, SystemChatMessage, and ToolChatMessage now support array-based content part collections in addition to simple string input. (3467b53)
  • Added the following model factories (static classes that can be used to instantiate OpenAI models for mocking in non-live test scenarios):
    • OpenAIAudioModelFactory in the OpenAI.Audio namespace (3284295)
    • OpenAIEmbeddingsModelFactory in the OpenAI.Embeddings namespace (3284295)
    • OpenAIFilesModelFactory in the OpenAI.Files namespace (b1ce397)
    • OpenAIImagesModelFactory in the OpenAI.Images namespace (3284295)
    • OpenAIModelsModelFactory in the OpenAI.Models namespace (b1ce397)
    • OpenAIModerationsModelFactory in the OpenAI.Moderations namespace (b1ce397)

Breaking Changes

  • Removed client constructors that do not explicitly take an API key parameter or an endpoint via an OpenAIClientOptions parameter, making it clearer how to appropriately instantiate a client. (13a9c68)
  • Removed the endpoint parameter from all client constructors, making it clearer that an alternative endpoint must be specified via the OpenAIClientOptions parameter. (13a9c68)
  • Removed OpenAIClient's Endpoint protected property. (13a9c68)
  • Made OpenAIClient's constructor that takes a ClientPipeline parameter protected internal instead of just protected. (13a9c68)
  • Renamed the User property in applicable Options classes to EndUserId, making its purpose clearer. (13a9c68)

Bugs Fixed

  • The Assistants namespace VectorStoreCreationHelper type now properly includes a ChunkingStrategy property. (3467b53)

Other Changes

  • ChatCompletion.ToString() will no longer throw an exception when no content is present, as is the case for tool calls. Additionally, if a tool call is present with no content, ToString() will return the serialized form of the first available tool call. (3467b53)

2.0.0-beta.8 (2024-07-31)

Breaking Changes

  • Changed name of return types from methods returning streaming collections from ResultCollection to CollectionResult. (7bdecfd)
  • Changed return types from methods returning paginated collections from PageableCollection to PageCollection. (7bdecfd)
  • Users must now call GetAllValues on the collection of pages to enumerate collection items directly. Corresponding protocol methods return IEnumerable<ClientResult> where each collection item represents a single service response holding a page of values. (7bdecfd)
  • Updated VectorStoreFileCounts and VectorStoreFileAssociationError types from readonly struct to class. (58f93c8)

Bugs Fixed

  • (#49) Fixed a bug with extensible enums implementing case-insensitive equality but case-sensitive hash codes. (0c12500)
  • (#57) Fixed a bug with requests URIs with query string parameter potentially containing a malformed double question mark (??) on .NET Framework (net481). (0c12500)
  • Added optional CancellationToken parameters to methods for AssistantClient and VectorStore client, consistent with past changes in 19a65a0. (d77539c)
  • Fixed Assistants FileSearchToolDefinition's MaxResults parameter to appropriately serialize and deserialize the value (d77539c)
  • Added missing [EditorBrowsable(EditorBrowsableState.Never)] attributes to AssistantClient protocol methods, which should improve discoverability of the strongly typed methods. (d77539c)

Other Changes

  • Removed the usage of init and updated properties to use set. (58f93c8)

2.0.0-beta.7 (2024-06-24)

Bugs Fixed

  • (#84) Fixed a NullReferenceException thrown when adding the custom headers policy while OpenAIClientOptions is null (0b97311)

2.0.0-beta.6 (2024-06-21)

Features Added

  • OrganizationId and ProjectId are now present on OpenAIClientOptions. When instantiating a client, providing an instance of OpenAIClientOptions with these properties set will cause the client to add the appropriate request headers for org/project, eliminating the need to manually configure the headers. (9ee7dff)

Bugs Fixed

  • (#72) Fixed filename request encoding in operations using multipart/form-data, including files and audio (2ba8e69)
  • (#79) Fixed hard-coded user role for caller-created Assistants API messages on threads (d665b61)
  • Fixed non-streaming Assistants API run step details not reporting code interpreter logs when present (d665b61)

Breaking Changes

Assistants (beta):

  • AssistantClient.CreateMessage() and the explicit constructor for ThreadInitializationMessage now require a MessageRole parameter. This properly enables the ability to create an Assistant message representing conversation history on a new thread. (d665b61)

2.0.0-beta.5 (2024-06-14)

Features Added

  • API updates, current to openai/openai-openapi@dd73070b (1af6569)
    • This includes MaxResults for Assistants FileSearchToolDefinition, ParallelToolCallsEnabled for function tools in Assistants and Chat, and FileChunkingStrategy for Assistants VectorStores
  • Optional CancellationToken parameters are now directly present on most methods, eliminating the need to use protocol methods (19a65a0)

Bugs Fixed

  • (#30) Mitigated a .NET runtime issue that prevented chat message content and several other types from serializing correct on targets including mono and wasm (896b9e0)
  • Assistants: Fixed an issue that threw an exception when receiving code interpreter run step logs when streaming a run (207d597)
  • Fixed a concurrency condition that could cause multipart/form-data requests to no longer generate random content part boundaries (no direct scenario impact) (7cacdee)

Breaking Changes

Assistants (beta):

Other Changes

  • Added an environment-variable-based test project to the repository with baseline scenario coverage (db6328a)
  • Build/analyzer warnings cleaned up throughout the project (45fc4d7, b1fa082, 22ab606)
  • Proactively aligned library's implementation of server-sent event (SSE) handling with the source of the incoming System.Net.ServerSentEvents namespace (674e0f7)

2.0.0-beta.4 (2024-06-10)

Features Added

  • Added new, built-in helpers to simplify the use of text-only message content (1c40de6)

Bugs Fixed

  • Optimized embedding deserialization and addressed correctness on big endian systems (e28b5a7)
  • Optimized b64_json message parsing via regex (efd76b5)

2.0.0-beta.3 (2024-06-07)

Bugs Fixed

  • Removed a vestigial package reference (5874f53)

2.0.0-beta.2 (2024-06-06)

Bugs Fixed

  • Addressed an assembly properties issue (bf21eb5)
  • Added migration guide to package (f150666)

2.0.0-beta.1 (2024-06-06)

Features Added

This is the official OpenAI client library for C# / .NET. It provides convenient access to the OpenAI REST API from .NET applications and supports all the latest features. It is generated from our OpenAPI specification in collaboration with Microsoft.

Breaking Changes

If you are a user migrating from version 1.11.0 or earlier, we will soon share a migration guide to help you get started.