From 0cae74b3021135e1aec9e225b5b9baa2b0f64e62 Mon Sep 17 00:00:00 2001 From: Angelos Petropoulos Date: Wed, 7 Aug 2024 12:46:00 -0500 Subject: [PATCH 1/3] Updated the 'How to work with Azure OpenAI' section with instructions to use Azure OpenAI client library for .NET and where to find it + some sample code. --- README.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4261ee73c..6a3dce860 100644 --- a/README.md +++ b/README.md @@ -678,7 +678,29 @@ The first image shows a red apple with a smooth skin and a single leaf, while th ## How to work with Azure OpenAI -Details for using the OpenAI .NET library with [Azure OpenAI](https://learn.microsoft.com/azure/ai-services/openai/overview) are coming soon. Please watch here and the [Azure.AI.OpenAI project](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/openai/Azure.AI.OpenAI) for updates. +For Azure OpenAI scenarios we recommend using the [Azure SDK](https://github.com/Azure/azure-sdk-for-net) and more specifically the [Azure OpenAI client library for .NET](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/openai/Azure.AI.OpenAI/README.md). + +The Azure OpenAI client library for .NET is a companion to this library and all common capabilities between OpenAI and Azure OpenAI share the same scenario clients, methods, and request/response types. It is designed to make Azure specific scenarios straightforward, with extensions for Azure-specific concepts like Responsible AI content filter results and On Your Data integration. + +```c# +AzureOpenAIClient azureClient = new( + new Uri("https://your-azure-openai-resource.com"), + new DefaultAzureCredential()); +ChatClient chatClient = azureClient.GetChatClient("my-gpt-35-turbo-deployment"); + +ChatCompletion completion = chatClient.CompleteChat( + [ + // System messages represent instructions or other guidance about how the assistant should behave + new SystemChatMessage("You are a helpful assistant that talks like a pirate."), + // User messages represent user input, whether historical or the most recen tinput + new UserChatMessage("Hi, can you help me?"), + // Assistant messages in a request represent conversation history for responses + new AssistantChatMessage("Arrr! Of course, me hearty! What can I do for ye?"), + new UserChatMessage("What's the best way to train a parrot?"), + ]); + +Console.WriteLine($"{completion.Role}: {completion.Content[0].Text}"); +``` ## Advanced scenarios From f108dd5001af0606bf697bad9fc218109cfabade Mon Sep 17 00:00:00 2001 From: Angelos Petropoulos Date: Wed, 7 Aug 2024 12:55:56 -0500 Subject: [PATCH 2/3] Changed the wording to make it sound less like an optional recommendation and more like an instruction. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6a3dce860..b0333937c 100644 --- a/README.md +++ b/README.md @@ -678,7 +678,7 @@ The first image shows a red apple with a smooth skin and a single leaf, while th ## How to work with Azure OpenAI -For Azure OpenAI scenarios we recommend using the [Azure SDK](https://github.com/Azure/azure-sdk-for-net) and more specifically the [Azure OpenAI client library for .NET](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/openai/Azure.AI.OpenAI/README.md). +For Azure OpenAI scenarios use the [Azure SDK](https://github.com/Azure/azure-sdk-for-net) and more specifically the [Azure OpenAI client library for .NET](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/openai/Azure.AI.OpenAI/README.md). The Azure OpenAI client library for .NET is a companion to this library and all common capabilities between OpenAI and Azure OpenAI share the same scenario clients, methods, and request/response types. It is designed to make Azure specific scenarios straightforward, with extensions for Azure-specific concepts like Responsible AI content filter results and On Your Data integration. From 19f954f5294762e8bd9ae7734ff2996b98574560 Mon Sep 17 00:00:00 2001 From: Angelos Petropoulos Date: Thu, 15 Aug 2024 13:20:40 -0500 Subject: [PATCH 3/3] Added the NuGet tags openai-dotnet, ChatGPT, and Dall-E to the .csproj file. --- src/OpenAI.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenAI.csproj b/src/OpenAI.csproj index 7d19ce117..d61dc0045 100644 --- a/src/OpenAI.csproj +++ b/src/OpenAI.csproj @@ -2,7 +2,7 @@ This is the OpenAI client library for developing .NET applications with rich experience. SDK Code Generation OpenAI - OpenAI + OpenAI;openai-dotnet;ChatGPT;Dall-E 2.0.0 beta.8