Skip to content

Commit

Permalink
Merge branch 'dotnet:main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
mpostol authored Oct 3, 2024
2 parents efa6407 + a3b91a6 commit 310dde8
Show file tree
Hide file tree
Showing 67 changed files with 730 additions and 418 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/clean-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
with:
egress-policy: audit

- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0

# Call clean repo
- name: Clean repo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
with:
egress-policy: audit

- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
# - name: Setup .NET
# uses: actions/setup-dotnet@4d4a70f4a5b2a5a5329f13be4ac933f2c9206ac0
# with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ jobs:
egress-policy: audit

- name: 'Checkout Repository'
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: 'Dependency Review'
uses: actions/dependency-review-action@5a2ce3f5b92ee19cbb1541a4984c76d921601d7c # v4.3.4
2 changes: 1 addition & 1 deletion .github/workflows/docs-verifier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
egress-policy: audit

- name: Checkout the repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0

- name: Validate
uses: dotnet/docs-actions/actions/docs-verifier@5e8bcc78465d45a7544bba56509a1a69922b6a5a # main
2 changes: 1 addition & 1 deletion .github/workflows/markdownlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
with:
egress-policy: audit

- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- uses: DavidAnson/markdownlint-cli2-action@b4c9feab76d8025d1e83c653fa3990936df0e6c8 # v16.0.0
with:
config: ".markdownlint-cli2.jsonc"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
egress-policy: audit

- name: "Checkout code"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
persist-credentials: false

Expand Down Expand Up @@ -71,6 +71,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@461ef6c76dfe95d5c364de2f431ddbd31a417628 # v3.26.9
uses: github/codeql-action/upload-sarif@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v3.26.10
with:
sarif_file: results.sarif
2 changes: 1 addition & 1 deletion .github/workflows/snippets5000.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
egress-policy: audit

- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #@v4.1.7
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 #@v4.2.0

# Get the latest preview SDK (or sdk not installed by the runner)
- name: Setup .NET
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/whats-new.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
with:
egress-policy: audit

- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0

