class LittleGhost::Artifact

Represents a file, image, or document produced by a Tool or supplied to a Run. LittleGhost sends supported media to the model once and may store the same bytes for filesystem Tools. Inline artifacts contain their bytes. Deferred artifacts contain an application-defined reference that the block passed to Configuration#artifacts may use to load the bytes.

image = LittleGhost::Artifact.new(
  data: File.binread("chart.png"),
  media_type: "image/png",
  name: "chart.png"
)

download = LittleGhost::Artifact.deferred(
  reference: {file_id: "file-481"},
  media_type: "application/pdf",
  name: "report.pdf"
)