Another SDK or REST API for actions on Google?

Is it possible, or in the Roadmap, to develop your own action on Google without using the API.ai or NodeJS SDK?

+4
source share
3 answers

This is already possible: I built a very small example of a Java conversation with Vert.x : https://github.com/Ithildir/actions-on-google-vertx-sample

Here you can find additional information about the HTTP protocol: https://developers.google.com/actions/reference/conversation

+3
source

JAX-RS -, Google Apps. , Java HTTP, Google : https://github.com/l0s/google-actions-conversation-api. . . :

@Path("/webhook")
@Consumes("application/json")
@Produces("application/json")
@POST
public ConversationResponse handle(final ConversationRequest request,
        @Context final HttpServletResponse servletResponse) {
    servletResponse.setHeader("Google-Assistant-API-Version", "v1");

    final SpeechResponse speechResponse = new SpeechResponse();
    speechResponse.setTextToSpeech("Hello!");
    final FinalResponse finalResponse = new FinalResponse();
    finalResponse.setSpeechResponse(speechResponse);
    final ConversationResponse response = new ConversationResponse();
    response.setConversationToken(request.getConversationToken());
    response.setFinalResponse(finalResponse);
    return response;
}

, / JSON .

, , webhook . , ( ) JAX-RS. , AWS API Gateway Lambda.

+2

Kotlin/Java. SDK Google. node.js SDK API.ai, SDK Actions ( ), Kotlin/Java. , 100% , /. https://github.com/TicketmasterMobileStudio/actions-on-google-kotlin

0

Source: https://habr.com/ru/post/1665197/


All Articles