Files
semantic-kernel/dotnet/samples/LearnResources/README.md
Roger Barreto 1a48974233 .Net Samples Restructuring - Phase 1 (#5888)
### Motivation and Context

In this change we are restructuring our samples in the following
categories:

| Type | Description |
| ----------------- |
--------------------------------------------------------------------------------------------------------
|
| `Getting started` | 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` | Demostration applications that leverage the usage of one or
many features |

## Decision Drivers and Principles

- **Easy to Search**: Well organized structure, making easy to find the
different types of samples
- **Lean namings**: Folder, Solution and Example names are as clear and
as short as possible
- **Sends a Clear Message**: Avoidance of Semantic Kernel specific
therms or jargons
- **Cross Language**: The sample structure will be similar on all
supported SK languages.

## Strategy on the current existing folders

| Current Folder | Proposal |
| ------------------------------------ |
-------------------------------------------------------------------------
|
| KernelSyntaxExamples/Getting_Started | Move into `Getting Started` |
| 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` |

## Concepts - Previously `KernelSyntax` and `AgentSyntax`.

Both `KernelSyntaxExamples` and `AgentSyntaxExamples` will be
distributed into example code by features below.

```
samples/Concepts/
├── Functions/
├── Chat Completion/
├── Text Generation/
├── Text to Image/
├── Image to Text/
├── Text to Audio/
├── Audio to Text/
├── Telemetry
├── Logging
├── Dependecy Injection
├── Plugins
├── Auto Function Calling
├── Filtering
├── Memory
├── Search
├── Agents
├── Templates
├── RAG
├── Prompts
└── LocalModels/
```
2024-04-24 12:27:43 +00:00

2.2 KiB

Learn Resources

This folder contains a project with code snippets that are related to online documentation sources like Microsoft Learn, DevBlogs and others.

Subfolders Description
MicrosoftLearn Code snippets that are related to Microsoft Learn Docs.

Running Examples with Filters

You can run specific examples by using test filters (dotnet test --filter). Type "dotnet test --help" at the command line for more details.

Configuring Secrets

Most of the examples will require secrets and credentials to access OpenAI, Azure OpenAI, and other resources. We suggest using .NET Secret Manager to avoid the risk of leaking secrets into the repository, branches and pull requests. You can also use environment variables if you prefer.

This project and KernelSyntaxExamples use the same pool of secrets.

To set your secrets with Secret Manager:

cd dotnet/samples/DocumentationExamples

dotnet user-secrets init

dotnet user-secrets set "OpenAI:ModelId" "..."
dotnet user-secrets set "OpenAI:ChatModelId" "..."
dotnet user-secrets set "OpenAI:EmbeddingModelId" "..."
dotnet user-secrets set "OpenAI:ApiKey" "..."

dotnet user-secrets set "AzureOpenAI:ServiceId" "..."
dotnet user-secrets set "AzureOpenAI:DeploymentName" "..."
dotnet user-secrets set "AzureOpenAI:ModelId" "..."
dotnet user-secrets set "AzureOpenAI:ChatDeploymentName" "..."
dotnet user-secrets set "AzureOpenAI:ChatModelId" "..."
dotnet user-secrets set "AzureOpenAI:Endpoint" "https://... .openai.azure.com/"
dotnet user-secrets set "AzureOpenAI:ApiKey" "..."

To set your secrets with environment variables, use these names:

# OpenAI
OpenAI__ModelId
OpenAI__ChatModelId
OpenAI__EmbeddingModelId
OpenAI__ApiKey

# Azure OpenAI
AzureOpenAI__ServiceId
AzureOpenAI__DeploymentName
AzureOpenAI__ChatDeploymentName
AzureOpenAI__Endpoint
AzureOpenAI__ApiKey