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.
2 parents a2d94c2 + dcebeb7 commit 141c081Copy full SHA for 141c081
src/SemanticKernel.DashScope/DashScopeServiceCollectionExtensions.cs
@@ -49,4 +49,24 @@ public static IKernelBuilder AddDashScopeChatCompletion<T>(
49
}
50
return builder.AddDashScopeChatCompletion(serviceId, configureClient, configSectionPath);
51
52
+
53
+ public static IKernelBuilder AddDashScopeChatCompletion(
54
+ this IKernelBuilder builder,
55
+ string modelId,
56
+ string apiKey,
57
+ string? serviceId = null,
58
+ Action<HttpClient>? configureClient = null)
59
+ {
60
+ Func<IServiceProvider, object?, DashScopeChatCompletionService> factory = (serviceProvider, _) =>
61
62
+ var options = new DashScopeClientOptions { ModelId = modelId, ApiKey = apiKey };
63
+ var httpClient = serviceProvider.GetRequiredService<HttpClient>();
64
+ configureClient?.Invoke(httpClient);
65
+ return new DashScopeChatCompletionService(options, httpClient);
66
+ };
67
68
+ builder.Services.AddHttpClient();
69
+ builder.Services.AddKeyedSingleton<IChatCompletionService>(serviceId, factory);
70
+ return builder;
71
+ }
72
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments