Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News OpenAI Releases Official .NET Library

OpenAI Releases Official .NET Library

Last week, OpenAI released the first beta version of its official .NET library, which is available as a NuGet package for .NET developers to try. This release follows Microsoft's announcement at the Build 2024 conference, highlighting their collaboration with OpenAI to enhance the .NET ecosystem with advanced AI capabilities.

This 2.0.0-beta.1 version of the official OpenAI library for .NET supports the entire OpenAI API, including Assistants v2 and Chat Completions. It also integrates with GPT-4o, OpenAI’s latest flagship model. With the note that, the library is generated from OpenAPI specification in collaboration with Microsoft.

As reported, the library is designed with extensibility in mind, allowing the community to build additional libraries on top of it. Also, both synchronous and asynchronous APIs are provided for developers. Additionally, the library includes access to streaming completions via IAsyncEnumerable<T>.

Regarding the expansion of the .NET AI ecosystem, Microsoft states the following:

We have collaborated with numerous partners, at Microsoft and across the industry, to enable developers to tap into the AI ecosystem. One of our most exciting collaborations this year has been with OpenAI. We partnered with them to deliver an official .NET library, which is set to be released later this month. This collaboration and new SDK ensures that .NET developers have a delightful experience and will have parity with other programming language libraries that you may be familiar with. It also provides support for the latest OpenAI features and models, such as GPT4o and Assistants v2, and a unified experience across OpenAI and Azure OpenAI

The library makes integration with both OpenAI and Azure OpenAI easier for developers. It also, complements the existing official libraries available for Python and TypeScript/JavaScript developers, offering .NET developers robust tools to work with OpenAI’s technology.

The .NET library is being developed and supported on GitHub, where, as stated in the announcement, it will be regularly updated with the latest features from OpenAI. As reported, over the next few months, the project will be focused on gathering user feedback to refine the library and eventually release a stable NuGet package.

In acknowledging the work done before this official release, the .NET team highlighted the contributions of user Roger Pincombe and community-developed libraries like Betalgo.OpenAI by Betalgo and OpenAI-DotNet by RageAgainstThePixel.

The community raised several questions regarding the new OpenAI .NET library and its integration with existing packages. One key question concerned the Azure.AI.OpenAI package. Microsoft clarified that the existing package is being transformed into a companion library for the Azure OpenAI Service, introducing a dedicated AzureOpenAIClient.

This update aims to simplify interoperability between Azure and non-Azure OpenAI services, with significant changes anticipated. Feedback from the community is actively encouraged to refine these updates.

Another inquiry addressed support for the latest GPT-4o features, such as audio streaming and image and video recognition. The answer confirmed that these features are supported and directed users to the main repository for more code samples.

There were also questions regarding the relationship between the new OpenAI library and ML.NET, the team member stated that the two are unrelated. However, they welcomed feedback on potential integrations between ML.NET and OpenAI models.

More about the OpenAI library for .NET readers can be found on the official GitHub project repository and the nuget package page.

About the Author

Rate this Article