ContentPart

org.llm4s.llmconnect.model.ContentPart
See theContentPart companion trait
object ContentPart

Attributes

Companion
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

final case class Document extends ContentPart

A document - a PDF, text, Markdown, HTML or CSV file; build one with ContentPart.document.

A document - a PDF, text, Markdown, HTML or CSV file; build one with ContentPart.document.

Attributes

Supertypes
trait ContentPart
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class Image extends ContentPart

An image; build one with ContentPart.image.

An image; build one with ContentPart.image.

Attributes

Supertypes
trait ContentPart
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class Text extends ContentPart

Text. A message whose every part is blank text is refused by Message.validate. A null text is read as empty when the part is built, so no code that reads a part - validation, a codec, a provider's encoder - has to guard against it.

Text. A message whose every part is blank text is refused by Message.validate. A null text is read as empty when the part is built, so no code that reads a part - validation, a codec, a provider's encoder - has to guard against it.

Attributes

Companion
object
Supertypes
trait ContentPart
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Text

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Text.type

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

A document from source, checked as described on ContentPart.

A document from source, checked as described on ContentPart.

Attributes

def image(source: MediaSource, mediaType: ImageMediaType): Result[Image]

An image from source, checked as described on ContentPart.

An image from source, checked as described on ContentPart.

Attributes

def inlineBytes(parts: Seq[ContentPart]): Long

The number of inline bytes parts carry, in total.

The number of inline bytes parts carry, in total.

Attributes

def isMedia(part: ContentPart): Boolean

Whether part is an image or a document.

Whether part is an image or a document.

Attributes

def text(parts: Seq[ContentPart]): String

The text parts of parts, joined by newlines: a message's text view. Empty when there are none.

The text parts of parts, joined by newlines: a message's text view. Empty when there are none.

Attributes

Concrete fields

val MaxInlineBytes: Int

The bound on an inline part's bytes: 5 MiB. One bound for every part, wherever it is built - a smart constructor or the codec reading stored or imported JSON - so no part over it can exist.

The bound on an inline part's bytes: 5 MiB. One bound for every part, wherever it is built - a smart constructor or the codec reading stored or imported JSON - so no part over it can exist.

Attributes

Implicits

Implicits

implicit val rw: ReadWriter[ContentPart]