Skip to content

Commit

Permalink
.Net: Updated notebooks (#6273)
Browse files Browse the repository at this point in the history
### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->

Resolves: #6247

Fixed path issues and updated `Microsoft.SemanticKernel` version to
`1.11.1`.

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄
  • Loading branch information
dmytrostruk committed May 15, 2024
1 parent b99b77f commit c22f42a
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions dotnet/notebooks/00-getting-started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"outputs": [],
"source": [
"// Import Semantic Kernel\n",
"#r \"nuget: Microsoft.SemanticKernel, 1.0.1\""
"#r \"nuget: Microsoft.SemanticKernel, 1.11.1\""
]
},
{
Expand Down Expand Up @@ -138,7 +138,7 @@
"outputs": [],
"source": [
"// FunPlugin directory path\n",
"var funPluginDirectoryPath = Path.Combine(System.IO.Directory.GetCurrentDirectory(), \"..\", \"..\", \"samples\", \"plugins\", \"FunPlugin\");\n",
"var funPluginDirectoryPath = Path.Combine(System.IO.Directory.GetCurrentDirectory(), \"..\", \"..\", \"prompt_template_samples\", \"FunPlugin\");\n",
"\n",
"// Load the FunPlugin from the Plugins Directory\n",
"var funPluginFunctions = kernel.ImportPluginFromPromptDirectory(funPluginDirectoryPath);\n",
Expand Down
2 changes: 1 addition & 1 deletion dotnet/notebooks/01-basic-loading-the-kernel.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
},
"outputs": [],
"source": [
"#r \"nuget: Microsoft.SemanticKernel, 1.0.1\""
"#r \"nuget: Microsoft.SemanticKernel, 1.11.1\""
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions dotnet/notebooks/02-running-prompts-from-file.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
},
"outputs": [],
"source": [
"#r \"nuget: Microsoft.SemanticKernel, 1.0.1\"\n",
"#r \"nuget: Microsoft.SemanticKernel, 1.11.1\"\n",
"\n",
"#!import config/Settings.cs\n",
"\n",
Expand Down Expand Up @@ -135,7 +135,7 @@
"outputs": [],
"source": [
"// FunPlugin directory path\n",
"var funPluginDirectoryPath = Path.Combine(System.IO.Directory.GetCurrentDirectory(), \"..\", \"..\", \"samples\", \"plugins\", \"FunPlugin\");\n",
"var funPluginDirectoryPath = Path.Combine(System.IO.Directory.GetCurrentDirectory(), \"..\", \"..\", \"prompt_template_samples\", \"FunPlugin\");\n",
"\n",
"// Load the FunPlugin from the Plugins Directory\n",
"var funPluginFunctions = kernel.ImportPluginFromPromptDirectory(funPluginDirectoryPath);"
Expand Down
2 changes: 1 addition & 1 deletion dotnet/notebooks/03-semantic-function-inline.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
},
"outputs": [],
"source": [
"#r \"nuget: Microsoft.SemanticKernel, 1.0.1\"\n",
"#r \"nuget: Microsoft.SemanticKernel, 1.11.1\"\n",
"\n",
"#!import config/Settings.cs\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion dotnet/notebooks/04-kernel-arguments-chat.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"outputs": [],
"source": [
"#r \"nuget: Microsoft.SemanticKernel, 1.0.1\"\n",
"#r \"nuget: Microsoft.SemanticKernel, 1.11.1\"\n",
"#!import config/Settings.cs\n",
"\n",
"using Microsoft.SemanticKernel;\n",
Expand Down
6 changes: 3 additions & 3 deletions dotnet/notebooks/05-using-the-planner.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
},
"outputs": [],
"source": [
"#r \"nuget: Microsoft.SemanticKernel, 1.0.1\"\n",
"#r \"nuget: Microsoft.SemanticKernel.Planners.Handlebars, 1.0.1-preview\"\n",
"#r \"nuget: Microsoft.SemanticKernel, 1.11.1\"\n",
"#r \"nuget: Microsoft.SemanticKernel.Planners.Handlebars, 1.11.1-preview\"\n",
"\n",
"#!import config/Settings.cs\n",
"#!import config/Utils.cs\n",
Expand Down Expand Up @@ -99,7 +99,7 @@
},
"outputs": [],
"source": [
"var pluginsDirectory = Path.Combine(System.IO.Directory.GetCurrentDirectory(), \"..\", \"..\", \"samples\", \"plugins\");\n",
"var pluginsDirectory = Path.Combine(System.IO.Directory.GetCurrentDirectory(), \"..\", \"..\", \"prompt_template_samples\");\n",
"\n",
"kernel.ImportPluginFromPromptDirectory(Path.Combine(pluginsDirectory, \"SummarizePlugin\"));\n",
"kernel.ImportPluginFromPromptDirectory(Path.Combine(pluginsDirectory, \"WriterPlugin\"));"
Expand Down
8 changes: 4 additions & 4 deletions dotnet/notebooks/06-memory-and-embeddings.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
},
"outputs": [],
"source": [
"#r \"nuget: Microsoft.SemanticKernel, 1.0.1\"\n",
"#r \"nuget: Microsoft.SemanticKernel.Plugins.Memory, 1.0.1-alpha\"\n",
"#r \"nuget: Microsoft.SemanticKernel, 1.11.1\"\n",
"#r \"nuget: Microsoft.SemanticKernel.Plugins.Memory, 1.11.1-alpha\"\n",
"#r \"nuget: System.Linq.Async, 6.0.1\"\n",
"\n",
"#!import config/Settings.cs\n",
Expand Down Expand Up @@ -234,7 +234,7 @@
"source": [
"using Microsoft.SemanticKernel.Plugins.Memory;\n",
"\n",
"#pragma warning disable SKEXP0050\n",
"#pragma warning disable SKEXP0001, SKEXP0050\n",
"\n",
"// TextMemoryPlugin provides the \"recall\" function\n",
"kernel.ImportPluginFromObject(new TextMemoryPlugin(memory));"
Expand Down Expand Up @@ -293,7 +293,7 @@
},
"outputs": [],
"source": [
"#pragma warning disable SKEXP0050\n",
"#pragma warning disable SKEXP0001, SKEXP0050\n",
"\n",
"var arguments = new KernelArguments();\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion dotnet/notebooks/07-DALL-E-3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"source": [
"// Usual setup: importing Semantic Kernel SDK and SkiaSharp, used to display images inline.\n",
"\n",
"#r \"nuget: Microsoft.SemanticKernel, 1.0.1\"\n",
"#r \"nuget: Microsoft.SemanticKernel, 1.11.1\"\n",
"#r \"nuget: System.Numerics.Tensors, 8.0.0\"\n",
"#r \"nuget: SkiaSharp, 2.88.3\"\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion dotnet/notebooks/08-chatGPT-with-DALL-E-3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"source": [
"// Usual setup: importing Semantic Kernel SDK and SkiaSharp, used to display images inline.\n",
"\n",
"#r \"nuget: Microsoft.SemanticKernel, 1.0.1\"\n",
"#r \"nuget: Microsoft.SemanticKernel, 1.11.1\"\n",
"#r \"nuget: SkiaSharp, 2.88.3\"\n",
"\n",
"#!import config/Settings.cs\n",
Expand Down
12 changes: 6 additions & 6 deletions dotnet/notebooks/09-memory-with-chroma.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
},
"outputs": [],
"source": [
"#r \"nuget: Microsoft.SemanticKernel, 1.0.1\"\n",
"#r \"nuget: Microsoft.SemanticKernel.Connectors.Chroma, 1.0.1-alpha\"\n",
"#r \"nuget: Microsoft.SemanticKernel.Plugins.Memory, 1.0.1-alpha\"\n",
"#r \"nuget: Microsoft.SemanticKernel, 1.11.1\"\n",
"#r \"nuget: Microsoft.SemanticKernel.Connectors.Chroma, 1.11.1-alpha\"\n",
"#r \"nuget: Microsoft.SemanticKernel.Plugins.Memory, 1.11.1-alpha\"\n",
"#r \"nuget: System.Linq.Async, 6.0.1\"\n",
"\n",
"#!import config/Settings.cs\n",
Expand Down Expand Up @@ -244,7 +244,7 @@
},
"outputs": [],
"source": [
"#pragma warning disable SKEXP0050\n",
"#pragma warning disable SKEXP0001, SKEXP0050\n",
"\n",
"// TextMemoryPlugin provides the \"recall\" function\n",
"kernel.ImportPluginFromObject(new TextMemoryPlugin(memory));"
Expand Down Expand Up @@ -303,7 +303,7 @@
},
"outputs": [],
"source": [
"#pragma warning disable SKEXP0050\n",
"#pragma warning disable SKEXP0001, SKEXP0050\n",
"\n",
"var arguments = new KernelArguments();\n",
"\n",
Expand Down Expand Up @@ -442,7 +442,7 @@
" = \"Jupyter notebook describing how to pass prompts from a file to a semantic plugin or function\",\n",
" [\"https://github.com/microsoft/semantic-kernel/blob/main/dotnet/notebooks/00-getting-started.ipynb\"]\n",
" = \"Jupyter notebook describing how to get started with the Semantic Kernel\",\n",
" [\"https://github.com/microsoft/semantic-kernel/tree/main/samples/plugins/ChatPlugin/ChatGPT\"]\n",
" [\"https://github.com/microsoft/semantic-kernel/tree/main/prompt_template_samples/ChatPlugin/ChatGPT\"]\n",
" = \"Sample demonstrating how to create a chat plugin interfacing with ChatGPT\",\n",
" [\"https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/Plugins/Plugins.Memory/VolatileMemoryStore.cs\"]\n",
" = \"C# class that defines a volatile embedding store\",\n",
Expand Down
6 changes: 3 additions & 3 deletions dotnet/notebooks/10-BingSearch-using-kernel.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
},
"outputs": [],
"source": [
"#r \"nuget: Microsoft.SemanticKernel, 1.0.1\"\n",
"#r \"nuget: Microsoft.SemanticKernel.Plugins.Web, 1.0.1-alpha\"\n",
"#r \"nuget: Microsoft.SemanticKernel.Plugins.Core, 1.0.1-alpha\"\n",
"#r \"nuget: Microsoft.SemanticKernel, 1.11.1\"\n",
"#r \"nuget: Microsoft.SemanticKernel.Plugins.Web, 1.11.1-alpha\"\n",
"#r \"nuget: Microsoft.SemanticKernel.Plugins.Core, 1.11.1-alpha\"\n",
"\n",
"#!import config/Settings.cs\n",
"#!import config/Utils.cs\n",
Expand Down

0 comments on commit c22f42a

Please sign in to comment.