Skip to content

Commit 3939542

Browse files
Create pointers to learn.microsoft.com (microsoft#2159)
### Motivation and Context To align docs, we should redirect developers to the documents on the official learn site. ### Description - Create redirects for docs files in repo that point users to learn.microsoft.com. - Update readme links to point to learn.microsoft.com ### Contribution Checklist - [ ] The code builds clean without any errors or warnings - [ ] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [ ] All unit tests pass, and I have added new tests where possible - [ ] I didn't break anyone 😄
1 parent dad98cd commit 3939542

5 files changed

+22
-379
lines changed

FEATURE_MATRIX.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Semantic Kernel Feature Matrix by Language
1+
# Semantic Kernel feature matrix by language
22

3-
This document can be found on the Semantic Kernel Documentation site on [Supported Languages.](https://learn.microsoft.com/en-us/semantic-kernel/get-started/supported-languages)
3+
This document has been moved to the Semantic Kernel Documentation site. You can find it by navigating to the [Supported Languages](https://learn.microsoft.com/en-us/semantic-kernel/get-started/supported-languages) page.
44

5-
To make an update on the page, file a PR on the [docs repo.](https://github.com/MicrosoftDocs/semantic-kernel-docs/blob/main/semantic-kernel/get-started/supported-languages.md)
5+
To make an update on the page, file a PR on the [docs repo.](https://github.com/MicrosoftDocs/semantic-kernel-docs/blob/main/semantic-kernel/get-started/supported-languages.md)

README.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ code **native functions**, and **embeddings-based memory** unlocking new potenti
2222
and adding value to applications with AI.
2323

2424
SK supports
25-
[prompt templating](docs/PROMPT_TEMPLATE_LANGUAGE.md), function
25+
[prompt templating](https://learn.microsoft.com/en-us/semantic-kernel/prompt-engineering/prompt-template-syntax), function
2626
chaining,
27-
[vectorized memory](docs/EMBEDDINGS.md), and
28-
[intelligent planning](docs/PLANNERS.md)
27+
[vectorized memory](https://learn.microsoft.com/en-us/semantic-kernel/memories/embeddings), and
28+
[intelligent planning](https://learn.microsoft.com/en-us/semantic-kernel/ai-orchestration/planner)
2929
capabilities out of the box.
3030

3131
Semantic Kernel supports and encapsulates several design patterns from the latest
32-
in AI research, such that developers can infuse their applications with [plugins](https://learn.microsoft.com/semantic-kernel/howto/) like [prompt](docs/PROMPT_TEMPLATE_LANGUAGE.md)
33-
chaining, recursive reasoning, summarization, zero/few-shot learning, contextual
34-
memory, long-term memory, [embeddings](docs/EMBEDDINGS.md), semantic indexing,
35-
[planning](docs/PLANNERS.md), retrieval-augmented generation and accessing external
32+
in AI research, such that developers can infuse their applications with [plugins](https://learn.microsoft.com/en-us/semantic-kernel/ai-orchestration/plugins) like [prompt
33+
chaining](https://learn.microsoft.com/en-us/semantic-kernel/ai-orchestration/chaining-functions), recursive reasoning, summarization, zero/few-shot learning, contextual
34+
memory, long-term memory, [embeddings](https://learn.microsoft.com/en-us/semantic-kernel/memories/embeddings), semantic indexing,
35+
[planning](https://learn.microsoft.com/en-us/semantic-kernel/ai-orchestration/planner), retrieval-augmented generation and accessing external
3636
knowledge stores as well as your own data.
3737

3838
By joining the SK community, you can build AI-first apps faster and have a front-row
@@ -85,7 +85,6 @@ and to run one of the C# or Python console applications/scripts:
8585
4. Copy the code from [here](python/README.md) into the `hello-world.py` script.
8686
5. Run the python script.
8787

88-
8988
## Sample apps ⚡
9089

9190
The repository includes some sample applications, with a React frontend and
@@ -95,7 +94,7 @@ Follow the links for more information and instructions about running these apps.
9594

9695
| | |
9796
| ----------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
98-
| [Simple chat summary](samples/apps/chat-summary-webapp-react/README.md) | Use ready-to-use plugins and get plugins into your app easily. |
97+
| [Simple chat summary](samples/apps/chat-summary-webapp-react/README.md) | Use ready-to-use plugins and get plugins into your app easily. |
9998
| [Book creator](samples/apps/book-creator-webapp-react/README.md) | Use planner to deconstruct a complex goal and envision using the planner in your app. |
10099
| [Authentication and APIs](samples/apps/auth-api-webapp-react/README.md) | Use a basic connector pattern to authenticate and connect to an API and imagine integrating external data into your app's LLM AI. |
101100
| [GitHub repository Q&A](samples/apps/github-qna-webapp-react/README.md) | Use embeddings and memory to store recent data and allow you to query against it. |
@@ -120,8 +119,9 @@ Getting Semantic Kernel deployed to Azure as web app service is easy with one-cl
120119

121120
For a more hands-on overview, you can also check out the C# and Python Jupyter notebooks, starting
122121
from here:
123-
* [Getting Started with C# notebook](samples/notebooks/dotnet/00-getting-started.ipynb)
124-
* [Getting Started with Python notebook](samples/notebooks/python/00-getting-started.ipynb)
122+
123+
- [Getting Started with C# notebook](samples/notebooks/dotnet/00-getting-started.ipynb)
124+
- [Getting Started with Python notebook](samples/notebooks/python/00-getting-started.ipynb)
125125

126126
**Requirements:** C# notebooks require [.NET 7](https://dotnet.microsoft.com/download)
127127
and the VS Code [Polyglot extension](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.dotnet-interactive-vscode).

docs/PLANNERS.md

+3-39
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,5 @@
1-
# SK Planner
1+
# Semantic Kernel planner
22

3-
![image](https://user-images.githubusercontent.com/371009/221739773-cf43522f-c1e4-42f2-b73d-5ba84e21febb.png)
3+
This document has been moved to the Semantic Kernel Documentation site. You can find it by navigating to the [Automatically orchestrate AI with planner](https://learn.microsoft.com/en-us/semantic-kernel/ai-orchestration/planner) page.
44

5-
Planners work backwards from a goal that’s provided from a user's ASK.
6-
7-
![image](https://user-images.githubusercontent.com/371009/221742094-2920c697-7494-4a7b-a894-4f24fb90965f.png)
8-
9-
We call this approach "goal-oriented AI" — harking back to the early days of AI
10-
when researchers aspired for computers to beat the world's reigning chess champion.
11-
That grand goal was achieved eventually, but with the unusual competence of new
12-
LLM AI models to provide step-by-step directions for practically any goal can be
13-
attainable when the right
14-
[skills](SKILLS.md)
15-
are available.
16-
17-
Because planners have access to either a pre-defined library of pre-made skills
18-
and/or a dynamically defined set of skills, they are able to fulfill an
19-
[ASK](GLOSSARY.md)
20-
with confidence. In addition, planners call upon memories to best situate the
21-
ASK's context and connectors to call APIs and to leverage other external
22-
capabilities.
23-
24-
# What is the value of "goal-oriented" AI?
25-
26-
The *[Jobs To Be Done (JTBD)](https://hbr.org/2016/09/know-your-customers-jobs-to-be-done)*
27-
movement has popularized a shift in moving from work outputs to work outcomes. Instead
28-
of focusing on the features or the functions of a product or a service, the JTBD
29-
approach emphasizes the goals and desires of the customer or the user, and the value
30-
or the benefit that they seek or expect from using the product or service. By
31-
understanding and articulating the JTBD of the customer or the user, a product or
32-
service can be designed and delivered more effectively. You just need to make the
33-
right ASK that isn't just "turn on the lights" and instead a more challenging goal
34-
like "I want a job promotion."
35-
36-
# What if Planners need a Skill that's unavailable?
37-
38-
Planners will operate within the skills they have available. In the event that a
39-
desired skill does not exist, some planners can suggest you to create the skill.
40-
Or, depending upon the level of complexity, the kernel can help you write the
41-
missing skill.
5+
To make an update on the page, file a PR on the [docs repo.](https://github.com/MicrosoftDocs/semantic-kernel-docs/blob/main/semantic-kernel/ai-orchestration/planner.md)

docs/PROMPT_TEMPLATE_LANGUAGE.md

+2-249
Original file line numberDiff line numberDiff line change
@@ -1,252 +1,5 @@
1-
Prompts are the inputs or queries that a user or a program gives to a Large Learning Model ([LLM](https://en.wikipedia.org/wiki/Wikipedia:Large_language_models)) AI,
2-
in order to elicit a specific response from the model.
3-
4-
Prompts can be natural
5-
language sentences or questions, or code snippets or commands, or any combination
6-
of text or code, depending on the domain and the task.
7-
8-
Prompts can also be nested
9-
or chained, meaning that the output of one prompt can be used as the input of another
10-
prompt, creating more complex and dynamic interactions with the model.
11-
121
# SK Prompt Template Syntax
132

14-
The Semantic Kernel prompt template language is a simple and powerful way to
15-
define and compose AI
16-
[functions](GLOSSARY.md)
17-
**using plain text**.
18-
You can use it to create natural language prompts, generate responses, extract
19-
information, **invoke other prompts** or perform any other task that can be
20-
expressed with text.
21-
22-
The language supports three basic features that allow you to (**#1**) include
23-
variables, (**#2**) call external functions, and (**#3**) pass parameters to functions.
24-
25-
It is not required to write any code or import any external libraries, just use the
26-
curly braces `{{...}}` to embed expressions in your prompts.
27-
Semantic Kernel will parse your template and execute the logic behind it.
28-
This way, you can easily integrate AI into your apps with minimal effort and
29-
maximum flexibility.
30-
31-
## Variables
32-
33-
To include a variable value in your text, use the `{{$variableName}}` syntax.
34-
For example, if you have a variable called `name` that holds the user's name,
35-
you can write:
36-
37-
Hello {{$name}}, welcome to Semantic Kernel!
38-
39-
This will produce a greeting with the user's name.
40-
41-
Spaces are ignored, so if you find it more readable, you can also write:
42-
43-
Hello {{ $name }}, welcome to Semantic Kernel!
44-
45-
## Function calls
46-
47-
To call an external function and embed the result in your text, use the
48-
`{{namespace.functionName}}` syntax.
49-
For example, if you have a function called `weather.getForecast` that returns
50-
the weather forecast for a given location, you can write:
51-
52-
The weather today is {{weather.getForecast}}.
53-
54-
This will produce a sentence with the weather forecast for the default location
55-
stored in the `input` variable.
56-
The `input` variable is set automatically by the kernel when invoking a function.
57-
For instance, the code above is equivalent to:
58-
59-
The weather today is {{weather.getForecast $input}}.
60-
61-
## Function parameters
62-
63-
To call an external function and pass a parameter to it, use the
64-
`{{namespace.functionName $varName}}` and
65-
`{{namespace.functionName "value"}}` syntax.
66-
For example, if you want to pass a different input to the weather forecast
67-
function, you can write:
68-
69-
The weather today in {{$city}} is {{weather.getForecast $city}}.
70-
The weather today in Schio is {{weather.getForecast "Schio"}}.
71-
72-
This will produce two sentences with the weather forecast for two different
73-
locations, using the city stored in the _`city`_ **variable** and the _"Schio"_
74-
location **value** hardcoded in the prompt template.
75-
76-
## Design Principles
77-
78-
The template language is designed to be simple and fast to render, allowing
79-
to create functions with a simple text editor, using natural language, reducing
80-
special syntax to a minimum, and minimizing edge cases.
81-
82-
The template language uses the **«`$`»** symbol on purpose, to clearly distinguish
83-
between function calls that retrieve content executing some code, from variables,
84-
which are replaced with data from the local temporary memory.
85-
86-
Branching features such as _"if"_, _"for"_, and code blocks are not part of SK's
87-
template language. This reflects SK's design principle of using natural language
88-
as much as possible, with a clear separation from traditional programming code.
89-
90-
By using a simple language, the kernel can also avoid complex parsing and
91-
external dependencies, resulting in a fast and memory efficient processing.
92-
93-
## Semantic function example
94-
95-
A Semantic Function is a function written in a natural language in a text file (i.e., "skprompt.txt") using SK's Prompt Template language. The following is a simple example of a semantic function defined with a prompt template, using the syntax described.
96-
97-
`== File: skprompt.txt ==`
98-
99-
```
100-
My name: {{msgraph.GetMyName}}
101-
My email: {{msgraph.GetMyEmailAddress}}
102-
My hobbies: {{memory.recall "my hobbies"}}
103-
Recipient: {{$recipient}}
104-
Email to reply to:
105-
=========
106-
{{$sourceEmail}}
107-
=========
108-
Generate a response to the email, to say: {{$input}}
109-
110-
Include the original email quoted after the response.
111-
```
112-
113-
If we were to write that function in C#, it would look something like:
114-
115-
```csharp
116-
async Task<string> GenResponseToEmailAsync(
117-
string whatToSay,
118-
string recipient,
119-
string sourceEmail)
120-
{
121-
try {
122-
string name = await this._msgraph.GetMyName();
123-
} catch {
124-
...
125-
}
126-
127-
try {
128-
string email = await this._msgraph.GetMyEmailAddress();
129-
} catch {
130-
...
131-
}
132-
133-
try {
134-
// Use AI to generate an email using the 5 given variables
135-
// Take care of retry logic, tracking AI costs, etc.
136-
string response = await ...
137-
138-
return response;
139-
} catch {
140-
...
141-
}
142-
}
143-
```
144-
145-
# Notes about special chars
146-
147-
Semantic function templates are text files, so there is no need to escape special chars
148-
like new lines and tabs. However, there are two cases that require a special syntax:
149-
150-
1. Including double curly braces in the prompt templates
151-
2. Passing to functions hardcoded values that include quotes
152-
153-
## Prompts needing double curly braces
154-
155-
Double curly braces have a special use case, they are used to inject variables,
156-
values, and functions into templates.
157-
158-
If you need to include the **`{{`** and **`}}`** sequences in your prompts, which
159-
could trigger special rendering logic, the best solution is to use string values
160-
enclosed in quotes, like `{{ "{{" }}` and `{{ "}}" }}`
161-
162-
For example:
163-
164-
{{ "{{" }} and {{ "}}" }} are special SK sequences.
165-
166-
will render to:
167-
168-
{{ and }} are special SK sequences.
169-
170-
## Values that include quotes, and escaping
171-
172-
Values can be enclosed using **single quotes** and **double quotes**.
173-
174-
To avoid the need for special syntax, when working with a value that contains
175-
_single quotes_, we recommend wrapping the value with _double quotes_. Similarly,
176-
when using a value that contains _double quotes_, wrap the value with _single quotes_.
177-
178-
For example:
179-
180-
...text... {{ functionName "one 'quoted' word" }} ...text...
181-
...text... {{ functionName 'one "quoted" word' }} ...text...
182-
183-
For those cases where the value contains both single and double quotes, you will
184-
need _escaping_, using the special **«`\`»** symbol.
185-
186-
When using double quotes around a value, use **«`\"`»** to include a double quote
187-
symbol inside the value:
188-
189-
... {{ "quotes' \"escaping\" example" }} ...
190-
191-
and similarly, when using single quotes, use **«`\'`»** to include a single quote
192-
inside the value:
193-
194-
... {{ 'quotes\' "escaping" example' }} ...
195-
196-
Both are rendered to:
197-
198-
... quotes' "escaping" example ...
199-
200-
Note that for consistency, the sequences **«`\'`»** and **«`\"`»** do always render
201-
to **«`'`»** and **«`"`»**, even when escaping might not be required.
202-
203-
For instance:
204-
205-
... {{ 'no need to \"escape" ' }} ...
206-
207-
is equivalent to:
208-
209-
... {{ 'no need to "escape" ' }} ...
210-
211-
and both render to:
212-
213-
... no need to "escape" ...
214-
215-
In case you may need to render a backslash in front of a quote, since **«`\`»**
216-
is a special char, you will need to escape it too, and use the special sequences
217-
**«`\\\'`»** and **«`\\\"`»**.
218-
219-
For example:
220-
221-
{{ 'two special chars \\\' here' }}
222-
223-
is rendered to:
224-
225-
two special chars \' here
226-
227-
Similarly to single and double quotes, the symbol **«`\`»** doesn't always need
228-
to be escaped. However, for consistency, it can be escaped even when not required.
229-
230-
For instance:
231-
232-
... {{ 'c:\\documents\\ai' }} ...
233-
234-
is equivalent to:
235-
236-
... {{ 'c:\documents\ai' }} ...
237-
238-
and both are rendered to:
239-
240-
... c:\documents\ai ...
241-
242-
Lastly, backslashes have a special meaning only when used in front of
243-
**«`'`»**, **«`"`»** and **«`\`»**.
244-
245-
In all other cases, the backslash character has no impact and is rendered as is.
246-
For example:
247-
248-
{{ "nothing special about these sequences: \0 \n \t \r \foo" }}
249-
250-
is rendered to:
3+
This document has been moved to the Semantic Kernel Documentation site. You can find it by navigating to the [Prompt template syntax](https://learn.microsoft.com/en-us/semantic-kernel/prompt-engineering/prompt-template-syntax) page.
2514

252-
nothing special about these sequences: \0 \n \t \r \foo
5+
To make an update on the page, file a PR on the [docs repo.](https://github.com/MicrosoftDocs/semantic-kernel-docs/blob/main/semantic-kernel/prompt-engineering/prompt-template-syntax.md)

0 commit comments

Comments
 (0)