image static method

Message image(
  1. String file
)

Static method to create a message with an image.

@param file The file path of the image. @return A Message object with the image.

Implementation

static Message image(String file) {
  return Message(
    role: Role.user,
    content: "",
    images: {
      "type": "image_url",
      "image_url": {
        "url": encodeImageToDataUrl(file),
      }, //  Call an async function
    },
  );
}