{"id":1281,"date":"2024-10-01T20:20:21","date_gmt":"2024-10-01T20:20:21","guid":{"rendered":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/2024\/10\/01\/announcing-the-stable-release-of-the-official-openai-library-for-net\/"},"modified":"2024-10-01T20:20:21","modified_gmt":"2024-10-01T20:20:21","slug":"announcing-the-stable-release-of-the-official-openai-library-for-net","status":"publish","type":"post","link":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/2024\/10\/01\/announcing-the-stable-release-of-the-official-openai-library-for-net\/","title":{"rendered":"Announcing the stable release of the official OpenAI library for .NET"},"content":{"rendered":"<p>Back in June, <a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/openai-dotnet-library\/\">we launched<\/a> the first beta of the OpenAI library for .NET, empowering developers to integrate advanced AI models into their applications. Today, we are excited to share that the <strong>stable release<\/strong> of the <strong><a href=\"https:\/\/www.nuget.org\/packages\/OpenAI\/2.0.0\">official OpenAI library for .NET<\/a><\/strong> is now live. This release ensures a smooth and reliable integration experience for developers working with OpenAI and Azure OpenAI services in their .NET applications.<\/p>\n<p><a href=\"https:\/\/www.nuget.org\/packages\/OpenAI\/\"><\/a><\/p>\n<h2>Key features<\/h2>\n<p>The official OpenAI library for .NET provides powerful tools that simplify integrating OpenAI\u2019s cutting-edge models into your .NET applications, offering developers a streamlined experience:<\/p>\n<p><strong>Full OpenAI REST API support<\/strong>: Includes Assistants v2 and Chat Completions, enabling flexible and advanced interactions.<br \/>\n<strong>Support for latest models<\/strong>: OpenAI\u2019s 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.<br \/>\n<strong>Extensibility<\/strong>: The library is designed with extensibility in mind, allowing the community to build additional libraries on top of it.<br \/>\n<strong>Sync and async APIs<\/strong>: These ensure developers have the flexibility to use synchronous or asynchronous patterns depending on their application\u2019s needs.<br \/>\n<strong>Streaming completions<\/strong>: Access to streaming completions via IAsyncEnumerable&lt;T&gt;, offering more dynamic interaction models.<br \/>\n<strong>Quality-of-life improvements<\/strong>: Numerous improvements have been made throughout the beta cycle based on community feedback.<br \/>\n<strong>.NET Standard 2.0 compatibility<\/strong>: This library, written in C#, supports all .NET variants that implement <a href=\"https:\/\/learn.microsoft.com\/dotnet\/standard\/net-standard?tabs=net-standard-2-0#select-net-standard-version\">.NET Standard 2.0<\/a>, ensuring compatibility with the latest .NET platforms.<\/p>\n<p>This official .NET library ensures a smooth and supported <a href=\"https:\/\/github.com\/openai\/openai-dotnet?tab=readme-ov-file#how-to-work-with-azure-openai\">integration with OpenAI and Azure OpenAI<\/a>. It also complements OpenAI\u2019s official libraries for Python and TypeScript\/JavaScript developers.<\/p>\n<p>The library is open-source, developed, and supported on <a href=\"https:\/\/github.com\/openai\/openai-dotnet\">GitHub<\/a>. It will be kept up to date with the latest features from OpenAI.<\/p>\n<h2>Sample code<\/h2>\n<p>Here\u2019s a quick look at how easy it is to use the OpenAI library in a .NET application. The following code snippet demonstrates how to create an OpenAI client and use it to complete a chat interaction:<\/p>\n<p>using OpenAI.Chat;<\/p>\n<p>ChatClient client = new(<br \/>\n    model: &#8220;gpt-4o&#8221;,<br \/>\n    apiKey: Environment.GetEnvironmentVariable(&#8220;OPENAI_API_KEY&#8221;));<br \/>\nChatCompletion completion = client.CompleteChat(&#8220;Say &#8216;this is a test.'&#8221;);<\/p>\n<p>Console.WriteLine($&#8221;[ASSISTANT]: {completion.Content[0].Text}&#8221;);<\/p>\n<h2>Thank you to the .NET community<\/h2>\n<p>This stable release wouldn\u2019t have been possible without the continued support and feedback from the .NET community. Over the course of the beta, we\u2019ve seen significant engagement and contributions that helped shape this release. We\u2019re committed to continuing this collaboration as the library evolves.<\/p>\n<h2>Get started today<\/h2>\n<p><strong>Try the library<\/strong>: Install the NuGet package for the <a href=\"https:\/\/www.nuget.org\/packages\/OpenAI\/2.0.0\">official OpenAI library for .NET<\/a> and start experimenting with its features.<br \/>\n<strong>Join the community<\/strong>: Engage with us and other developers on <a href=\"https:\/\/github.com\/openai\/openai-dotnet\">GitHub<\/a>. Share your experiences, report issues, and contribute to discussions.<\/p>\n<p>The post <a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/announcing-the-stable-release-of-the-official-open-ai-library-for-dotnet\/\">Announcing the stable release of the official OpenAI library for .NET<\/a> appeared first on <a href=\"https:\/\/devblogs.microsoft.com\/dotnet\">.NET Blog<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>Back in June, we launched the first beta of the OpenAI library for .NET, empowering developers to integrate advanced AI [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[7],"tags":[],"class_list":["post-1281","post","type-post","status-publish","format-standard","hentry","category-dotnet"],"_links":{"self":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/posts\/1281","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/comments?post=1281"}],"version-history":[{"count":0,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/posts\/1281\/revisions"}],"wp:attachment":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/media?parent=1281"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/categories?post=1281"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/tags?post=1281"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}