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
Copy file name to clipboardExpand all lines: hub/apps/windows-dotnet-maui/dall-e-maui-windows.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,9 +30,9 @@ In this section, we'll install the SDK into the .NET MAUI project and initialize
30
30
31
31
1. If you haven't already installed the `Azure.AI.OpenAI` NuGet package, you can do so by running `dotnet add package Azure.AI.OpenAI -IncludePrerelease` from Visual Studio's terminal window.
32
32
33
-
1. Once installed, you can initialize the `OpenAIClient` instance from the SDK with your OpenAI API key as follows:
33
+
1. Once installed, you can initialize the `OpenAIClient` instance from the SDK with your OpenAI API key in `MainPage.xaml.cs`as follows:
34
34
35
-
```csharp MainPage.xaml.cs
35
+
```csharp
36
36
privateOpenAIClient_chatGptClient;
37
37
privateGuid_sessionGuid=Guid.Empty;
38
38
privatestringopenAIKey="MY_OPEN_AI_API_KEY";
@@ -65,7 +65,7 @@ Next, we'll modify the user interface to include an `Image` control that display
@@ -101,7 +101,7 @@ In this section, we'll add a method to handle image generation and call it from
101
101
102
102
1. Addamethodnamed `GetImageAsync` tohandleimagegeneration. ThenewmethodwillcalltheOpenAIAPItogenerateanimagebasedonthepromptwe'll build in the next step. It returns an `ImageSource` object that is used to display the image in the UI:
0 commit comments