ArtifactBuilder

Builder class for creating Artifact instances.

This builder provides a fluent API for creating Artifact objects, making it easier to construct complex artifacts with many parameters.

Example usage:

val artifact = Artifact.create {
name = "response"
description = "AI response artifact"
textPart("I can help you with that!")
index = 0
append = false
lastChunk = true
}

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var index: Long
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var name: String?
Link copied to clipboard

Functions

Link copied to clipboard

Adds a part to the artifact.

Link copied to clipboard

Sets whether to append the artifact.

Link copied to clipboard

Builds an Artifact instance with the configured parameters.

Link copied to clipboard
fun data(block: () -> Map<String, Any>): DataPart
Link copied to clipboard

Creates a data part using the provided Java-friendly Consumer.

Creates a data part using the provided configuration block.

Link copied to clipboard

Sets the description of the artifact.

Link copied to clipboard
Link copied to clipboard

Creates a file part using the provided Java-friendly Consumer.

Creates a file part using the provided configuration block.

Link copied to clipboard

Sets the index of the artifact.

Link copied to clipboard

Sets whether this is the last chunk of the artifact.

Link copied to clipboard

Sets the metadata of the artifact.

Link copied to clipboard

Sets the name of the artifact.

Link copied to clipboard

Sets the parts of the artifact.

Link copied to clipboard
fun text(block: () -> String): TextPart
Link copied to clipboard

Creates a text part using the provided Java-friendly Consumer.

Creates a text part using the provided configuration block.