Skip to content

Commit

Permalink
Upgrade examples' nuget
Browse files Browse the repository at this point in the history
  • Loading branch information
dluc committed Dec 8, 2023
1 parent 5c7012c commit 8c3b219
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 21 deletions.
43 changes: 32 additions & 11 deletions examples/000-notebooks/001-upload-and-ask.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 1,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
Expand All @@ -26,15 +26,15 @@
{
"data": {
"text/html": [
"<div><div></div><div></div><div><strong>Installed Packages</strong><ul><li><span>Microsoft.KernelMemory.Core, 0.17.231206.1-preview</span></li></ul></div></div>"
"<div><div></div><div></div><div><strong>Installed Packages</strong><ul><li><span>Microsoft.KernelMemory.Core, 0.18.231207.1-preview</span></li></ul></div></div>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"#r \"nuget: Microsoft.KernelMemory.Core, 0.17.231206.1-preview\"\n",
"#r \"nuget: Microsoft.KernelMemory.Core, 0.18.231207.1-preview\"\n",
"\n",
"using Microsoft.KernelMemory;"
]
Expand All @@ -53,7 +53,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 2,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
Expand Down Expand Up @@ -91,7 +91,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 3,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
Expand All @@ -100,7 +100,28 @@
"kernelName": "csharp"
}
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"info: Microsoft.KernelMemory.Handlers.TextExtractionHandler[0]\n",
" Handler 'extract' ready\n",
"info: Microsoft.KernelMemory.Handlers.TextPartitioningHandler[0]\n",
" Handler 'partition' ready\n",
"info: Microsoft.KernelMemory.Handlers.SummarizationHandler[0]\n",
" Handler 'summarize' ready\n",
"info: Microsoft.KernelMemory.Handlers.GenerateEmbeddingsHandler[0]\n",
" Handler 'gen_embeddings' ready, 1 embedding generators\n",
"info: Microsoft.KernelMemory.Handlers.SaveRecordsHandler[0]\n",
" Handler save_records ready, 1 vector storages\n",
"info: Microsoft.KernelMemory.Handlers.DeleteDocumentHandler[0]\n",
" Handler 'private_delete_document' ready\n",
"info: Microsoft.KernelMemory.Handlers.DeleteIndexHandler[0]\n",
" Handler 'private_delete_index' ready\n"
]
}
],
"source": [
"var memory = new KernelMemoryBuilder()\n",
" .WithOpenAIDefaults(env[\"OPENAI_API_KEY\"])\n",
Expand All @@ -118,7 +139,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 4,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
Expand All @@ -141,7 +162,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 5,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
Expand All @@ -157,7 +178,7 @@
"text": [
"Question: What's Semantic Kernel?\n",
"\n",
"Answer: Semantic Kernel is a lightweight SDK (Software Development Kit) developed by Microsoft. It enables the integration of AI Large Language Models (LLMs) with conventional programming languages. The SDK combines natural language semantic functions, traditional code native functions, and embeddings-based memory to add value and unlock new potential in applications with AI. Semantic Kernel supports prompt templating, function chaining, vectorized memory, and intelligent planning capabilities. It encapsulates several design patterns from the latest AI research, allowing developers to infuse their applications with features like prompt chaining, recursive reasoning, summarization, zero/few-shot learning, contextual memory, long-term memory, embeddings, semantic indexing, planning, retrieval-augmented generation, and accessing external knowledge stores. Semantic Kernel is open-source and aims to build AI-first apps faster by providing a flexible and extensible programming model.\n"
"Answer: Semantic Kernel is a lightweight SDK (Software Development Kit) developed by Microsoft. It enables the integration of AI Large Language Models (LLMs) with conventional programming languages. The SDK combines natural language semantic functions, traditional code native functions, and embeddings-based memory to add value and unlock new potential in applications with AI. Semantic Kernel supports prompt templating, function chaining, vectorized memory, and intelligent planning capabilities. It encapsulates several design patterns from the latest AI research, allowing developers to infuse their applications with features like prompt chaining, recursive reasoning, summarization, zero/few-shot learning, contextual memory, long-term memory, embeddings, semantic indexing, planning, retrieval-augmented generation, and accessing external knowledge stores. Semantic Kernel is open-source and aims to enable developers to build AI-first apps faster.\n"
]
}
],
Expand All @@ -178,7 +199,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 6,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
Expand All @@ -194,7 +215,7 @@
"text": [
"Sources:\n",
"\n",
" - sample-SK-Readme.pdf - doc001/3b9ae5f6963e4aecb0566043a47aa370 [Thursday, December 7, 2023]\n"
" - sample-SK-Readme.pdf - doc001/ecb6d46eb039411193996b6cc802b11e [Friday, December 8, 2023]\n"
]
}
],
Expand Down
12 changes: 6 additions & 6 deletions examples/000-notebooks/002-semantic-kernel-plugin.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
{
"data": {
"text/html": [
"<div><div></div><div></div><div><strong>Installed Packages</strong><ul><li><span>Microsoft.KernelMemory.SemanticKernelPlugin, 0.17.231206.1-preview</span></li><li><span>Microsoft.SemanticKernel, 1.0.0-rc3</span></li></ul></div></div>"
"<div><div></div><div></div><div><strong>Installed Packages</strong><ul><li><span>Microsoft.KernelMemory.SemanticKernelPlugin, 0.18.231207.1-preview</span></li><li><span>Microsoft.SemanticKernel, 1.0.0-rc3</span></li></ul></div></div>"
]
},
"metadata": {},
Expand All @@ -35,7 +35,7 @@
],
"source": [
"#r \"nuget: Microsoft.SemanticKernel, 1.0.0-rc3\"\n",
"#r \"nuget: Microsoft.KernelMemory.SemanticKernelPlugin, 0.17.231206.1-preview\"\n",
"#r \"nuget: Microsoft.KernelMemory.SemanticKernelPlugin, 0.18.231207.1-preview\"\n",
"\n",
"using Microsoft.SemanticKernel;\n",
"using Microsoft.KernelMemory;"
Expand Down Expand Up @@ -198,7 +198,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 5,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
Expand Down Expand Up @@ -292,7 +292,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 7,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
Expand All @@ -319,7 +319,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 8,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
Expand All @@ -333,7 +333,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"💫 Orion is a constellation named after a hunter in Greek mythology and also refers to NASA's spacecraft.\n"
"🌌 Orion is a constellation named after a Greek hunter. It is visible in winter and has a spacecraft named after it.\n"
]
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.SemanticKernel" Version="1.0.0-rc3" />
<PackageReference Include="Microsoft.KernelMemory.SemanticKernelPlugin" Version="0.17.231206.1-preview" />
<PackageReference Include="Microsoft.KernelMemory.SemanticKernelPlugin" Version="0.18.231207.1-preview" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions examples/002-dotnet-SemanticKernelPlugin/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ public static async Task Main()
var builder = new KernelBuilder();
builder
// For OpenAI:
//.WithOpenAIChatCompletion(
//.AddOpenAIChatCompletion(
// modelId: "gpt-3.5-turbo",
// apiKey: EnvVar("OPENAI_API_KEY"))
// Azure OpenAI:
.WithAzureOpenAIChatCompletion(
// Azure OpenAI:
.AddAzureOpenAIChatCompletion(
deploymentName: EnvVar("AOAI_DEPLOYMENT_TEXT"),
modelId: EnvVar("AOAI_DEPLOYMENT_TEXT"),
endpoint: EnvVar("AOAI_ENDPOINT"),
Expand Down

0 comments on commit 8c3b219

Please sign in to comment.