File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
articles/ai-studio/how-to/develop Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,13 @@ dotnet add package Azure.AI.Projects
90
90
dotnet add package Azure.Identity
91
91
```
92
92
93
+ Add using statements:
94
+
95
+ ``` csharp
96
+ using Azure .Identity ;
97
+ using Azure .AI .Projects ;
98
+ ```
99
+
93
100
Create a project client in code:
94
101
95
102
# [ Sync] ( #tab/sync )
@@ -149,6 +156,17 @@ print(response.choices[0].message.content)
149
156
150
157
::: zone pivot="programming-language-csharp"
151
158
159
+ ``` dotnet
160
+ dotnet add package Azure.AI.OpenAI
161
+ ```
162
+
163
+ Add using statements:
164
+
165
+ ``` csharp
166
+ using OpenAI .Chat ;
167
+ using Azure .AI .OpenAI ;
168
+ ```
169
+
152
170
If you have existing code that uses the OpenAI SDK, you can use the project client to create an ` AzureOpenAI ` client that uses your project's Azure OpenAI connection:
153
171
154
172
:::code language="csharp" source="~ /azureai-samples-csharp/scenarios/projects/basic-csharp/Program.cs" id="azure_openai":::
@@ -196,6 +214,13 @@ print(response.choices[0].message.content)
196
214
``` dotnet
197
215
dotnet add package Azure.AI.Inference
198
216
```
217
+
218
+ Add using statements:
219
+
220
+ ``` csharp
221
+ using Azure .AI .Inference ;
222
+ ```
223
+
199
224
You can use the project client to get a configured and authenticated ` ChatCompletionsClient ` or ` EmbeddingsClient ` :
200
225
201
226
:::code language="csharp" source="~ /azureai-samples-csharp/scenarios/projects/basic-csharp/Program.cs" id="snippet_inference":::
@@ -314,6 +339,13 @@ search_client = SearchClient(
314
339
dotnet add package Azure.Search.Documents
315
340
```
316
341
342
+ Add using statements:
343
+
344
+ ``` csharp
345
+ using Azure .Search .Documents ;
346
+ using Azure .Search .Documents .Models ;
347
+ ```
348
+
317
349
Instantiate the search and/or search index client as desired:
318
350
319
351
:::code language="csharp" source="~ /azureai-samples-csharp/scenarios/projects/basic-csharp/Program.cs" id="azure_aisearch":::
You can’t perform that action at this time.
0 commit comments