Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 13 additions & 59 deletions samples/notebooks/dotnet/Getting-Started-Notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,7 @@
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"dotnet_interactive": {
"language": "csharp"
},
"polyglot_notebook": {
"kernelName": "csharp"
}
},
"metadata": {},
Comment thread
alexchaomander marked this conversation as resolved.
"source": [
"#### Watch the Getting Started Quick Start [Video](https://aka.ms/SK-Getting-Started-Notebook)\n",
"\n",
Expand All @@ -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."
]
Expand All @@ -64,9 +47,6 @@
},
"polyglot_notebook": {
"kernelName": "csharp"
},
"vscode": {
"languageId": "polyglot-notebook"
}
},
"outputs": [],
Expand All @@ -88,14 +68,7 @@
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"dotnet_interactive": {
"language": "csharp"
},
"polyglot_notebook": {
"kernelName": "csharp"
}
},
"metadata": {},
"source": [
"**Step 3**: Instantiate the Kernel"
]
Expand All @@ -109,9 +82,6 @@
},
"polyglot_notebook": {
"kernelName": "csharp"
},
"vscode": {
"languageId": "polyglot-notebook"
}
},
"outputs": [],
Expand All @@ -120,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",
Expand All @@ -135,32 +106,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);"
Comment thread
alexchaomander marked this conversation as resolved.
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {
"dotnet_interactive": {
"language": "csharp"
},
"polyglot_notebook": {
"kernelName": "csharp"
}
},
"metadata": {},
"source": [
"**Step 4**: Load and Run a Skill"
]
Expand All @@ -174,9 +135,6 @@
},
"polyglot_notebook": {
"kernelName": "csharp"
},
"vscode": {
"languageId": "polyglot-notebook"
}
},
"outputs": [],
Expand All @@ -197,14 +155,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",
Expand All @@ -221,6 +172,9 @@
"language": "C#",
"name": ".net-csharp"
},
"language_info": {
"name": "polyglot-notebook"
},
"polyglot_notebook": {
"kernelInfo": {
"defaultKernelName": "csharp",
Expand Down