Code Monkey home page Code Monkey logo

Comments (1)

Fleker avatar Fleker commented on June 25, 2024 1

Yeah, you'll need to create an AudioInConfig instead of the text query and then start sending audio_in bytes up until you decide to close the connection or you receive AssistResponse.event_type.END_OF_UTTERANCE.

A conversation is one or more gRPC connections, each consisting of several streamed requests and responses. For example, the user says Add to my shopping list and the Assistant responds What do you want to add?. The sequence of streamed requests and responses in the first gRPC message could be:
AssistRequest.config
AssistRequest.audio_in
AssistRequest.audio_in
AssistRequest.audio_in
AssistRequest.audio_in
AssistResponse.event_type.END_OF_UTTERANCE
AssistResponse.speech_results.transcript "add to my shopping list"
AssistResponse.dialog_state_out.microphone_mode.DIALOG_FOLLOW_ON
AssistResponse.audio_out
AssistResponse.audio_out
AssistResponse.audio_out

The user then says bagels and the Assistant responds OK, I've added bagels to your shopping list. This is sent as another gRPC connection call to the Assist method, again with streamed requests and responses, such as:
AssistRequest.config
AssistRequest.audio_in
AssistRequest.audio_in
AssistRequest.audio_in
AssistResponse.event_type.END_OF_UTTERANCE
AssistResponse.dialog_state_out.microphone_mode.CLOSE_MICROPHONE
AssistResponse.audio_out
AssistResponse.audio_out
AssistResponse.audio_out
AssistResponse.audio_out

from assistant-sdk-nodejs.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.