Saltar para o conteúdo principal
Versão: 20 R9 BETA

OpenAIMessage

The OpenAIMessage class represents a structured message containing a role, content, and an optional user. This class provides methods to manipulate and retrieve the text and other content of the message.

Propriedades

PropriedadeTipoDescrição
roleTextThe role of the message (e.g., "user", "assistant").
conteúdoDiferente deThe content of the message, which can be a text or a collection of objects.
userTextAn optional property representing the user associated with the message.

Propriedades calculadas

PropriedadeTipoDescrição
textTextUma propriedade que representa a mensagem de texto.

Funções

addImageURL()

addImageURL(imageURL : Text; detail : Text)

ParâmetroTipoDescrição
imageURLTextThe URL of the image to add to the message.
detailTextDetalhes adicionais sobre a imagem.

Adds an image URL to the content of the message.

Exemplo de uso

// Create an instance of OpenAIMessage
var $message:=OpenAIMessage({role: "user"; content: "Hello!"})

// Add an image URL with details
$message.addImageURL("http://example.com/image.jpg"; "high")