Resource

sealed class Resource(source)

Represents a sealed hierarchy of different resource types used to represent media content.

This class is typically used to encapsulate various forms of resource data that can be processed or transmitted, such as URLs, Data URLs, or Base64-encoded strings.

Subclasses:

  • Url: Represents a standard URL pointing to a resource.

  • InlineDataUrl: Represents a Data URL containing inline data of the resource.

  • Base64: Represents a Base64-encoded string containing the resource data.

Use cases include:

  • Storing references to external resources.

  • Embedding data directly in the form of Base64 or Data URLs.

Inheritors

Types

Link copied to clipboard
data class Base64(val base64: String, val mediaType: String) : Resource
Link copied to clipboard
data class InlineDataUrl(val inlineDataUrl: String) : Resource
Link copied to clipboard
data class Url(val url: String) : Resource