requestedSchema

Sets the requested schema directly.

Example:

buildElicitRequest {
message = "Enter details"
requestedSchema(ElicitRequestParams.RequestedSchema(
properties = buildJsonObject {
put("name", JsonObject(mapOf("type" to JsonPrimitive("string"))))
}
))
}

Parameters


Sets the requested schema using a DSL builder.

This is the recommended way to define schemas. The schema defines the structure of data to be collected from the user, supporting only top-level primitive properties.

Example:

buildElicitRequest {
message = "Configure settings"
requestedSchema {
properties {
put("enabled", JsonObject(mapOf(
"type" to JsonPrimitive("boolean"),
"description" to JsonPrimitive("Enable feature")
)))
put("apiKey", JsonObject(mapOf(
"type" to JsonPrimitive("string")
)))
}
required = listOf("apiKey")
}
}

Parameters

block

Lambda for building the schema

See also