Files
semantic-kernel/dotnet/samples/KernelSyntaxExamples
Stephen ToubandShawn Callegari e7ba201b16 Downgrade several 7.0.* packages to 6.0.* (#1799)
This pains me, as it's a technical step backwards. But there are two
problems today:
1) The .NET support policy today unfortunately applies not only to the
.NET SDK and runtime but also to nuget packages released in the same
wave, which means that if someone is relying on eg System.Text.Json and
is running on .NET 6, having SK depend on System.Text.Json with a
minimum version of 7.0 forces the consumer to also use the 7.0 version
of System.Text.Json from the nuget, which then means that one assembly
falls under the STS support policy instead of LTS support policy, which
means that one assembly will have support end for it a few months
earlier than it otherwise would. I've raised this issue for further
evaluation on the .NET side of things, but in the meantime, this lowers
the version number to remove the perceived problem and possible barrier
to adoption.
2) Azure Functions has two deployment models: in-process and isolated.
Ideally functions use isolated, which gives them the freedom to
reference whatever they need. The in-process model is exactly what it
sounds like: the function runs in the same process as the host, and the
host pins several dependencies at 6.0 versions. That means that if a
function references a 7.0 version, it'll fail to load in the in-process
model. While we'd like for folks to be using the isolated model, we
can't force it, and we don't want a need for the in-process model to
block SK usage.

This commit downgrades back to the 6.0 versions, at least where
possible. Some of the connectors reference libraries (e.g. NRedisStack,
pgvector, etc.) that themselves have a 7.0 dependency.

Closes https://github.com/microsoft/semantic-kernel/issues/1793

---------

Co-authored-by: Shawn Callegari <[email protected]>
2023-07-04 05:21:13 +00:00
..

Semantic Kernel syntax examples

This project contains a collection of semi-random examples about various scenarios using SK components.

The examples are ordered by number, starting with very basic examples.

Most of the examples will require secrets and credentials, to access OpenAI, Azure OpenAI, Bing 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.

To set your secrets with Secret Manager:

cd dotnet/samples/KernelSyntaxExamples

dotnet user-secrets set "BING_API_KEY" "..."
dotnet user-secrets set "OPENAI_API_KEY" "..."
dotnet user-secrets set "AZURE_OPENAI_SERVICE_ID" "..."
dotnet user-secrets set "AZURE_OPENAI_DEPLOYMENT_NAME" "..."
dotnet user-secrets set "AZURE_OPENAI_CHAT_DEPLOYMENT_NAME" "..."
dotnet user-secrets set "AZURE_OPENAI_ENDPOINT" "https://... .openai.azure.com/"
dotnet user-secrets set "AZURE_OPENAI_KEY" "..."
dotnet user-secrets set "AZURE_OPENAI_EMBEDDINGS_DEPLOYMENT_NAME" "..."
dotnet user-secrets set "AZURE_OPENAI_EMBEDDINGS_ENDPOINT" "https://... .openai.azure.com/"
dotnet user-secrets set "AZURE_OPENAI_EMBEDDINGS_KEY" "..."
dotnet user-secrets set "ACS_ENDPOINT" "https://... .search.windows.net"
dotnet user-secrets set "ACS_API_KEY" "..."
dotnet user-secrets set "QDRANT_ENDPOINT" "..."
dotnet user-secrets set "QDRANT_PORT" "..."
dotnet user-secrets set "WEAVIATE_SCHEME" "..."
dotnet user-secrets set "WEAVIATE_ENDPOINT" "..."
dotnet user-secrets set "WEAVIATE_PORT" "..."
dotnet user-secrets set "WEAVIATE_APIKEY" "..."
dotnet user-secrets set "GITHUB_PERSONAL_ACCESS_TOKEN" "github_pat_..."
dotnet user-secrets set "POSTGRES_CONNECTIONSTRING" "..."
dotnet user-secrets set "REDIS_CONFIGURATION" "..."

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

  • BING_API_KEY
  • OPENAI_API_KEY
  • AZURE_OPENAI_SERVICE_ID
  • AZURE_OPENAI_DEPLOYMENT_NAME
  • AZURE_OPENAI_ENDPOINT
  • AZURE_OPENAI_KEY
  • ACS_ENDPOINT
  • ACS_API_KEY
  • QDRANT_ENDPOINT
  • QDRANT_PORT
  • WEAVIATE_SCHEME
  • WEAVIATE_ENDPOINT
  • WEAVIATE_PORT
  • WEAVIATE_APIKEY
  • GITHUB_PERSONAL_ACCESS_TOKEN
  • POSTGRES_CONNECTIONSTRING
  • REDIS_CONFIGURATION
  • AZURE_OPENAI_EMBEDDINGS_DEPLOYMENT_NAME
  • AZURE_OPENAI_EMBEDDINGS_ENDPOINT
  • AZURE_OPENAI_EMBEDDINGS_KEY