Class ImageContent
java.lang.Object
dev.langchain4j.data.message.ImageContent
- All Implemented Interfaces:
Content
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe detail level of anImage. -
Constructor Summary
ConstructorsConstructorDescriptionImageContent(Image image) Create a newImageContentfrom the given image.ImageContent(Image image, ImageContent.DetailLevel detailLevel) Create a newImageContentfrom the given image.ImageContent(String url) Create a newImageContentfrom the given url.ImageContent(String url, ImageContent.DetailLevel detailLevel) Create a newImageContentfrom the given url and detail level.ImageContent(String base64Data, String mimeType) Create a newImageContentfrom the given base64 data and mime type.ImageContent(String base64Data, String mimeType, ImageContent.DetailLevel detailLevel) Create a newImageContentfrom the given base64 data and mime type.ImageContent(URI url) Create a newImageContentfrom the given url.ImageContent(URI url, ImageContent.DetailLevel detailLevel) Create a newImageContentfrom the given url and detail level. -
Method Summary
Modifier and TypeMethodDescriptionGet theDetailLevel.booleanstatic ImageContentCreate a newImageContentfrom the given image.static ImageContentfrom(Image image, ImageContent.DetailLevel detailLevel) Create a newImageContentfrom the given image.static ImageContentCreate a newImageContentfrom the given url.static ImageContentfrom(String url, ImageContent.DetailLevel detailLevel) Create a newImageContentfrom the given url and detail level.static ImageContentCreate a newImageContentfrom the given base64 data and mime type.static ImageContentfrom(String base64Data, String mimeType, ImageContent.DetailLevel detailLevel) Create a newImageContentfrom the given base64 data and mime type.static ImageContentCreate a newImageContentfrom the given url.static ImageContentfrom(URI url, ImageContent.DetailLevel detailLevel) Create a newImageContentfrom the given url and detail level.inthashCode()image()Get theImage.toString()type()Returns the type of content.
-
Constructor Details
-
ImageContent
Create a newImageContentfrom the given url.The image will be created with
DetailLevel.LOWdetail.- Parameters:
url- the url of the image.
-
ImageContent
Create a newImageContentfrom the given url.The image will be created with
DetailLevel.LOWdetail.- Parameters:
url- the url of the image.
-
ImageContent
Create a newImageContentfrom the given url and detail level.- Parameters:
url- the url of the image.detailLevel- the detail level of the image.
-
ImageContent
Create a newImageContentfrom the given url and detail level.- Parameters:
url- the url of the image.detailLevel- the detail level of the image.
-
ImageContent
Create a newImageContentfrom the given base64 data and mime type.The image will be created with
DetailLevel.LOWdetail.- Parameters:
base64Data- the base64 data of the image.mimeType- the mime type of the image.
-
ImageContent
Create a newImageContentfrom the given base64 data and mime type.- Parameters:
base64Data- the base64 data of the image.mimeType- the mime type of the image.detailLevel- the detail level of the image.
-
ImageContent
Create a newImageContentfrom the given image.The image will be created with
DetailLevel.LOWdetail.- Parameters:
image- the image.
-
ImageContent
Create a newImageContentfrom the given image.- Parameters:
image- the image.detailLevel- the detail level of the image.
-
-
Method Details
-
image
-
detailLevel
-
type
Description copied from interface:ContentReturns the type of content.Can be used to cast the content to the correct type.
-
equals
-
hashCode
-
toString
-
from
Create a newImageContentfrom the given url.The image will be created with
DetailLevel.LOWdetail.- Parameters:
url- the url of the image.- Returns:
- the new
ImageContent.
-
from
Create a newImageContentfrom the given url.The image will be created with
DetailLevel.LOWdetail.- Parameters:
url- the url of the image.- Returns:
- the new
ImageContent.
-
from
Create a newImageContentfrom the given url and detail level.- Parameters:
url- the url of the image.detailLevel- the detail level of the image.- Returns:
- the new
ImageContent.
-
from
Create a newImageContentfrom the given url and detail level.- Parameters:
url- the url of the image.detailLevel- the detail level of the image.- Returns:
- the new
ImageContent.
-
from
Create a newImageContentfrom the given base64 data and mime type.The image will be created with
DetailLevel.LOWdetail.- Parameters:
base64Data- the base64 data of the image.mimeType- the mime type of the image.- Returns:
- the new
ImageContent.
-
from
public static ImageContent from(String base64Data, String mimeType, ImageContent.DetailLevel detailLevel) Create a newImageContentfrom the given base64 data and mime type.- Parameters:
base64Data- the base64 data of the image.mimeType- the mime type of the image.detailLevel- the detail level of the image.- Returns:
- the new
ImageContent.
-
from
Create a newImageContentfrom the given image.The image will be created with
DetailLevel.LOWdetail.- Parameters:
image- the image.- Returns:
- the new
ImageContent.
-
from
Create a newImageContentfrom the given image.- Parameters:
image- the image.detailLevel- the detail level of the image.- Returns:
- the new
ImageContent.
-