ChatCompletionServiceExtensions.AsChatCompletionService Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates an IChatCompletionService for the specified IChatClient.
public static Microsoft.SemanticKernel.ChatCompletion.IChatCompletionService AsChatCompletionService(this Microsoft.Extensions.AI.IChatClient client, IServiceProvider? serviceProvider = default);
static member AsChatCompletionService : Microsoft.Extensions.AI.IChatClient * IServiceProvider -> Microsoft.SemanticKernel.ChatCompletion.IChatCompletionService
<Extension()>
Public Function AsChatCompletionService (client As IChatClient, Optional serviceProvider As IServiceProvider = Nothing) As IChatCompletionService
Parameters
- client
- IChatClient
The chat client to be represented as a chat completion service.
- serviceProvider
- IServiceProvider
An optional IServiceProvider that can be used to resolve services to use in the instance.
Returns
The IChatCompletionService. If client is an IChatCompletionService, client will
be returned. Otherwise, a new IChatCompletionService will be created that wraps client.