Files
semantic-kernel/samples/dotnet/KernelHttpServer
Devis Lucato 2607c14b0d Add C# simple planner (#598)
### Motivation and Context

Need for a simple planner showing how to leverage semantic functions to
implement Intent Detection pattern and turn it into a planner, selecting
a function given a goal.

The planner also allows to provide a Planning capability using less
powerful models, like GPT3 (text-davinci-002) and GPT3.5
(text-davinci-003, GPT turbo 3.5), where often the more advanced planner
can hallucinate.

Fix one bug in "WriterSkill/ShortPoem/skprompt.txt" leading to incorrect
results when the goal was missing a termination (period or new line)

### Description

* New package `Microsoft.SemanticKernel.Planning.ActionPlanner`extending
the Planning namespace. The package is automatically installed, ie it's
part of SK metapackage.
* Move SequentialPlanner into the new package
`Microsoft.SemanticKernel.Planning.SequentialPlanner` lib, part of the
metapackage
* Add new Action Planner.
* Store planner prompts to skprompt.txt, using embedded resources to
avoid files overwriting each other.
2023-04-26 20:39:41 +00:00
..
2023-04-26 20:39:41 +00:00

Semantic Kernel Service API (For Learning Samples)

Watch the Service API Quick Start Video.

This service API is written in C# against Azure Function Runtime v4 and exposes some Semantic Kernel APIs that you can call via HTTP POST requests for the learning samples.

azure-function-diagram

!IMPORTANT

This service API is for educational purposes only and should not be used in any production use case. It is intended to highlight concepts of Semantic Kernel and not any architectural security design practices to be used.

Prerequisites

Azure Functions Core Tools installation is required for this service API to run locally.

Running the service API locally

Run func start --csharp from the command line. This will run the service API locally at http://localhost:7071.

Two endpoints will be exposed by the service API:

  • InvokeFunction: [POST] http://localhost:7071/api/skills/{skillName}/invoke/{functionName}
  • Ping: [GET] http://localhost:7071/api/ping

Working with Secrets

We need keys to work with various aspects of the project including accessing openAI models. This opens up the possibility of exposing keys in commits. There are a couple of options to safeguard developers from exposing keys. Outside of using the dotnet's users-secrets and environment variables, we've also added *.development.config to the .gitignore if developers want to use config files for secret storage.

Next steps

Now that your service API is running locally, let's try it out in a sample app so you can learn core Semantic Kernel concepts!
The service API will need to be run or running for each sample app you want to try.

Sample app learning examples:

  • Simple chat summary (Recommended) – learn how basic semantic functions can be added to an app
  • Book creator – learn how Planner and chaining of semantic functions can be used in your app
  • Authentication and APIs – learn how to connect to external API's with authentication while using Semantic Kernel
  • GitHub Repo Q&A (coming soon) – learn how Memories and Embeddings can be used in your app