ImageGeneratingChatClientBuilderExtensions.UseImageGeneration 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.
Adds image generation capabilities to the chat client pipeline.
public static Microsoft.Extensions.AI.ChatClientBuilder UseImageGeneration(this Microsoft.Extensions.AI.ChatClientBuilder builder, Microsoft.Extensions.AI.IImageGenerator? imageGenerator = default, Action<Microsoft.Extensions.AI.ImageGeneratingChatClient>? configure = default);
static member UseImageGeneration : Microsoft.Extensions.AI.ChatClientBuilder * Microsoft.Extensions.AI.IImageGenerator * Action<Microsoft.Extensions.AI.ImageGeneratingChatClient> -> Microsoft.Extensions.AI.ChatClientBuilder
<Extension()>
Public Function UseImageGeneration (builder As ChatClientBuilder, Optional imageGenerator As IImageGenerator = Nothing, Optional configure As Action(Of ImageGeneratingChatClient) = Nothing) As ChatClientBuilder
Parameters
- builder
- ChatClientBuilder
The ChatClientBuilder.
- imageGenerator
- IImageGenerator
An optional IImageGenerator used for image generation operations. If not supplied, a required instance will be resolved from the service provider.
- configure
- Action<ImageGeneratingChatClient>
An optional callback that can be used to configure the ImageGeneratingChatClient instance.
Returns
The builder.
Exceptions
builder is null.
Remarks
This method enables the chat client to handle HostedImageGenerationTool instances by converting them into function tools that can be invoked by the underlying chat model to perform image generation and editing operations.