AIIntegration.CreateGenerateImageDescriptionExtension(IAIExtensionsContainer, String) Method
Creates a new instance of the GenerateImageDescriptionExtension
class.
Namespace: DevExpress.AIIntegration
Assembly: DevExpress.AIIntegration.v24.2.dll
Declaration
public static IAIExtension<GenerateImageDescriptionRequest, ImageTextResponse> CreateGenerateImageDescriptionExtension(
this IAIExtensionsContainer container,
string name = null
)
Parameters
Name | Type | Description |
---|---|---|
container | IAIExtensionsContainer | A container that manages registered AI clients. |
Optional Parameters
Name | Type | Default | Description |
---|---|---|---|
name | String | null | The name of the extension. |
Returns
Type | Description |
---|---|
DevExpress.AIIntegration.IAIExtension<GenerateImageDescriptionRequest, ImageTextResponse> | A new instance of the |
Remarks
string imageBase64 = "iVBORw0KGgoAAAANSUhEUgAABhgAAAF+CAMAAABHxuB6AAAABGdBTUEAALGPC...";
IAIExtension<GenerateImageDescriptionRequest, ImageTextResponse> extension = AIIntegration.CreateGenerateImageDescriptionExtension(defaultAIExtensionsContainer);
await ExecuteAIExtension(extension, new GenerateImageDescriptionRequest(imageBase64));
async Task ExecuteAIExtension<TRequest>(IAIExtension<TRequest, ImageTextResponse> extension, TRequest request) {
var result = await extension.ExecuteAsync(request, CancellationToken.None);
Console.WriteLine(result);
}
See Also