buildElicitRequest
Creates an ElicitRequest using a type-safe DSL builder.
Required
message - The message to present to the user
requestedSchema - Schema defining the structure of requested data
Optional
meta - Metadata for the request
Example requesting user information:
val request = buildElicitRequest {
message = "Please provide your contact information"
requestedSchema {
properties {
put("email", JsonObject(mapOf(
"type" to JsonPrimitive("string"),
"description" to JsonPrimitive("Your email address")
)))
put("name", JsonObject(mapOf(
"type" to JsonPrimitive("string")
)))
}
required = listOf("email")
}
}Content copied to clipboard
Example with simple text input:
val request = buildElicitRequest {
message = "Enter a project name"
requestedSchema {
properties {
put("projectName", JsonObject(mapOf(
"type" to JsonPrimitive("string"),
"description" to JsonPrimitive("Name for the new project")
)))
}
}
}Content copied to clipboard
Return
A configured ElicitRequest instance
Parameters
block
Configuration lambda for setting up the elicitation request