Package com.embabel.agent.api.common
Class AgentImage
-
- All Implemented Interfaces:
public final class AgentImageRepresents an image for Agent API operations. Provides convenient constructors for common image sources.
-
-
Constructor Summary
Constructors Constructor Description AgentImage(String mimeType, ByteArray data)
-
Method Summary
Modifier and Type Method Description final StringgetMimeType()final ByteArraygetData()Booleanequals(Object other)IntegerhashCode()final static AgentImagefromFile(File file)Create an AgentImage from a file, auto-detecting MIME type final static AgentImagefromPath(Path path)Create an AgentImage from a Path, auto-detecting MIME type final static AgentImagecreate(String mimeType, ByteArray data)Create an AgentImage with explicit MIME type and data final static AgentImagefromBytes(String filename, ByteArray data)Create an AgentImage from raw bytes, auto-detecting MIME type based on file extension -
-
Method Detail
-
getMimeType
final String getMimeType()
-
fromFile
final static AgentImage fromFile(File file)
Create an AgentImage from a file, auto-detecting MIME type
-
fromPath
final static AgentImage fromPath(Path path)
Create an AgentImage from a Path, auto-detecting MIME type
-
create
final static AgentImage create(String mimeType, ByteArray data)
Create an AgentImage with explicit MIME type and data
-
fromBytes
final static AgentImage fromBytes(String filename, ByteArray data)
Create an AgentImage from raw bytes, auto-detecting MIME type based on file extension
-
-
-
-