MediaType

org.llm4s.media.MediaType
See theMediaType companion object
sealed trait MediaType extends Product, Serializable

A media type: its MIME string, its canonical file extension, and its MediaCategory.

This is the shared vocabulary the multimodal modules speak. Before it existed, llm4s-core carried three overlapping enumerations of the same handful of image formats - imagegeneration.ImageFormat, imageprocessing.ImageFormat and imageprocessing.MediaType - which could not be passed to one another despite being structurally identical, and RAG's media extraction matched on raw MIME prefixes instead.

llm4s-media holds the vocabulary only: no I/O, no sniffing, no third-party dependencies. Deciding what a file actually is from its bytes needs Tika, which lives in llm4s-rag; that code produces a MIME string and resolves it here via MediaType.fromMimeType.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Known subtypes
object Flac
object Mp3
object Ogg
object Wav
object Bmp
object Gif
object Jpeg
object Png
object Tiff
object WebP
Show all

Members list

Value members

Abstract methods

The broad kind of media this is.

The broad kind of media this is.

Attributes

def extension: String

The canonical file extension, without a leading dot, e.g. "png".

The canonical file extension, without a leading dot, e.g. "png".

Attributes

def mimeType: String

The MIME type, e.g. "image/png".

The MIME type, e.g. "image/png".

Attributes

Inherited methods

def productElementName(n: Int): String

Attributes

Inherited from:
Product
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
def productPrefix: String

Attributes

Inherited from:
Product

Inherited and Abstract methods

def canEqual(that: Any): Boolean

Attributes

Inherited from:
Equals
def productArity: Int

Attributes

Inherited from:
Product
def productElement(n: Int): Any

Attributes

Inherited from:
Product