Skip to content

Working on getting a simple v2 example going. Need some guidance #60

@scottlahay

Description

@scottlahay

I have been working on a google app engine project using the v2 branch. Looking for some guidence. I copied the DialogflowWebhook example and got a late init error that went away when I set Serializer.aogGson = Gson()

now I'm getting this exception

Uncaught exception from servlet
java.lang.Error: No response has been set. Is this being used in an async call that was not returned as a promise to the intent handler?
at actions.service.actionssdk.conversation.Conversation.response(Conversation.kt:391)
at actions.service.dialogflow.DialogflowConversation.commonPayload(Conv.kt:321)
at actions.service.dialogflow.DialogflowConversation.serialize(Conv.kt:366)
at actions.service.dialogflow.DialogflowSdk$handler$1.handle(Dialogflow.kt:450)
at actions.framework.StandardHandler$DefaultImpls.handle$default(Framework.kt:51)
at actions.expected.ServletHandler.handle(BuiltinFrameworks.kt:36)
at actions.service.dialogflow.DialogflowSdk$1.handle(Dialogflow.kt:463)
at actions.ServiceBaseApp.invoke(Assistant.kt:21)
at scott.servlets.FitnessAssistantServlet.simpleDialogFlowExample(FitnessAssistantServlet.kt:30)
at scott.servlets.FitnessAssistantServlet.doPost(FitnessAssistantServlet.kt:21)

My code

data class MyConversation(val temp: String? = null)
data class MyArgument(val temp: String? = null, var resultType: String? = null, var userDescision: String? = null)

class FitnessAssistantServlet: HttpServlet() {
    val logger = Logger.getLogger("TestServlet")

    @Throws(ServletException::class, IOException::class)
    override fun doPost(req: HttpServletRequest, resp: HttpServletResponse) {
        val dfApp = dialogflow<UserStorage<Any>, MyConversation, MyArgument>()
        dfApp.frameworks.add(ServletFramework())
        dfApp.intent("test") { conv -> conv.ask("Can you hear me?") }
        dfApp(req, res
    }
}

It feels like I'm missing some initialization logic somewhere, not sure where though.
Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions