Share via


ImageGenTool Class

Definition

A tool that generates images using a model like gpt-image-1.

public class ImageGenTool : Azure.AI.AgentServer.Contracts.Generated.OpenAI.Tool, System.ClientModel.Primitives.IJsonModel<Azure.AI.AgentServer.Contracts.Generated.OpenAI.ImageGenTool>, System.ClientModel.Primitives.IPersistableModel<Azure.AI.AgentServer.Contracts.Generated.OpenAI.ImageGenTool>
type ImageGenTool = class
    inherit Tool
    interface IUtf8JsonSerializable
    interface IJsonModel<ImageGenTool>
    interface IPersistableModel<ImageGenTool>
Public Class ImageGenTool
Inherits Tool
Implements IJsonModel(Of ImageGenTool), IPersistableModel(Of ImageGenTool)
Inheritance
ImageGenTool
Implements

Constructors

Name Description
ImageGenTool()

Initializes a new instance of ImageGenTool.

ImageGenTool(ToolType, IDictionary<String,BinaryData>, Nullable<ImageGenToolModel>, Nullable<ImageGenToolQuality>, Nullable<ImageGenToolSize>, Nullable<ImageGenToolOutputFormat>, Nullable<Int32>, Nullable<ImageGenToolModeration>, Nullable<ImageGenToolBackground>, ImageGenToolInputImageMask, Nullable<Int32>)

Initializes a new instance of ImageGenTool.

Properties

Name Description
Background

Background type for the generated image. One of transparent, opaque, or auto. Default: auto.

InputImageMask

Optional mask for inpainting. Contains image_url (string, optional) and file_id (string, optional).

Model

The image generation model to use. Default: gpt-image-1.

Moderation

Moderation level for the generated image. Default: auto.

OutputCompression

Compression level for the output image. Default: 100.

OutputFormat

The output format of the generated image. One of png, webp, or jpeg. Default: png.

PartialImages

Number of partial images to generate in streaming mode, from 0 (default value) to 3.

Quality

The quality of the generated image. One of low, medium, high, or auto. Default: auto.

Size

The size of the generated image. One of 1024x1024, 1024x1536, 1536x1024, or auto. Default: auto.

Type

Gets or sets the type.

(Inherited from Tool)

Methods

Name Description
DeserializeImageGenTool(JsonElement, ModelReaderWriterOptions)
FromResponse(Response)

Deserializes the model from a raw response.

JsonModelWriteCore(Utf8JsonWriter, ModelReaderWriterOptions)
ToRequestContent()

Convert into a RequestContent.

Explicit Interface Implementations

Name Description
IJsonModel<ImageGenTool>.Create(Utf8JsonReader, ModelReaderWriterOptions)

Reads one JSON value (including objects or arrays) from the provided reader and converts it to a model.

IJsonModel<ImageGenTool>.Write(Utf8JsonWriter, ModelReaderWriterOptions)

Writes the model to the provided Utf8JsonWriter.

IJsonModel<Tool>.Create(Utf8JsonReader, ModelReaderWriterOptions)

Reads one JSON value (including objects or arrays) from the provided reader and converts it to a model.

(Inherited from Tool)
IJsonModel<Tool>.Write(Utf8JsonWriter, ModelReaderWriterOptions)

Writes the model to the provided Utf8JsonWriter.

(Inherited from Tool)
IPersistableModel<ImageGenTool>.Create(BinaryData, ModelReaderWriterOptions)

Converts the provided BinaryData into a model.

IPersistableModel<ImageGenTool>.GetFormatFromOptions(ModelReaderWriterOptions)

Gets the data interchange format (JSON, Xml, etc) that the model uses when communicating with the service.

IPersistableModel<ImageGenTool>.Write(ModelReaderWriterOptions)

Writes the model into a BinaryData.

IPersistableModel<Tool>.Create(BinaryData, ModelReaderWriterOptions)

Converts the provided BinaryData into a model.

(Inherited from Tool)
IPersistableModel<Tool>.GetFormatFromOptions(ModelReaderWriterOptions)

Gets the data interchange format (JSON, Xml, etc) that the model uses when communicating with the service.

(Inherited from Tool)
IPersistableModel<Tool>.Write(ModelReaderWriterOptions)

Writes the model into a BinaryData.

(Inherited from Tool)
IUtf8JsonSerializable.Write(Utf8JsonWriter)

Applies to