ChatClientBuilder.Use 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.
Overloads
Use(IChatClient) |
Completes the pipeline by adding a final IChatClient that represents the underlying backend. This is typically a client for an LLM service. |
Use(Func<IChatClient,IChatClient>) |
Adds a factory for an intermediate chat client to the chat client pipeline. |
Use(Func<IServiceProvider,IChatClient,IChatClient>) |
Adds a factory for an intermediate chat client to the chat client pipeline. |
Use(IChatClient)
Completes the pipeline by adding a final IChatClient that represents the underlying backend. This is typically a client for an LLM service.
public:
Microsoft::Extensions::AI::IChatClient ^ Use(Microsoft::Extensions::AI::IChatClient ^ innerClient);
public Microsoft.Extensions.AI.IChatClient Use (Microsoft.Extensions.AI.IChatClient innerClient);
member this.Use : Microsoft.Extensions.AI.IChatClient -> Microsoft.Extensions.AI.IChatClient
Public Function Use (innerClient As IChatClient) As IChatClient
Parameters
- innerClient
- IChatClient
The inner client to use.
Returns
An instance of IChatClient that represents the entire pipeline. Calls to this instance will pass through each of the pipeline stages in turn.
Applies to
Use(Func<IChatClient,IChatClient>)
Adds a factory for an intermediate chat client to the chat client pipeline.
public:
Microsoft::Extensions::AI::ChatClientBuilder ^ Use(Func<Microsoft::Extensions::AI::IChatClient ^, Microsoft::Extensions::AI::IChatClient ^> ^ clientFactory);
public Microsoft.Extensions.AI.ChatClientBuilder Use (Func<Microsoft.Extensions.AI.IChatClient,Microsoft.Extensions.AI.IChatClient> clientFactory);
member this.Use : Func<Microsoft.Extensions.AI.IChatClient, Microsoft.Extensions.AI.IChatClient> -> Microsoft.Extensions.AI.ChatClientBuilder
Public Function Use (clientFactory As Func(Of IChatClient, IChatClient)) As ChatClientBuilder
Parameters
- clientFactory
- Func<IChatClient,IChatClient>
The client factory function.
Returns
The updated ChatClientBuilder instance.
Applies to
Use(Func<IServiceProvider,IChatClient,IChatClient>)
Adds a factory for an intermediate chat client to the chat client pipeline.
public:
Microsoft::Extensions::AI::ChatClientBuilder ^ Use(Func<IServiceProvider ^, Microsoft::Extensions::AI::IChatClient ^, Microsoft::Extensions::AI::IChatClient ^> ^ clientFactory);
public Microsoft.Extensions.AI.ChatClientBuilder Use (Func<IServiceProvider,Microsoft.Extensions.AI.IChatClient,Microsoft.Extensions.AI.IChatClient> clientFactory);
member this.Use : Func<IServiceProvider, Microsoft.Extensions.AI.IChatClient, Microsoft.Extensions.AI.IChatClient> -> Microsoft.Extensions.AI.ChatClientBuilder
Public Function Use (clientFactory As Func(Of IServiceProvider, IChatClient, IChatClient)) As ChatClientBuilder
Parameters
- clientFactory
- Func<IServiceProvider,IChatClient,IChatClient>
The client factory function.
Returns
The updated ChatClientBuilder instance.
Applies to
.NET