From 5d266f6198705b261f05a36a84a724d44b68155a Mon Sep 17 00:00:00 2001 From: Admir Durmishi Date: Sun, 26 May 2024 15:26:47 +0200 Subject: [PATCH] Update README.md --- README.md | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index de01707..875aa4a 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,13 @@ Now, let's create an instance of the AIConversationManager class in your test or This manager orchestrates the conversation between users and the AI system. ```bash -// Instantiate AIConversationManager with necessary dependencies +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Logging; +using Microsoft.SemanticKernel; +using OpenAIExtensions.Managers; +using OpenAIExtensions; +using Microsoft.SemanticKernel.ChatCompletion; + var configuration = new ConfigurationBuilder() .AddJsonFile($"appsettings.json") .Build(); @@ -33,8 +39,8 @@ var logger = LoggerFactory var endpoint = configuration.GetValue("OpenAI:Endpoint")!; var key = configuration.GetValue("OpenAI:Key")!; -var kernel = SematicKernelBuilder.Create() - .AddAIChatCompletion(endpoint: endpoint, apiKey: key) +var kernel = Kernel.CreateBuilder() + .AddAzureAIChatCompletion(endpoint: endpoint, apiKey: key) .AddPlugin() .Build(); @@ -52,6 +58,13 @@ var systemMessage = @" var response = await aiConversationManager.ProcessConversationAsync(history, systemMessage); -response => The weather in Skopje today is partly cloudy with a high of 15°C. +var systemMessage = @" + You are an AI bot that only knows how to answer questions about weather. + Always respond with text. +"; -``` \ No newline at end of file +var response = await aiConversationManager.ProcessConversationAsync(history, systemMessage); + +response => The weather in Skopje today is partly cloudy with a high of 15°C. + +```