Saltar para o conteúdo principal
Versão: 21 R3 BETA

OpenAIImagesResult

Inherits

Propriedades calculadas

PropriedadeTipoDescrição
imagesColeção de OpenAIImageReturns a collection of OpenAIImage objects.
imagemOpenAIImageReturns the first OpenAIImage from the collection.
utilizaçãoObjectReturns token usage information (inherited from OpenAIResult).

utilização

The usage property returns an object containing token usage information for image generation (when supported by the provider).

CampoTipoDescrição
total_tokensIntegerTotal tokens used.
input_tokensIntegerNumber of tokens in the input (prompt).
output_tokensIntegerNumber of tokens for the output (image).
input_tokens_detailsObjectBreakdown of input tokens (optional).

input_tokens_details

CampoTipoDescrição
text_tokensIntegerNumber of text tokens in the prompt.
image_tokensIntegerNumber of image tokens (for image editing/variations).

Example response:

{
"total_tokens": 100,
"input_tokens": 50,
"output_tokens": 50,
"input_tokens_details": {
"text_tokens": 10,
"image_tokens": 40
}
}

Note: Image generation usage may not be available from all providers. The structure may vary depending on the specific image API endpoint used.

Funções

saveImagesToDisk()

saveImagesToDisk(folder : 4D.Folder; prefix : Text): Boolean

ParâmetroTipoDescrição
folder4D. FolderThe folder where images will be saved.
prefixTextThe prefix for the saved image file names.
ResultadoParâmetrosReturns True if the images are successfully saved.

Saves images to the specified disk folder.

Veja também