We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3d6084b commit a2d94c2Copy full SHA for a2d94c2
README.md
@@ -23,28 +23,16 @@ dotnet user-secrets set "dashscope:apiKey" "sk-xxx"
23
## Usage
24
Program.cs
25
```cs
26
-using Microsoft.Extensions.Configuration;
27
-using Microsoft.Extensions.DependencyInjection;
28
using Microsoft.SemanticKernel;
29
30
var builder = Kernel.CreateBuilder();
31
-builder.Services.AddSingleton(GetConfiguration());
32
-builder.AddDashScopeChatCompletion();
+builder.AddDashScopeChatCompletion<Program>();
33
var kernel = builder.Build();
34
35
var prompt = @"<message role=""user"">Tell me about the Cnblogs</message>";
36
var result = await kernel.InvokePromptAsync(prompt);
37
Console.WriteLine(result);
38
39
-static IConfiguration GetConfiguration()
40
-{
41
- return new ConfigurationBuilder()
42
- .SetBasePath(Directory.GetCurrentDirectory())
43
- .AddJsonFile("appsettings.json")
44
- .AddUserSecrets<Program>()
45
- .Build();
46
-}
47
-
48
public partial class Program
49
{ }
50
```
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments