You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this quickstart, learn how to create a .NET console chat app to connect to and prompt an OpenAI or Azure OpenAI model. The app uses the [`Microsoft.Extensions.AI`](https://www.nuget.org/packages/Microsoft.Extensions.AI) library so you can write code using AI abstractions rather than a specific SDK. AI abstractions enable you to change the underlying AI model with minimal code changes.
In this quickstart, learn how to create a .NET console chat app to connect to and prompt an OpenAI or Azure OpenAI model using [`Semantic Kernel`](/semantic-kernel/overview). Semantic Kernel is a lightweight, open-source development kit that lets you easily build AI agents and integrate the latest AI models into your C#, Python, or Java codebase. It serves as an efficient middleware that enables rapid delivery of enterprise-grade solutions.
The app uses the [`Microsoft.SemanticKernel`](https://www.nuget.org/packages/Microsoft.SemanticKernel) package to send and receive requests to the OpenAI service.
69
+
70
+
1. In the **Program.cs** file, add the following code to connect and authenticate to the AI model.
> `DefaultAzureCredential` searches for credentials from your local tooling. If you are not using the `azd` template to provision the Azure OpenAI resource, you'll need to assign the `Azure AI Developer` role to the account you used to sign-in to Visual Studio or the Azure CLI.
Copy file name to clipboardExpand all lines: docs/ai/quickstarts/snippets/prompt-completion/semantic-kernel/azure-openai/SemanticKernelAzureOpenAI.csproj
0 commit comments