org.llm4s.media
Members list
Type members
Classlikes
A MediaType statically known to be audio, so audio APIs can require one.
A MediaType statically known to be a document a model can read, so document APIs can require one. PDF is an application type; the others are text.
A MediaType statically known to be a document a model can read, so document APIs can require one. PDF is an application type; the others are text.
Attributes
- Source
- MediaType.scala
- Supertypes
-
trait MediaTypetrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
- Known subtypes
A MediaType statically known to be an image, so image APIs can require one.
A MediaType statically known to be an image, so image APIs can require one.
Attributes
- Source
- MediaType.scala
- Supertypes
-
trait MediaTypetrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
- Known subtypes
The broad kind of a media type - the part of a MIME type before the slash.
The broad kind of a media type - the part of a MIME type before the slash.
This is the discriminator multimodal code branches on: extraction decides whether to decode a file as pixels, samples or text; a provider decides whether it can accept the payload at all. Modelling it as a type rather than as mimeType.startsWith("image/") keeps that decision exhaustive and testable.
Attributes
- Companion
- object
- Source
- MediaCategory.scala
- Supertypes
- Known subtypes
Attributes
- Companion
- trait
- Source
- MediaCategory.scala
- Supertypes
- Self type
-
MediaCategory.type
Where the bytes of a piece of media are: at a URL the consumer fetches, inline, or in a file already uploaded to a provider.
Where the bytes of a piece of media are: at a URL the consumer fetches, inline, or in a file already uploaded to a provider.
Pure data, like the rest of llm4s-media: nothing here fetches, reads or checks anything. llm4s-core's ContentPart builds parts from a source and checks it there (an inline source's size, a URL's scheme), because a check returns core's Result.
Attributes
- Companion
- object
- Source
- MediaSource.scala
- Supertypes
- Known subtypes
Attributes
- Companion
- trait
- Source
- MediaSource.scala
- Supertypes
- Self type
-
MediaSource.type
A media type: its MIME string, its canonical file extension, and its MediaCategory.
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
- Source
- MediaType.scala
- Supertypes
- Known subtypes
