From eb06560076f52e6518f02ec29a96d04f50b66ebb Mon Sep 17 00:00:00 2001 From: Alex Chao Date: Wed, 29 Mar 2023 16:51:52 -0700 Subject: [PATCH 1/2] update API for getting started notebook --- .../dotnet/Getting-Started-Notebook.ipynb | 71 ++++--------------- 1 file changed, 12 insertions(+), 59 deletions(-) diff --git a/samples/notebooks/dotnet/Getting-Started-Notebook.ipynb b/samples/notebooks/dotnet/Getting-Started-Notebook.ipynb index 6707f9842d07..c54be21072b2 100644 --- a/samples/notebooks/dotnet/Getting-Started-Notebook.ipynb +++ b/samples/notebooks/dotnet/Getting-Started-Notebook.ipynb @@ -3,14 +3,7 @@ { "attachments": {}, "cell_type": "markdown", - "metadata": { - "dotnet_interactive": { - "language": "csharp" - }, - "polyglot_notebook": { - "kernelName": "csharp" - } - }, + "metadata": {}, "source": [ "#### Watch the Getting Started Quick Start [Video](https://aka.ms/SK-Getting-Started-Notebook)\n", "\n", @@ -29,28 +22,18 @@ }, "polyglot_notebook": { "kernelName": "csharp" - }, - "vscode": { - "languageId": "polyglot-notebook" } }, "outputs": [], "source": [ "// Import Semantic Kernel\n", - "#r \"nuget: Microsoft.SemanticKernel, *-*\"" + "#r \"nuget: Microsoft.SemanticKernel, 0.9.61.1-preview\"" ] }, { "attachments": {}, "cell_type": "markdown", - "metadata": { - "dotnet_interactive": { - "language": "csharp" - }, - "polyglot_notebook": { - "kernelName": "csharp" - } - }, + "metadata": {}, "source": [ "**Step 2**: Add your [Open AI Key](https://openai.com/api/) or [Azure Open AI Service key](https://learn.microsoft.com/azure/cognitive-services/openai/quickstart?pivots=programming-language-studio) key to run a function below and save your key in the configuration files for later use." ] @@ -64,9 +47,6 @@ }, "polyglot_notebook": { "kernelName": "csharp" - }, - "vscode": { - "languageId": "polyglot-notebook" } }, "outputs": [], @@ -88,14 +68,7 @@ { "attachments": {}, "cell_type": "markdown", - "metadata": { - "dotnet_interactive": { - "language": "csharp" - }, - "polyglot_notebook": { - "kernelName": "csharp" - } - }, + "metadata": {}, "source": [ "**Step 3**: Instantiate the Kernel" ] @@ -109,9 +82,6 @@ }, "polyglot_notebook": { "kernelName": "csharp" - }, - "vscode": { - "languageId": "polyglot-notebook" } }, "outputs": [], @@ -135,32 +105,22 @@ }, "polyglot_notebook": { "kernelName": "csharp" - }, - "vscode": { - "languageId": "polyglot-notebook" } }, "outputs": [], "source": [ "// Configure AI backend used by the kernel\n", - "var (useAzureOpenAI,model, azureEndpoint, apiKey, orgId) = Settings.LoadFromFile();\n", + "var (useAzureOpenAI, model, azureEndpoint, apiKey, orgId) = Settings.LoadFromFile();\n", "if (useAzureOpenAI)\n", - " kernel.Config.AddAzureOpenAICompletionBackend(\"davinci\", model, azureEndpoint, apiKey);\n", + " kernel.Config.AddAzureOpenAITextCompletion(\"davinci\", model, azureEndpoint, apiKey);\n", "else\n", - " kernel.Config.AddOpenAICompletionBackend(\"davinci\", model, apiKey, orgId);" + " kernel.Config.AddOpenAITextCompletion(\"davinci\", model, apiKey, orgId);" ] }, { "attachments": {}, "cell_type": "markdown", - "metadata": { - "dotnet_interactive": { - "language": "csharp" - }, - "polyglot_notebook": { - "kernelName": "csharp" - } - }, + "metadata": {}, "source": [ "**Step 4**: Load and Run a Skill" ] @@ -174,9 +134,6 @@ }, "polyglot_notebook": { "kernelName": "csharp" - }, - "vscode": { - "languageId": "polyglot-notebook" } }, "outputs": [], @@ -197,14 +154,7 @@ { "attachments": {}, "cell_type": "markdown", - "metadata": { - "dotnet_interactive": { - "language": "csharp" - }, - "polyglot_notebook": { - "kernelName": "csharp" - } - }, + "metadata": {}, "source": [ "**Next Steps**: You know the basics, let's try this in a sample app so you can learn the core concepts!\n", "\n", @@ -221,6 +171,9 @@ "language": "C#", "name": ".net-csharp" }, + "language_info": { + "name": "polyglot-notebook" + }, "polyglot_notebook": { "kernelInfo": { "defaultKernelName": "csharp", From 8b12078c4206b07bd9ee9f7df7139d852ae7c975 Mon Sep 17 00:00:00 2001 From: Alex Chao Date: Thu, 30 Mar 2023 08:29:30 -0700 Subject: [PATCH 2/2] added configuration to namespace --- samples/notebooks/dotnet/Getting-Started-Notebook.ipynb | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/notebooks/dotnet/Getting-Started-Notebook.ipynb b/samples/notebooks/dotnet/Getting-Started-Notebook.ipynb index c54be21072b2..0407357b24c0 100644 --- a/samples/notebooks/dotnet/Getting-Started-Notebook.ipynb +++ b/samples/notebooks/dotnet/Getting-Started-Notebook.ipynb @@ -90,6 +90,7 @@ "using Microsoft.SemanticKernel;\n", "using Microsoft.SemanticKernel.SemanticFunctions;\n", "using Microsoft.SemanticKernel.KernelExtensions;\n", + "using Microsoft.SemanticKernel.Configuration;\n", "using System.IO;\n", "\n", "// Set Simple kernel instance\n",