OpenAI inBeta release in JuneempressReleased a stable version of its official .. It is based onNuGet PackageNET Standard 2.0, supporting the latest models such as GPT-4o and GPT-4o mini, as well as the full OpenAI REST API. this release includes synchronous and asynchronous APIs, streaming chat completion, and key changes to improve API consistency. Developers can extend the library and use it on all .NET platforms that support .NET Standard 2.0.
NET team at Microsoft on October 1st.an articlesaid in the statement. "Today, we are pleased to announce that theOfficial OpenAI Library for .NET applications with OpenAI and Azure OpenAI services is now available in a stabilized version. This release ensures developers have a smooth and reliable integration experience when using OpenAI and Azure OpenAI services in their .NET applications.
Its purpose is to provide tools to simplify the process of integrating OpenAI's cutting-edge models into .NET applications, providing a streamlined experience for developers, with features that, in Microsoft's words, include:
- Full OpenAI REST API support:Includes Assistants v2 and Chat Completions for flexible and advanced interactions.
- The latest models are supported:OpenAI's latest flagship models, including GPT-4o, GPT-4o mini, o1-preview, and o1-mini, are fully supported, ensuring developers have access to cutting-edge AI capabilities.
- Expansion:The library was designed with extensibility in mind, allowing the community to build other libraries on top of it.
- Synchronous and asynchronous APIs:This ensures that developers have the flexibility to use either synchronous or asynchronous mode depending on the needs of their application.
- Streaming Completion:Streaming complements are accessed through IAsyncEnumerable to provide a more dynamic interaction model.
- Code quality improvement:Numerous improvements were made throughout the beta cycle based on community feedback.
- NET Standard 2.0 compatibility:Written in C#, this library supports all .NET variants that implement .NET Standard 2.0, ensuring compatibility with the latest .
For developers upgrading from version 2.0.0-beta.*, several significant changes have been introduced to improve API consistency and usability:
-
ChatMessageContent
Now encapsulate the content section in theChatMessage
、ChatCompletion
Streaming
cap (a poem)ChatCompletionUpdate
Center. - Function arguments are now represented as multiple fields, including
BinaryData
ChatToolCall
cap (a poem)StreamingChatToolCallUpdate
。 - Various renaming conventions have been applied: renamed to
ApplicationId
、UserAgentApplicationId
because ofFileClient
cap (a poem)OpenAIFileClient
because ofModelClient ,
etc.OpenAIModelClient
- Deprecated constructors and methods have been replaced with new options
ChatFunctionChoice
For example, it would beAuto
cap (a poem)None
Replace withCreateAutoChoice()
cap (a poem)CreateNoneChoice()
。
it (refers sth. preceding it)GitHub RepositoriesDescribes how to use Azure OpenAI:
For Azure OpenAI solutions, use theAzure SDKMore specifically, the use ofAzure OpenAI Client Library for .。
The Azure OpenAI Client Library for .NET is a companion library to this library, sharing the same schema clients, methods, and request/response types for all common functionality between OpenAI and Azure OpenAI. It is designed to make Azure-specific scenarios easy to understand and extends Azure-specific concepts such as Responsible AI Content Filter results and On Your Data integration.
These changes improve clarity and maintain consistency across the API. The OpenAI library for .NET is open source and developed based on ongoing community contributions on GitHub. It will continue to receive updates to keep up with the latest features and improvements to OpenAI. This library, along with OpenAI's existing Python and JavaScript/TypeScript libraries, ensures a unified experience for developers working across different platforms. The community is excited to explore the full potential of this stable release, which marks a significant step forward in delivering powerful AI capabilities to the .NET ecosystem, providing the tools needed to build advanced applications.