docs/decisions/0042-samples-restructure.md
Examples suffixes which are not necessary as everything in samples is already an example.| Type | Description |
|---|---|
GettingStarted | A single step-by-step tutorial to get started |
Concepts | A concept by feature specific code snippets |
LearnResources | Code snippets that are related to online documentation sources like Microsoft Learn, DevBlogs and others |
Tutorials | More in depth step-by-step tutorials |
Demos | Demonstration applications that leverage the usage of one or many features |
| Current Folder | Proposal |
|---|---|
| KernelSyntaxExamples/Getting_Started | Move into GettingStarted |
KernelSyntaxExamples/Examples??_* | Decompose into Concepts on multiple conceptual subfolders |
| AgentSyntaxExamples | Decompose into Concepts on Agents specific subfolders. |
| DocumentationExamples | Move into LearnResources subfolder and rename to MicrosoftLearn |
| CreateChatGptPlugin | Move into Demo subfolder |
| HomeAutomation | Move into Demo subfolder |
| TelemetryExample | Move into Demo subfolder and rename to TelemetryWithAppInsights |
| HuggingFaceImageTextExample | Move into Demo subfolder and rename to HuggingFaceImageToText |
The following options below are the potential considered options for the root structure of the samples folder.
This option squeezes as much as possible the root of samples folder in different subcategories to be minimalist when looking for the samples.
Proposed root structure
samples/
├── Tutorials/
│ └── Getting Started/
├── Concepts/
│ ├── Kernel Syntax**
│ └── Agents Syntax**
├── Resources/
└── Demos/
Pros:
Cons:
Getting Started is a tutorialThis option brings Getting Started to the root samples folder compared the structure proposed in Option 1.
Proposed root structure
samples/
├── Getting Started/
├── Tutorials/
├── Concepts/
│ ├── Kernel Syntax Decomposition**
│ └── Agents Syntax Decomposition**
├── Resources/
└── Demos/
Pros:
Cons:
This option is more conservative and keeps Syntax Examples projects as root options as well as some new folders for Use Cases, Modalities and Kernel Content.
Proposed root structure
samples/
|── QuickStart/
|── Tutorials/
├── KernelSyntaxExamples/
├── AgentSyntaxExamples/
├── UseCases/ OR Demos/
├── KernelContent/ OR Modalities/
├── Documentation/ OR Resources/
Pros:
Cons:
KernelContent or Modalities is a internal term that may not be clear for the customerDocumentation may be confused a documents only folder, which actually contains code samples used in documentation. (not clear message)Use Cases may suggest an idea of real world use cases implemented, where in reality those are simple demonstrations of a SK feature.Currently Kernel Syntax Examples contains more than 70 numbered examples all side-by-side, where the number has no progress meaning and is not very informative.
The following options are considered for the KernelSyntaxExamples folder decomposition over multiple subfolders based on Kernel Concepts and Features that were developed.
Identified Component Oriented Concepts:
Kernel
AI Services (Examples using Services directly with Single/Multiple + Streaming and Non-Streaming results)
Memory Services
Search
Text Embeddings
Telemetry
Logging
Dependency Injection
HttpClient
Planners
Authentication
Function Calling
Filtering
Templates
Resilience
Memory
RAG
Agents
Flow Orchestrator
This options decomposes the Concepts Structured by Kernel Components and Features.
At first is seems logical and easy to understand how the concepts are related and can be evolved into more advanced concepts following the provided structure.
Large (Less files per folder):
Concepts/
├── Kernel/
│ ├── Builder/
│ ├── Functions/
│ │ ├── Arguments/
│ │ ├── MethodFunctions/
│ │ ├── PromptFunctions/
│ │ ├── Types/
│ │ ├── Results/
│ │ │ ├── Serialization/
│ │ │ ├── Metadata/
│ │ │ └── Strongly typed/
│ │ └── InlineFunctions/
│ ├── Plugins/
│ │ ├── Describe Plugins/
│ │ ├── OpenAI Plugins/
│ │ ├── OpenAPI Plugins/
│ │ │ └── API Manifest/
│ │ ├── gRPC Plugins/
│ │ └── Mutable Plugins/
│ ├── AI Services (Examples using Services thru Kernel Invocation)/
│ │ ├── Chat Completion/
│ │ ├── Text Generation/
│ │ └── Service Selector/
│ ├── Hooks/
│ ├── Filters/
│ │ ├── Function Filtering/
│ │ ├── Template Rendering Filtering/
│ │ └── Function Call Filtering (When available)/
│ └── Templates/
├── AI Services (Examples using Services directly with Single/Multiple + Streaming and Non-Streaming results)/
│ ├── ExecutionSettings/
│ ├── Chat Completion/
│ │ ├── LocalModels/
| │ │ ├── LMStudio/
| │ │ ├── LocalAI/
| │ │ ├── Ollama/
| │ │ └── HuggingFace/
│ │ ├── Gemini/
│ │ ├── OpenAI/
│ │ ├── AzureOpenAI/
│ │ ├── LMStudio/
│ │ ├── Ollama/
│ │ └── HuggingFace/
│ ├── Text Generation/
│ │ ├── LocalModels/
| │ │ ├── Ollama/
| │ │ └── HuggingFace/
│ │ ├── OpenAI/
│ │ ├── AzureOpenAI/
│ │ └── HuggingFace/
│ ├── Text to Image/
│ │ ├── OpenAI/
│ │ └── AzureOpenAI/
│ ├── Image to Text/
│ │ └── HuggingFace/
│ ├── Text to Audio/
│ │ └── OpenAI/
│ ├── Audio to Text/
│ │ └── OpenAI/
│ └── Custom/
│ ├── DYI/
│ └── OpenAI/
│ └── OpenAI File/
├── Memory Services/
│ ├── Search/
│ │ ├── Semantic Memory/
│ │ ├── Text Memory/
│ │ └── Azure AI Search/
│ └── Text Embeddings/
│ ├── OpenAI/
│ └── HuggingFace/
├── Telemetry/
├── Logging/
├── Dependency Injection/
├── HttpClient/
│ ├── Resiliency/
│ └── Usage/
├── Planners/
│ └── Handlerbars/
├── Authentication/
│ └── Azure AD/
├── Function Calling/
│ ├── Auto Function Calling/
│ └── Manual Function Calling/
├── Filtering/
│ ├── Kernel Hooks/
│ └── Service Selector/
├── Templates/
├── Resilience/
├── Memory/
│ ├── Semantic Memory/
│ ├── Text Memory Plugin/
│ └── Search/
├── RAG/
│ ├── Inline/
│ └── Function Calling/
├── Agents/
│ ├── Delegation/
│ ├── Charts/
│ ├── Collaboration/
│ ├── Authoring/
│ ├── Tools/
│ └── Chat Completion Agent/
│ (Agent Syntax Examples Goes here without numbering)
└── Flow Orchestrator/
Compact (More files per folder):
Concepts/
├── Kernel/
│ ├── Builder/
│ ├── Functions/
│ ├── Plugins/
│ ├── AI Services (Examples using Services thru Kernel Invocation)/
│ │ ├── Chat Completion/
│ │ ├── Text Generation/
│ │ └── Service Selector/
│ ├── Hooks/
│ ├── Filters/
│ └── Templates/
├── AI Services (Examples using Services directly with Single/Multiple + Streaming and Non-Streaming results)/
│ ├── Chat Completion/
│ ├── Text Generation/
│ ├── Text to Image/
│ ├── Image to Text/
│ ├── Text to Audio/
│ ├── Audio to Text/
│ └── Custom/
├── Memory Services/
│ ├── Search/
│ └── Text Embeddings/
├── Telemetry/
├── Logging/
├── Dependency Injection/
├── HttpClient/
│ ├── Resiliency/
│ └── Usage/
├── Planners/
│ └── Handlerbars/
├── Authentication/
│ └── Azure AD/
├── Function Calling/
│ ├── Auto Function Calling/
│ └── Manual Function Calling/
├── Filtering/
│ ├── Kernel Hooks/
│ └── Service Selector/
├── Templates/
├── Resilience/
├── RAG/
├── Agents/
└── Flow Orchestrator/
Pros:
Cons:
Similar approach to Option 1, but with a flattened structure using a single level of folders to avoid deep nesting and complexity although keeping easy to navigate around the componentized concepts.
Large (Less files per folder):
Concepts/
├── KernelBuilder
├── Kernel.Functions.Arguments
├── Kernel.Functions.MethodFunctions
├── Kernel.Functions.PromptFunctions
├── Kernel.Functions.Types
├── Kernel.Functions.Results.Serialization
├── Kernel.Functions.Results.Metadata
├── Kernel.Functions.Results.StronglyTyped
├── Kernel.Functions.InlineFunctions
├── Kernel.Plugins.DescribePlugins
├── Kernel.Plugins.OpenAIPlugins
├── Kernel.Plugins.OpenAPIPlugins.APIManifest
├── Kernel.Plugins.gRPCPlugins
├── Kernel.Plugins.MutablePlugins
├── Kernel.AIServices.ChatCompletion
├── Kernel.AIServices.TextGeneration
├── Kernel.AIServices.ServiceSelector
├── Kernel.Hooks
├── Kernel.Filters.FunctionFiltering
├── Kernel.Filters.TemplateRenderingFiltering
├── Kernel.Filters.FunctionCallFiltering
├── Kernel.Templates
├── AIServices.ExecutionSettings
├── AIServices.ChatCompletion.Gemini
├── AIServices.ChatCompletion.OpenAI
├── AIServices.ChatCompletion.AzureOpenAI
├── AIServices.ChatCompletion.HuggingFace
├── AIServices.TextGeneration.OpenAI
├── AIServices.TextGeneration.AzureOpenAI
├── AIServices.TextGeneration.HuggingFace
├── AIServices.TextToImage.OpenAI
├── AIServices.TextToImage.AzureOpenAI
├── AIServices.ImageToText.HuggingFace
├── AIServices.TextToAudio.OpenAI
├── AIServices.AudioToText.OpenAI
├── AIServices.Custom.DIY
├── AIServices.Custom.OpenAI.OpenAIFile
├── MemoryServices.Search.SemanticMemory
├── MemoryServices.Search.TextMemory
├── MemoryServices.Search.AzureAISearch
├── MemoryServices.TextEmbeddings.OpenAI
├── MemoryServices.TextEmbeddings.HuggingFace
├── Telemetry
├── Logging
├── DependencyInjection
├── HttpClient.Resiliency
├── HttpClient.Usage
├── Planners.Handlerbars
├── Authentication.AzureAD
├── FunctionCalling.AutoFunctionCalling
├── FunctionCalling.ManualFunctionCalling
├── Filtering.KernelHooks
├── Filtering.ServiceSelector
├── Templates
├── Resilience
├── RAG.Inline
├── RAG.FunctionCalling
├── Agents.Delegation
├── Agents.Charts
├── Agents.Collaboration
├── Agents.Authoring
├── Agents.Tools
├── Agents.ChatCompletionAgent
└── FlowOrchestrator
Compact (More files per folder):
Concepts/
├── KernelBuilder
├── Kernel.Functions
├── Kernel.Plugins
├── Kernel.AIServices
├── Kernel.Hooks
├── Kernel.Filters
├── Kernel.Templates
├── AIServices.ChatCompletion
├── AIServices.TextGeneration
├── AIServices.TextToImage
├── AIServices.ImageToText
├── AIServices.TextToAudio
├── AIServices.AudioToText
├── AIServices.Custom
├── MemoryServices.Search
├── MemoryServices.TextEmbeddings
├── Telemetry
├── Logging
├── DependencyInjection
├── HttpClient
├── Planners.Handlerbars
├── Authentication.AzureAD
├── FunctionCalling
├── Filtering
├── Templates
├── Resilience
├── RAG
├── Agents
└── FlowOrchestrator
Pros:
Cons:
This option decomposes the Kernel Syntax Examples by grouping big and related features together.
Concepts/
├── Functions/
├── Chat Completion/
├── Text Generation/
├── Text to Image/
├── Image to Text/
├── Text to Audio/
├── Audio to Text/
├── Telemetry
├── Logging
├── Dependency Injection
├── Plugins
├── Auto Function Calling
├── Filtering
├── Memory
├── Search
├── Agents
├── Templates
├── RAG
├── Prompts
└── LocalModels/
Pros:
Cons:
Breaks the examples per difficulty level, from basic to expert. The overall structure would be similar to option 3 although only subitems would be different if they have that complexity level.
Concepts/
├── 200-Basic
| ├── Functions
| ├── Chat Completion
| ├── Text Generation
| └── ..Basic only folders/files ..
├── 300-Intermediate
| ├── Functions
| ├── Chat Completion
| └── ..Intermediate only folders/files ..
├── 400-Advanced
| ├── Manual Function Calling
| └── ..Advanced only folders/files ..
├── 500-Expert
| ├── Functions
| ├── Manual Function Calling
| └── ..Expert only folders/files ..
Pros:
Cons:
Chosen options:
[x] Root Structure Decision: Option 2 - Getting Started Root Categorization
[x] KernelSyntaxExamples Decomposition Decision: Option 3 - Concept by Feature Grouping