Module 3: Lab - Book Creator application
The Book creator sample application shows how SK uses planner
, skills
and memories
are to create a children’s book. The Planner
creates a plan for the skills (functions) that are pre-defined for generating a book topic and creating a book. The Writer
pre-defined skills are chained together based on the user ask to create the book.
Requirements:
- You will need an Open AI API Key or Azure Open AI service key to get started.
- Azure Functions Core Tools are required to run the kernel as a local web service, this service is used by the sample web app.
- .NET 6. If you have .NET 7 installed, Azure Function Tools will still require .NET 6, so we suggest installing both.
- Yarn is used for installing web apps’ dependencies.
Running the Book Creator sample app
Note: to run the sample in VS Code Desktop using Dev Containers from Github Codespaces: Click hamburger menu on the left side of the VS Code window in Codespaces and select Open in VS Code Desktop
-
Clone the
semantic kernel
repogit clone https://github.com/microsoft/semantic-kernel.git
-
Start the
KernelHttpServer
. This is the backend API server used by the front end React app and is the intermediary between the front end client application and AzureOpenAIcd semantic-kernel/samples/dotnet/KernelHttpServer
-
Run
func start --csharp
This will run the service API locally at
http://localhost:7071
.cd semantic-kernel/samples/dotnet/KernelHttpServer
-
In another terminal window, start the
BookCreator
web applicationcd semantic-kernel/samples/apps/book-creator-webapp-react/
-
Rename the
semantic-kernel/samples/apps/book-creator-webapp-react/.env.example
file tosemantic-kernel/samples/apps/book-creator-webapp-react/.env
. -
Start the book creator app by running the following commands
yarn install yarn start
-
A browser will automatically open, otherwise you can navigate to
http://localhost:3000
to access the application. -
On the application main page, enter your AzureOpenAI key and also a value for the model ID as shown below, you may use the default text-davinci-003 and click Save button
-
Follow the application prompts to enter a book idea and click get Ideas button to see some sample suggestions, screenshot should similar to below
-
Select an idea option and click on the create book button to see the newly created book. Note: you need to additionally click on the play button as shown below on the next screen to get the book contents.
The final result of the book