This project is a port of the ChatGPT Prompt Engineering for Developers samples from OpenAI / Python to C# / Azure-OpenAI. It uses Interactive Notebooks for C#, Azure OpenAI service, and the Azure OpenAI client library for .NET.
-
Clone this repo locally
-
In Azure, create Azure OpenAI Service resource. After deploying the model, note the model name, you'll need it for the AOAI_DEPLOYMENTID environment variable below.
-
Install the Polyglot Notebooks extension in Visual Studio Code.
-
Configure environment variables
For more details on how to get the values for the variables, see the Azure OpenAI documentation.
Set the following environment variables with the required values. (Tip: Create an .env file):
AOAI_ENDPOINT - The endpoint for your Azure OpenAI Service resource.
AOAI_KEY - The access key for your Azure OpenAI Service resource.
AOAI_DEPLOYMENTID - The name of your model deployment (e.g. my-davinci-003-deployment)
Open a Jupyter Notebook file (links below) in VS Code. You can run and change the code.
Iterative: Modifying the prompt until it gives you the correct output
Summarizing: Providing summarized output
Inferring: Sentiment Analysis, Emotion detection, Entity Extraction
Transforming: Language translation and detecting
Expanding: Generate text based on tone and sentiment of input
Chatbot: Chat using system, user, and assistant message roles.
Orderbot: Interactive chat using turn-based input to add to context
https://learn.deeplearning.ai/chatgpt-prompt-eng
https://github.com/Azure-Samples/openai-dotnet-samples
https://learn.microsoft.com/en-us/dotnet/api/azure.ai.openai?view=azure-dotnet-preview
https://www.nuget.org/packages/Azure.AI.OpenAI