File tree Expand file tree Collapse file tree 1 file changed +1
-7
lines changed
learn-pr/wwl-data-ai/ai-foundry-sdk/includes Expand file tree Collapse file tree 1 file changed +1
-7
lines changed Original file line number Diff line number Diff line change @@ -195,13 +195,7 @@ namespace my_foundry_client
195
195
var projectClient = new AIProjectClient (connectionString , new DefaultAzureCredential ());
196
196
197
197
// Get an Azure OpenAI chat client
198
- ConnectionResponse connection = projectClient .GetConnectionsClient ().GetDefaultConnection (ConnectionType .AzureOpenAI , withCredential : true );
199
- var connectionProperties = connection .Properties as ConnectionPropertiesApiKeyAuth ;
200
- AzureOpenAIClient azureOpenAIClient = new (
201
- new Uri (connectionProperties .Target ),
202
- new AzureKeyCredential (connectionProperties .Credentials .Key ));
203
-
204
- ChatClient chatClient = azureOpenAIClient .GetChatClient (" gpt-4-model" );
198
+ ChatClient chatClient = projectClient .GetAzureOpenAIChatClient (" gpt-4-model" );
205
199
206
200
// Get a chat completion based on a user-provided prompt
207
201
Console .WriteLine (" Enter a question:" );
You can’t perform that action at this time.
0 commit comments