createQApp
inline suspend fun QAppsClient.createQApp(crossinline block: CreateQAppRequest.Builder.() -> Unit): CreateQAppResponse
Creates a new Amazon Q App based on the provided definition. The Q App definition specifies the cards and flow of the Q App. This operation also calculates the dependencies between the cards by inspecting the references in the prompts.
Samples
import aws.sdk.kotlin.services.qapps.model.AppDefinitionInput
import aws.sdk.kotlin.services.qapps.model.CardInput
import aws.sdk.kotlin.services.qapps.model.CardType
import aws.sdk.kotlin.services.qapps.model.QQueryCardInput
import aws.sdk.kotlin.services.qapps.model.TextInputCardInput
fun main() {
//sampleStart
// A basic application with 1 text input card and 1 output card
val resp = qAppsClient.createQApp {
instanceId = "0b95c9c4-89cc-4aa8-9aae-aa91cbec699f"
title = "Color Palette Generator"
appDefinition = AppDefinitionInput {
cards = listOf<CardInput>(
CardInput.TextInput(TextInputCardInput {
type = CardType.fromValue("text-input")
title = "Color Base"
id = "4cf94d96-8819-45c2-98cc-58c56b35c72f"
}
),
CardInput.QQuery(QQueryCardInput {
type = CardType.fromValue("q-query")
title = "Recommended Palette"
id = "18870b94-1e63-40e0-8c12-669c90ac5acc"
prompt = "Recommend me a list of colors that go well with @4cf94d96-8819-45c2-98cc-58c56b35c72f"
}
)
)
initialPrompt = "Create an app that recommend a list of colors based on input."
}
}
//sampleEnd
}