TaskBuilder
Builder class for creating Task instances.
This builder provides a fluent API for creating Task objects, making it easier to configure tasks.
Example usage:
val task = Task.create {
id("task-456")
contextId("ctx-789")
status {
state = TaskState.working
timestamp = System.currentTimeMillis()
}
artifact {
name = "response"
textPart("I can help you with that!")
}
}Content copied to clipboard
Functions
Link copied to clipboard
Adds an artifact to the task.
Link copied to clipboard
Link copied to clipboard
Creates an artifact using the provided Java-friendly Consumer and adds it to the task.
Creates an artifact using the provided configuration block and adds it to the task.
Link copied to clipboard
Sets the artifacts of the task.
Link copied to clipboard
Link copied to clipboard
Sets the ID of the task.
Link copied to clipboard
Sets the metadata of the task.
Link copied to clipboard
Sets the status of the task.
Configures the status using a Java-friendly Consumer.
Configures the status using a lambda with receiver.