Class MotorContentPartImage

java.lang.Object
com.chatmotorapi.api.vision.MotorContentPartImage
All Implemented Interfaces:
MotorMessage

public class MotorContentPartImage
extends Object
implements MotorMessage
Represents an image content part within the ChatMotor messaging framework, specifically designed for use with OpenAI's vision API. This class implements the MotorMessage interface and encapsulates a single image URL as its content, allowing it to integrate seamlessly with image processing workflows. Each instance of MotorContentPartImage must be initialized with a non-null URL pointing to an image. This design ensures that every image message contains a valid and accessible image source, facilitating reliable usage in AI-driven image analysis contexts. The primary role of this class is to standardize the handling of image data within messaging and content delivery systems. It is especially useful in scenarios where images are analyzed or manipulated separately from other content types, such as text or video, making it an integral component of systems that leverage computer vision technologies. Example usage:
 MotorContentPartImage imagePart = new MotorContentPartImage("http://example.com/image.jpg");
 
This example demonstrates how to instantiate a MotorContentPartImage with a URL, which is then accessible through the getContent() method. This method ensures uniform access to the image URL, aligning with the standardized message handling practices of the MotorMessage interface.
  • Constructor Details

    • MotorContentPartImage

      public MotorContentPartImage​(String imageUrl)
      Constructor.
      Parameters:
      imageUrl - the image url of the content part.
  • Method Details

    • getContent

      public String getContent()
      Description copied from interface: MotorMessage
      Retrieves the system prompt text or user prompt text held by this message.
      Specified by:
      getContent in interface MotorMessage
      Returns:
      The system prompt text or user prompt text held by this message.