I have the following (kotlin) code:
import com.google.cloud.dialogflow.v2beta1.*
val project = "my-super-agent"
val trainingPhraseBuilder = Intent.TrainingPhrase.Part.newBuilder()
trainingPhraseBuilder.text = "Tell me about the product."
val trainingPhrasePart = trainingPhraseBuilder.build()
println(trainingPhrasePart)
var i = with(Intent.newBuilder()) {
displayName = "My First Built Intent"
addTrainingPhrases(Intent.TrainingPhrase.newBuilder().addAllParts(listOf(trainingPhrasePart)))
val message =
with(addMessagesBuilder()) {
basicCardBuilder.setFormattedText("It is amazing. Truly it is.")
build()
}
build()
}
and then of course
IntentsClient.create().use({ intentsClient ->
val intrequest = CreateIntentRequest.newBuilder()
.setParent("projects/$project/agent")
.setIntent(i)
.build()
val response1 = intentsClient.createIntent(intrequest)
})
but for the life of me I can't figure out how to create a trivial entry in this section:
The basic cards appear in the Google Assistant section (obviously).
What am I missing in order to create default simple default responses? If you are thinking "oh that's easy - it's ...." then yes you are correct - it is simple I just can't find it.
FWIW. Some of my (not working) attempts look like:
var sr = Intent.Message.SimpleResponse.newBuilder()
sr.setDisplayText("Pleeeeaaaassssseeee")
val simpleReponseMessage = sr.build()
addMessagesBuilder()
.simpleResponsesBuilder
.addSimpleResponses(simpleReponseMessage)
.build()