Aller au contenu principal
Version: 20 R9 BETA

OpenAIMessage

La classe OpenAIMessage représente un message structuré contenant un rôle, un contenu et un utilisateur optionnel. Cette classe fournit des méthodes pour manipuler et récupérer le texte et d'autres contenus du message.

Propriétés

PropriétéTypeDescription
rôleTextThe role of the message (e.g., "user", "assistant").
contenuVariantThe content of the message, which can be a text or a collection of objects.
userTextAn optional property representing the user associated with the message.

Propriétés calculées

PropriétéTypeDescription
textTextA property representing the text message.

Fonctions

addImageURL()

addImageURL(imageURL : Text; detail : Text)

ParamètresTypeDescription
imageURLTextThe URL of the image to add to the message.
detailTextAdditional details about the image.

Adds an image URL to the content of the message.

Exemple d'utilisation

// 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")