Skip to content

Commit 4325b09

Browse files
committed
update notebooks to use latest sdks for Azure open Ai
use dall-e-3 clear outputs clear clean
1 parent 099224d commit 4325b09

20 files changed

+254
-433
lines changed

Basic_Samples/Chat/dotnet/csharp/Chat_with_your_own_data.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@
6060
},
6161
"outputs": [],
6262
"source": [
63-
"#r \"nuget: Azure.AI.OpenAI, 1.0.0-beta.9\"\n",
64-
"#r \"nuget:Microsoft.DotNet.Interactive.AIUtilities, 1.0.0-beta.23606.2\""
63+
"#r \"nuget: Azure.AI.OpenAI, 1.0.0-beta.11\"\n",
64+
"#r \"nuget:Microsoft.DotNet.Interactive.AIUtilities, 1.0.0-beta.23611.1\""
6565
]
6666
},
6767
{

Basic_Samples/Chat/dotnet/csharp/Entity_extraction_for_long_documents.ipynb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@
3939
{
4040
"data": {
4141
"text/html": [
42-
"<div><div></div><div></div><div><strong>Installed Packages</strong><ul><li><span>Azure.AI.OpenAI, 1.0.0-beta.9</span></li></ul></div></div>"
42+
"<div><div></div><div></div><div><strong>Installed Packages</strong><ul><li><span>Azure.AI.OpenAI, 1.0.0-beta.11</span></li></ul></div></div>"
4343
]
4444
},
4545
"metadata": {},
4646
"output_type": "display_data"
4747
}
4848
],
4949
"source": [
50-
"#r \"nuget: Azure.AI.OpenAI, 1.0.0-beta.9\""
50+
"#r \"nuget: Azure.AI.OpenAI, 1.0.0-beta.11\""
5151
]
5252
},
5353
{
@@ -66,7 +66,7 @@
6666
},
6767
"outputs": [],
6868
"source": [
69-
"#r \"nuget:Microsoft.DotNet.Interactive.AIUtilities, 1.0.0-beta.23606.2\""
69+
"#r \"nuget:Microsoft.DotNet.Interactive.AIUtilities, 1.0.0-beta.23611.1\""
7070
]
7171
},
7272
{
@@ -100,7 +100,7 @@
100100
},
101101
{
102102
"cell_type": "code",
103-
"execution_count": 5,
103+
"execution_count": 4,
104104
"metadata": {
105105
"dotnet_interactive": {
106106
"language": "csharp"
@@ -125,7 +125,7 @@
125125
},
126126
{
127127
"cell_type": "code",
128-
"execution_count": 6,
128+
"execution_count": 5,
129129
"metadata": {
130130
"dotnet_interactive": {
131131
"language": "csharp"
@@ -152,7 +152,7 @@
152152
},
153153
{
154154
"cell_type": "code",
155-
"execution_count": 7,
155+
"execution_count": 6,
156156
"metadata": {
157157
"dotnet_interactive": {
158158
"language": "csharp"
@@ -181,7 +181,7 @@
181181
},
182182
{
183183
"cell_type": "code",
184-
"execution_count": 8,
184+
"execution_count": 7,
185185
"metadata": {
186186
"dotnet_interactive": {
187187
"language": "csharp"
@@ -219,7 +219,7 @@
219219
},
220220
{
221221
"cell_type": "code",
222-
"execution_count": 9,
222+
"execution_count": 8,
223223
"metadata": {
224224
"dotnet_interactive": {
225225
"language": "csharp"
@@ -238,7 +238,7 @@
238238
},
239239
{
240240
"cell_type": "code",
241-
"execution_count": 10,
241+
"execution_count": 9,
242242
"metadata": {
243243
"dotnet_interactive": {
244244
"language": "csharp"
@@ -264,7 +264,7 @@
264264
},
265265
{
266266
"cell_type": "code",
267-
"execution_count": 11,
267+
"execution_count": 10,
268268
"metadata": {
269269
"dotnet_interactive": {
270270
"language": "csharp"
@@ -319,7 +319,7 @@
319319
"1.\n",
320320
"\"\"\";\n",
321321
" var options= new ChatCompletionsOptions{\n",
322-
" Messages ={ new ChatMessage(ChatRole.User, prompt)},\n",
322+
" Messages ={ new ChatRequestUserMessage(prompt)},\n",
323323
" Temperature = 0f,\n",
324324
" DeploymentName = chatDeployment,\n",
325325
" };\n",
@@ -455,7 +455,7 @@
455455
"1.\n",
456456
"\"\"\";\n",
457457
" var options= new ChatCompletionsOptions{\n",
458-
" Messages ={ new ChatMessage(ChatRole.User, prompt)},\n",
458+
" Messages ={ new ChatRequestUserMessage(prompt)},\n",
459459
" Temperature = 0f,\n",
460460
" DeploymentName = chatDeployment\n",
461461
" };\n",

Basic_Samples/Chat/dotnet/csharp/chat.ipynb

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@
2727
{
2828
"data": {
2929
"text/html": [
30-
"<div><div></div><div></div><div><strong>Installed Packages</strong><ul><li><span>Azure.AI.OpenAI, 1.0.0-beta.9</span></li></ul></div></div>"
30+
"<div><div></div><div></div><div><strong>Installed Packages</strong><ul><li><span>Azure.AI.OpenAI, 1.0.0-beta.11</span></li></ul></div></div>"
3131
]
3232
},
3333
"metadata": {},
3434
"output_type": "display_data"
3535
}
3636
],
3737
"source": [
38-
"#r \"nuget: Azure.AI.OpenAI, 1.0.0-beta.9\""
38+
"#r \"nuget: Azure.AI.OpenAI, 1.0.0-beta.11\""
3939
]
4040
},
4141
{
@@ -54,7 +54,7 @@
5454
},
5555
"outputs": [],
5656
"source": [
57-
"#r \"nuget:Microsoft.DotNet.Interactive.AIUtilities, 1.0.0-beta.23606.2\""
57+
"#r \"nuget:Microsoft.DotNet.Interactive.AIUtilities, 1.0.0-beta.23611.1\""
5858
]
5959
},
6060
{
@@ -140,7 +140,7 @@
140140
},
141141
{
142142
"cell_type": "code",
143-
"execution_count": 11,
143+
"execution_count": 7,
144144
"metadata": {
145145
"dotnet_interactive": {
146146
"language": "csharp"
@@ -166,10 +166,10 @@
166166
"source": [
167167
" var options= new ChatCompletionsOptions{\n",
168168
" Messages ={ \n",
169-
" new ChatMessage(ChatRole.System, \"You are a helpful assistant.\"),\n",
170-
" new ChatMessage(ChatRole.User, \"Knock knock.\"),\n",
171-
" new ChatMessage(ChatRole.Assistant, \"Who's there?\"),\n",
172-
" new ChatMessage(ChatRole.User, \"Orange.\")\n",
169+
" new ChatRequestSystemMessage(\"You are a helpful assistant.\"),\n",
170+
" new ChatRequestUserMessage( \"Knock knock.\"),\n",
171+
" new ChatRequestAssistantMessage(\"Who's there?\"),\n",
172+
" new ChatRequestUserMessage( \"Orange.\")\n",
173173
" },\n",
174174
" Temperature = 0f,\n",
175175
" DeploymentName = chatDeployment,\n",
@@ -189,7 +189,7 @@
189189
},
190190
{
191191
"cell_type": "code",
192-
"execution_count": 15,
192+
"execution_count": 8,
193193
"metadata": {
194194
"dotnet_interactive": {
195195
"language": "csharp"
@@ -233,10 +233,10 @@
233233
"source": [
234234
" var options= new ChatCompletionsOptions{\n",
235235
" Messages ={ \n",
236-
" new ChatMessage(ChatRole.System, \"You are a helpful assistant.\"),\n",
237-
" new ChatMessage(ChatRole.User, \"Knock knock.\"),\n",
238-
" new ChatMessage(ChatRole.Assistant, \"Who's there?\"),\n",
239-
" new ChatMessage(ChatRole.User, \"Orange.\")\n",
236+
" new ChatRequestSystemMessage(\"You are a helpful assistant.\"),\n",
237+
" new ChatRequestUserMessage(\"Knock knock.\"),\n",
238+
" new ChatRequestAssistantMessage(\"Who's there?\"),\n",
239+
" new ChatRequestUserMessage(\"Orange.\")\n",
240240
" },\n",
241241
" Temperature = 0f,\n",
242242
" DeploymentName = chatDeployment,\n",

Basic_Samples/DALL-E/dotnet/csharp/DALL-E.ipynb

Lines changed: 20 additions & 45 deletions
Large diffs are not rendered by default.

Basic_Samples/Datastores/dotnet/csharp/Ingest_Github_Issues_Qdrant.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@
3434
{
3535
"data": {
3636
"text/html": [
37-
"<div><div></div><div></div><div><strong>Installed Packages</strong><ul><li><span>Azure.AI.OpenAI, 1.0.0-beta.9</span></li><li><span>Qdrant.Client, 1.6.0-alpha.1</span></li></ul></div></div>"
37+
"<div><div></div><div></div><div><strong>Installed Packages</strong><ul><li><span>Azure.AI.OpenAI, 1.0.0-beta.11</span></li><li><span>Qdrant.Client, 1.6.0-alpha.1</span></li></ul></div></div>"
3838
]
3939
},
4040
"metadata": {},
4141
"output_type": "display_data"
4242
}
4343
],
4444
"source": [
45-
"#r \"nuget: Azure.AI.OpenAI, 1.0.0-beta.9\"\n",
45+
"#r \"nuget: Azure.AI.OpenAI, 1.0.0-beta.11\"\n",
4646
"#r \"nuget: Qdrant.Client, 1.6.0-alpha.1\""
4747
]
4848
},
@@ -94,7 +94,7 @@
9494
{
9595
"data": {
9696
"text/html": [
97-
"<div><div></div><div></div><div><strong>Installed Packages</strong><ul><li><span>Microsoft.DotNet.Interactive.AIUtilities, 1.0.0-beta.23606.2</span></li></ul></div></div>"
97+
"<div><div></div><div></div><div><strong>Installed Packages</strong><ul><li><span>Microsoft.DotNet.Interactive.AIUtilities, 1.0.0-beta.23611.1</span></li></ul></div></div>"
9898
]
9999
},
100100
"metadata": {},
@@ -103,15 +103,15 @@
103103
{
104104
"data": {
105105
"text/plain": [
106-
"Loading extension script from `C:\\Users\\dicolomb\\.nuget\\packages\\microsoft.dotnet.interactive.aiutilities\\1.0.0-beta.23606.2\\interactive-extensions\\dotnet\\extension.dib`"
106+
"Loading extension script from `C:\\Users\\dicolomb\\.nuget\\packages\\microsoft.dotnet.interactive.aiutilities\\1.0.0-beta.23611.1\\interactive-extensions\\dotnet\\extension.dib`"
107107
]
108108
},
109109
"metadata": {},
110110
"output_type": "display_data"
111111
}
112112
],
113113
"source": [
114-
"#r \"nuget:Microsoft.DotNet.Interactive.AIUtilities, 1.0.0-beta.23606.2\""
114+
"#r \"nuget:Microsoft.DotNet.Interactive.AIUtilities, 1.0.0-beta.23611.1\""
115115
]
116116
},
117117
{

Basic_Samples/Datastores/dotnet/csharp/Question_answering_using_vector_store_search_milvus.ipynb

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -108,20 +108,20 @@
108108
{
109109
"data": {
110110
"text/html": [
111-
"<div><div></div><div></div><div><strong>Installed Packages</strong><ul><li><span>Azure.AI.OpenAI, 1.0.0-beta.9</span></li></ul></div></div>"
111+
"<div><div></div><div></div><div><strong>Installed Packages</strong><ul><li><span>Azure.AI.OpenAI, 1.0.0-beta.11</span></li></ul></div></div>"
112112
]
113113
},
114114
"metadata": {},
115115
"output_type": "display_data"
116116
}
117117
],
118118
"source": [
119-
"#r \"nuget: Azure.AI.OpenAI, 1.0.0-beta.9\""
119+
"#r \"nuget: Azure.AI.OpenAI, 1.0.0-beta.11\""
120120
]
121121
},
122122
{
123123
"cell_type": "code",
124-
"execution_count": 2,
124+
"execution_count": null,
125125
"metadata": {
126126
"dotnet_interactive": {
127127
"language": "csharp"
@@ -133,28 +133,9 @@
133133
"languageId": "polyglot-notebook"
134134
}
135135
},
136-
"outputs": [
137-
{
138-
"data": {
139-
"text/html": [
140-
"<div><div></div><div></div><div><strong>Installed Packages</strong><ul><li><span>Microsoft.DotNet.Interactive.AIUtilities, 1.0.0-beta.23606.2</span></li></ul></div></div>"
141-
]
142-
},
143-
"metadata": {},
144-
"output_type": "display_data"
145-
},
146-
{
147-
"data": {
148-
"text/plain": [
149-
"Loading extension script from `C:\\Users\\dicolomb\\.nuget\\packages\\microsoft.dotnet.interactive.aiutilities\\1.0.0-beta.23606.2\\interactive-extensions\\dotnet\\extension.dib`"
150-
]
151-
},
152-
"metadata": {},
153-
"output_type": "display_data"
154-
}
155-
],
136+
"outputs": [],
156137
"source": [
157-
"#r \"nuget:Microsoft.DotNet.Interactive.AIUtilities, 1.0.0-beta.23606.2\"\n",
138+
"#r \"nuget:Microsoft.DotNet.Interactive.AIUtilities, 1.0.0-beta.23611.1\"\n",
158139
"\n",
159140
"using Microsoft.DotNet.Interactive;\n",
160141
"using Microsoft.DotNet.Interactive.AIUtilities;"
@@ -757,7 +738,7 @@
757738
},
758739
{
759740
"cell_type": "code",
760-
"execution_count": 90,
741+
"execution_count": null,
761742
"metadata": {
762743
"dotnet_interactive": {
763744
"language": "csharp"
@@ -898,7 +879,7 @@
898879
},
899880
{
900881
"cell_type": "code",
901-
"execution_count": 99,
882+
"execution_count": null,
902883
"metadata": {
903884
"dotnet_interactive": {
904885
"language": "csharp"
@@ -935,8 +916,8 @@
935916
" var options= new ChatCompletionsOptions{\n",
936917
" Messages =\n",
937918
" {\n",
938-
" new ChatMessage(ChatRole.System, @\"You answer questions about the 2022 Winter Olympics.\"),\n",
939-
" new ChatMessage(ChatRole.User, userQuestion)\n",
919+
" new ChatRequestSystemMessage(@\"You answer questions about the 2022 Winter Olympics.\"),\n",
920+
" new ChatRequestUserMessage(userQuestion)\n",
940921
" },\n",
941922
" Temperature = 0f,\n",
942923
" MaxTokens = 3500,\n",

0 commit comments

Comments
 (0)