{"id":45246,"date":"2023-04-12T11:15:00","date_gmt":"2023-04-12T18:15:00","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/dotnet\/?p=45246"},"modified":"2024-01-12T11:28:15","modified_gmt":"2024-01-12T19:28:15","slug":"getting-started-azure-openai-dotnet","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/getting-started-azure-openai-dotnet\/","title":{"rendered":"Get started with OpenAI in .NET"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p>Welcome to this blog series on OpenAI and .NET!<\/p>\n<p>Artificial intelligence (AI) is changing the ways we live and work. Some early examples of how AI is being embedded into the applications you use today include search in <a href=\"https:\/\/www.microsoft.com\/bing?form=MA13FJ\">Bing<\/a>, office productivity in <a href=\"https:\/\/www.microsoft.com\/microsoft-365\/blog\/2023\/03\/16\/introducing-microsoft-365-copilot-a-whole-new-way-to-work\/\">Microsoft 365<\/a>, and developer productivity in <a href=\"https:\/\/github.com\/features\/copilot\">GitHub<\/a>.<\/p>\n<p>As a developer, you might be thinking, &#8220;I want to use these same AI features in my own applications&#8221;. Although the technology used to train the underlying AI models can be complex, using these models in your applications doesn&#8217;t have to be.<\/p>\n<p>Over the next few months, we plan on publishing a series of blog posts showcasing samples and discussing a series of AI-related building blocks to help you add OpenAI-powered AI capabilities to your .NET applications.<\/p>\n<p>But first, an introduction.<\/p>\n<h2>What is OpenAI<\/h2>\n<p>OpenAI is a research and deployment company. They are the creators of the models powering experiences like <a href=\"https:\/\/openai.com\/blog\/chatgpt\">ChatGPT<\/a> and <a href=\"https:\/\/www.bing.com\/create\">Bing Image Creator<\/a>. These models include:<\/p>\n<ul>\n<li><strong><a href=\"https:\/\/platform.openai.com\/docs\/models\/gpt-3-5\">Generative Pretrained Transformers (GPT)<\/a><\/strong> &#8211; A model that can understand and generate text or code.<\/li>\n<li><strong><a href=\"https:\/\/openai.com\/product\/dall-e-2\">DALL-E<\/a><\/strong> &#8211; A model that can generate and edit images given a text description.<\/li>\n<li><strong><a href=\"https:\/\/openai.com\/research\/whisper\">Whisper<\/a><\/strong> &#8211; A model that can convert audio into text.<\/li>\n<\/ul>\n<h2>What can I do with models like GPT<\/h2>\n<p><img decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2023\/04\/ai-generated-developer-image-3.jpg\" alt=\"AI generated image of developer setting in chair writing code\" width=\"500\" height=\"500\" \/><\/p>\n<p>While there are countless applications OpenAI models like GPT can be used for, the following are just a few examples:<\/p>\n<ul>\n<li>Create a chatbot to answer questions about your business<\/li>\n<li>Categorize the sentiment of a product review<\/li>\n<li>Extract keywords and entities from a document<\/li>\n<li>Translate text from one language to another<\/li>\n<li>Generate images for blog posts<\/li>\n<\/ul>\n<h2>How can I access OpenAI models<\/h2>\n<p>Access to models like GPT is available via REST APIs and libraries.<\/p>\n<p>Additionally, Azure OpenAI Service provides Azure customers with access to OpenAI&#8217;s advanced language AI models such as OpenAI GPT-4 with the security and enterprise promise of Microsoft Azure.<\/p>\n<p>The APIs are co-developed with OpenAI to ensure compatibility and a smooth transition between the two. Customers also benefit from private networking, regional availability, and responsible AI content filtering.<\/p>\n<p>For more details, see the documentation on <a href=\"https:\/\/learn.microsoft.com\/azure\/cognitive-services\/openai\/overview#comparing-azure-openai-and-openai\">comparing Azure OpenAI Service and OpenAI<\/a>.<\/p>\n<h2>How do I get started with OpenAI models and .NET<\/h2>\n<p>There&#8217;s a few options to get started using OpenAI models in .NET:<\/p>\n<ul>\n<li>REST API<\/li>\n<li><a href=\"https:\/\/www.nuget.org\/packages\/Azure.AI.OpenAI\/\">Azure OpenAI .NET SDK<\/a><\/li>\n<\/ul>\n<p><strong>NOTE: The Azure OpenAI .NET SDK is currently in preview.<\/strong><\/p>\n<p>We recommend using the Azure OpenAI .NET SDK which supports both OpenAI and Azure OpenAI Service.<\/p>\n<p>To get started using OpenAI models with the Azure OpenAI .NET SDK:<\/p>\n<ol>\n<li>Sign up or request access with <a href=\"https:\/\/platform.openai.com\/signup\/\">OpenAI<\/a> or <a href=\"https:\/\/learn.microsoft.com\/azure\/cognitive-services\/openai\/overview#how-do-i-get-access-to-azure-openai\">Azure OpenAI Service<\/a>.<\/li>\n<li>Use your credentials to start experimenting with the <a href=\"https:\/\/aka.ms\/openai-dotnet-samples\">OpenAI .NET samples<\/a>.<\/li>\n<\/ol>\n<h2>What&#8217;s next<\/h2>\n<p>In the next post, we&#8217;ll go into more detail on the topic of completions, which are the text and code generated by OpenAI models. Stay tuned!<\/p>\n<h2>We want to hear from you<\/h2>\n<p>Help us learn more about how you&#8217;re looking to use AI in your applications. Take a few minutes to complete this <a href=\"https:\/\/aka.ms\/dotnet-oai-survey-1\">survey<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to get started using OpenAI models like GPT with .NET and the Azure SDK<\/p>\n","protected":false},"author":26108,"featured_media":45247,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[685],"tags":[4,93],"class_list":["post-45246","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dotnet","tag-net","tag-machine-learning"],"acf":[],"blog_post_summary":"<p>Learn how to get started using OpenAI models like GPT with .NET and the Azure SDK<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/45246","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/users\/26108"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=45246"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/45246\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/45247"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=45246"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=45246"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=45246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}