diff --git a/README.md b/README.md index 352b301..de82393 100644 --- a/README.md +++ b/README.md @@ -23,28 +23,16 @@ dotnet user-secrets set "dashscope:apiKey" "sk-xxx" ## Usage Program.cs ```cs -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; using Microsoft.SemanticKernel; var builder = Kernel.CreateBuilder(); -builder.Services.AddSingleton(GetConfiguration()); -builder.AddDashScopeChatCompletion(); +builder.AddDashScopeChatCompletion(); var kernel = builder.Build(); var prompt = @"Tell me about the Cnblogs"; var result = await kernel.InvokePromptAsync(prompt); Console.WriteLine(result); -static IConfiguration GetConfiguration() -{ - return new ConfigurationBuilder() - .SetBasePath(Directory.GetCurrentDirectory()) - .AddJsonFile("appsettings.json") - .AddUserSecrets() - .Build(); -} - public partial class Program { } ```