@@ -112,29 +112,20 @@ using Azure;
112
112
using Azure .AI .OpenAI ;
113
113
using static System .Environment ;
114
114
115
- namespace azure_openai_quickstart
116
- {
117
- internal class Program
118
- {
119
- static void Main (string [] args )
120
- {
121
- string endpoint = GetEnvironmentVariable (" OPENAI_API_BASE" );
122
- string key = GetEnvironmentVariable (" OPENAI_API_KEY" );
123
- string engine = " text-davinci-003" ; // Enter the deployment name you chose when you deployed the model.
115
+ string endpoint = GetEnvironmentVariable (" OPENAI_API_BASE" );
116
+ string key = GetEnvironmentVariable (" OPENAI_API_KEY" );
124
117
125
- OpenAIClient client = new OpenAIClient (new Uri (endpoint ), new AzureKeyCredential (key ));
118
+ // Enter the deployment name you chose when you deployed the model.
119
+ string engine = " text-davinci-003" ;
126
120
127
- string prompt = " When was Microsoft founded?" ;
128
- Console .Write ($" Input: {prompt }\n " );
121
+ OpenAIClient client = new (new Uri (endpoint ), new AzureKeyCredential (key ));
129
122
130
- Response < Completions > completionsResponse = client .GetCompletions (engine , prompt );
131
- string completion = completionsResponse .Value .Choices [0 ].Text ;
132
- Console .WriteLine ($" Chatbot: {completion }" );
133
-
134
- }
135
- }
136
- }
123
+ string prompt = " When was Microsoft founded?" ;
124
+ Console .Write ($" Input: {prompt }\n " );
137
125
126
+ Response < Completions > completionsResponse = client .GetCompletions (engine , prompt );
127
+ string completion = completionsResponse .Value .Choices [0 ].Text ;
128
+ Console .WriteLine ($" Chatbot: {completion }" );
138
129
```
139
130
140
131
> [ !IMPORTANT]
0 commit comments