- name: "Print manual run reason"
if: ${{ github.event_name == 'workflow_dispatch' }}
Expand Down
4 changes: 4 additions & 0 deletions docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@
"docs/visual-basic/**/**.md": "vb"
},
"author": {
"_csharplang/**/*.md": "billwagner",
"_csharpstandard/**/*.md": "billwagner",
"_roslyn/docs/compilers/CSharp/*.md": "billwagner",
"_vblang/spec/*.md": "billwagner",
"docs/azure/**/*.*": "alexwolfmsft",
"docs/orleans/**/*.*": "IEvangelist",
"docs/architecture/**/**.md": "jamesmontemagno",
Expand Down
2 changes: 1 addition & 1 deletion docs/ai/conceptual/understanding-tokens.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ As training continues, the model adds any new tokens in the training text to its

The semantic relationships between the tokens can be analyzed by using these token ID sequences. Multi-valued numeric vectors, known as [embeddings](embeddings.md), are used to represent these relationships. An embedding is assigned to each token based on how commonly it's used together with, or in similar contexts to, the other tokens.

After it's trained, a model can calculate an embedding for text that contains multiple tokens. The model tokenizes the text, then calculates an overall embeddings value based on the learned embeddings of the individual tokens. This technique can be used for semantic document searches or adding [memories](/semantic-kernel/memories/) to an AI.
After it's trained, a model can calculate an embedding for text that contains multiple tokens. The model tokenizes the text, then calculates an overall embeddings value based on the learned embeddings of the individual tokens. This technique can be used for semantic document searches or adding [vector stores](/semantic-kernel/concepts/vector-store-connectors/) to an AI.

During output generation, the model predicts a vector value for the next token in the sequence. The model then selects the next token from it's vocabulary based on this vector value. In practice, the model calculates multiple vectors by using various elements of the previous tokens' embeddings. The model then evaluates all potential tokens from these vectors and selects the most probable one to continue the sequence.

Expand Down
10 changes: 5 additions & 5 deletions docs/ai/how-to/app-service-db-auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ zone_pivot_groups: azure-interface

This article demonstrates how to manage the connection between your App Service .NET application and a [vector database solution](../conceptual/vector-databases.md). It covers using Microsoft Entra managed identities for supported services and securely storing connection strings for others.

By adding a vector database to your application, you can enable [semantic memories](/semantic-kernel/memories/) for your AI. The [Semantic Kernel SDK](/semantic-kernel/overview) for .NET enables you to easily implement memory storage and recall using your preferred vector database solution.
By adding a vector database to your application, you can enable [semantic memories or *vector stores*]([vector stores](/semantic-kernel/concepts/vector-store-connectors/)) for your AI. The [Semantic Kernel SDK](/semantic-kernel/overview) for .NET enables you to easily implement memory storage and recall using your preferred vector database solution.

## Prerequisites

Expand All @@ -22,7 +22,7 @@ By adding a vector database to your application, you can enable [semantic memori
* [`Microsoft.SemanticKernel` NuGet package](https://www.nuget.org/packages/Microsoft.SemanticKernel)
* [`Microsoft.SemanticKernel.Plugins.Memory` NuGet package](https://www.nuget.org/packages/Microsoft.SemanticKernel.Plugins.Memory)
* [Create and deploy a .NET application to App Service](/azure/app-service/quickstart-dotnetcore)
* [Create and deploy a vector database solution](/semantic-kernel/memories/vector-db)
* [Create and deploy a vector database solution](/semantic-kernel/concepts/ai-services/integrations#vector-database-solutions)

## Use Microsoft Entra managed identity for authentication

Expand Down Expand Up @@ -190,7 +190,7 @@ Before following these steps, retrieve a connection string for your vector datab
> [!IMPORTANT]
> Before following these steps, ensure you have [created a Key Vault using the Azure CLI](/azure/key-vault/general/quick-create-cli).
1. Grant your user account permissions to your key vault through Role-Based Access Control (RBAC), assign a role using the Azure CLI command [`az role assignment create`](/cli/azure/role/assignment?view=azure-cli-latest#az-role-assignment-create):
1. Grant your user account permissions to your key vault through Role-Based Access Control (RBAC), assign a role using the Azure CLI command [`az role assignment create`](/cli/azure/role/assignment#az-role-assignment-create):

```azurecli
az role assignment create \
Expand All @@ -199,7 +199,7 @@ Before following these steps, retrieve a connection string for your vector datab
--scope "/subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.KeyVault/vaults/<keyVaultName>"
```

1. Add the connection string to Key Vault using the Azure CLI command [`az keyvault secret set`](/cli/azure/keyvault/secret?view=azure-cli-latest#az-keyvault-secret-set):
1. Add the connection string to Key Vault using the Azure CLI command [`az keyvault secret set`](/cli/azure/keyvault/secret#az-keyvault-secret-set):

```azurecli
az keyvault secret set \
Expand Down Expand Up @@ -271,7 +271,7 @@ Before following these steps, retrieve a connection string for your vector datab

:::zone target="docs" pivot="azure-cli"

Add or edit an app setting with the Azure CLI command [`az webapp config connection-string set`](/cli/azure/webapp/config/connection-string?view=azure-cli-latest#az-webapp-config-connection-string-set):
Add or edit an app setting with the Azure CLI command [`az webapp config connection-string set`](/cli/azure/webapp/config/connection-string#az-webapp-config-connection-string-set):

```azurecli
az webapp config connection-string set \
Expand Down
2 changes: 1 addition & 1 deletion docs/ai/how-to/use-redis-for-memory.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ms.date: 04/17/2024

This article demonstrates how to integrate a Redis database with the RediSearch module into the [Semantic Kernel SDK](/semantic-kernel/overview) and use it for memory storage and retrieval.

[Memories](/semantic-kernel/memories/) represent text information that has been stored alongside a precomputed embedding vector for the whole text. When an LLM is prompted to recall a memory, it uses these precomputed embeddings to efficiently evaluate whether a memory is relevant to the prompt. After the LLM finds a matching memory, it uses the memory's text information as context for the next steps in the prompt completion.
[Vector stores](/semantic-kernel/concepts/vector-store-connectors/) represent text information that has been stored alongside a precomputed embedding vector for the whole text. When an LLM is prompted to recall a memory, it uses these precomputed embeddings to efficiently evaluate whether a memory is relevant to the prompt. After the LLM finds a matching memory, it uses the memory's text information as context for the next steps in the prompt completion.

Memory storage that's added to the Semantic Kernel SDK provides a broader context for your requests. It also enables you to store data in the same manner as you store a traditional database, but query it by using natural language.

Expand Down
20 changes: 10 additions & 10 deletions docs/ai/semantic-kernel-dotnet-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ In this article, you explore [Semantic Kernel](/semantic-kernel/overview) core c
- How to add semantic kernel to your project
- Semantic Kernel core concepts

The sections ahead serve as an introductory overview of Semantic Kernel specifically in the context of .NET. For more comprehensive information and training about Semantic Kernel, see the following resources:
This article serves as an introductory overview of Semantic Kernel specifically in the context of .NET. For more comprehensive information and training about Semantic Kernel, see the following resources:

- [Semantic Kernel documentation](/semantic-kernel/overview)
- [Semantic Kernel training](/training/paths/develop-ai-agents-azure-open-ai-semantic-kernel-sdk/)
Expand Down Expand Up @@ -115,7 +115,7 @@ string skPrompt = @"Summarize the provided unstructured text in a sentence that

// Register the function
kernel.CreateSemanticFunction(
promptTemplate: skPrompt,
promptTemplate: skPrompt,
functionName: "SummarizeText",
pluginName: "SemanticFunctions"
);
Expand All @@ -132,9 +132,9 @@ The following code snippet defines and registers a native function:
public class NativeFunctions {

[SKFunction, Description("Retrieve content from local file")]
public async Task<string> RetrieveLocalFile(string fileName, int maxSize = 5000)
public async Task<string> RetrieveLocalFile(string fileName, int maxSize = 5000)
{
string content = await File.ReadAllTextAsync(fileName);
string content = await File.ReadAllTextAsync(fileName);
if (content.Length <= maxSize) return content;
return content.Substring(0, maxSize);
}
Expand All @@ -159,7 +159,7 @@ Consider the following pseudo-code snippet:
// Configure and create the plan
string planDefinition = "Read content from a local file and summarize the content.";
SequentialPlanner sequentialPlanner = new SequentialPlanner(kernel);
SequentialPlanner sequentialPlanner = new SequentialPlanner(kernel);

string assetsFolder = @"../../assets";
string fileName = Path.Combine(assetsFolder,"docs","06_SemanticKernel", "aci_documentation.txt");
Expand All @@ -178,21 +178,21 @@ The preceding code creates an executable, sequential plan to read content from a

### Memory

Semantic Kernel's [Memory](/semantic-kernel/memories) provides abstractions over embedding models, vector databases, and other data to simplify context management for AI applications. Memory is agnostic to the underlying LLM or Vector DB, offering a uniform developer experience. You can configure memory features to store data in a variety of sources or service, including Azure AI Search, Azure Cache for Redis, and more.
Semantic Kernel's [Vector stores](/semantic-kernel/concepts/vector-store-connectors/) provide abstractions over embedding models, vector databases, and other data to simplify context management for AI applications. Vector stores are agnostic to the underlying LLM or Vector database, offering a uniform developer experience. You can configure memory features to store data in a variety of sources or service, including Azure AI Search and Azure Cache for Redis.

Consider the following code snippet:

```csharp
var facts = new Dictionary<string,string>();
facts.Add(
"Azure Machine Learning; https://docs.microsoft.com/en-us/azure/machine-learning/",
@"Azure Machine Learning is a cloud service for accelerating and
managing the machine learning project lifecycle. Machine learning professionals,
"Azure Machine Learning; https://learn.microsoft.com/en-us/azure/machine-learning/",
@"Azure Machine Learning is a cloud service for accelerating and
managing the machine learning project lifecycle. Machine learning professionals,
data scientists, and engineers can use it in their day-to-day workflows"
);

facts.Add(
"Azure SQL Service; https://docs.microsoft.com/en-us/azure/azure-sql/",
"Azure SQL Service; https://learn.microsoft.com/en-us/azure/azure-sql/",
@"Azure SQL is a family of managed, secure, and intelligent products
that use the SQL Server database engine in the Azure cloud."
);
Expand Down
2 changes: 1 addition & 1 deletion docs/ai/tutorials/snippets/llm-eval/llm-eval.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />
<PackageReference Include="Microsoft.SemanticKernel" Version="1.20.0" />
<PackageReference Include="Microsoft.SemanticKernel" Version="1.21.1" />
</ItemGroup>

</Project>
Loading

0 comments on commit 310dde8

Please sign in to comment.