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
@@ -23,7 +23,7 @@ In this quickstart, we'll demonstrate how to integrate DALL-E's image generation
23
23
<!-- Use this exact H2 -->
24
24
## What problem will we solve?
25
25
26
-
TODO: Write a brief description of the problem and how the product or service solves that problem. Include one or more diagrams when appropriate to show the solution architecture and/or the dataflow.
26
+
You want to add DALL-E's image generation capabilities to your .NET MAUI Windows desktop app to provide users with a rich, interactive experience. They can already use the app to generate text-based recommendations, and you want to add the ability to generate images that visualize an activity in the location they have entered.
27
27
28
28
<!--
29
29
@@ -42,73 +42,128 @@ Each H2 should describe either what they'll do in the step or which part of the
42
42
* An image, code block, or other graphical element comes after numbered step it illustrates.
43
43
44
44
-->
45
-
## "\<verb\> * \<noun\>"
46
-
TODO: Add introduction sentence(s)
47
-
[Include a sentence or two to explain only what is needed to complete the procedure.]
48
-
TODO: Add ordered list of procedure steps
49
-
1. Step 1
50
-
1. Step 2
51
-
1. Step 3
52
-
53
-
## Task 2
54
-
TODO: Add introduction sentence(s)
55
-
[Include a sentence or two to explain only what is needed to complete the procedure.]
56
-
TODO: Add ordered list of procedure steps
57
-
1. Step 1
58
-
1. Step 2
59
-
1. Step 3
60
-
61
-
## Task 3
62
-
TODO: Add introduction sentence(s)
63
-
[Include a sentence or two to explain only what is needed to complete the procedure.]
64
-
TODO: Add ordered list of procedure steps
65
-
1. Step 1
66
-
1. Step 2
67
-
1. Step 3
45
+
## Install and initialize the Azure OpenAI SDK
46
+
47
+
In this section, we'll install the SDK into the .NET MAUI project and initialize it with your OpenAI API key.
48
+
49
+
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.
50
+
51
+
1. Once installed, you can initialize the `OpenAIClient` instance from the SDK with your OpenAI API key as follows:
Inthissection, we'll modify the user interface to include an `Image` control that displays a generated image below the recommendation text.
81
+
82
+
1. Ifyouarearestartingwithanewproject, copytheXAMLfor `MainPage.xaml` from the [Create a recommendation app with .NET MAUI and ChatGPT](tutorial-maui-ai.md) tutorial.
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:
TODO: End the demonstration with a few paragraphs of analysis to make it clear that the product or service was a good choice to solve the customer problem.
72
-
73
-
<!-- 8. Clean up resources ------------------------------------------------------------------------
74
-
75
-
Required: To avoid any costs associated with following the Quickstart procedure, a Clean up resources (H2) should come just before Next step or Related content (H2)
76
157
77
-
If there is a follow-on Quickstart that uses the same resources, make that option clear so that a reader doesn't need to recreate those resources.
78
-
79
-
-->
158
+
WeaddedDALL-E's image generation capabilities to our .NET MAUI Windows desktop app. Users can now generate images based on the location they enter and the type of recommendation they select. This provides a rich, interactive experience for users and enhances the app'sfunctionality.
80
159
81
-
<!-- Use this exact H2 -->
82
160
## Clean up resources
83
161
84
-
If you're not going to continue to use this application, delete <resources> with the following steps:
85
-
86
-
1. From the left-hand menu...
87
-
2. ...click Delete, type...and then click Delete
88
-
89
-
<!-- 9. Next step/Related content ------------------------------------------------------------------------
90
-
91
-
Optional: You have two options for manually curated links in this pattern: Next step and Related content. You don't have to use either, but don't use both.
92
-
- For Next step, provide one link to the next step in a sequence. Use the blue box format
93
-
- For Related content provide 1-3 links. Include some context so the customer can determine why they would click the link. Add a context sentence for the following links.
94
-
95
-
-->
96
-
97
-
## Next step
98
-
99
-
TODO: Add your next step link(s)
100
-
101
-
> [!div class="nextstepaction"]
102
-
> [Write concepts](article-concept.md)
103
-
104
-
<!-- OR -->
162
+
It's important to make sure your OpenAI account is secure. If you'renotplanningtousethe [OpenAIAPI](https://platform.openai.com/api-keys) key for any other projects, you should delete it from your OpenAI developer dashboard. You should also set a reasonable spending limit on your OpenAI account to avoid any unexpected charges. You can check your current usage and spending in the OpenAI dashboard on the [Usage](https://platform.openai.com/usage) page.
105
163
106
164
## Related content
107
165
108
-
TODO: Add your next step link(s)
109
-
110
-
-[Write concepts](article-concept.md)
111
-
112
-
<!--
113
-
Remove all the comments in this template before you sign-off or merge to the main branch.
0 commit comments