How to use the google-proto-files.embeddedAssistant function in google-proto-files

To help you get started, we’ve selected a few google-proto-files examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github googlesamples / assistant-sdk-nodejs / google-assistant-grpc / googleassistant.js View on Github external
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

'use strict';
const path = require('path');
const grpc = require('grpc');
const protoFiles = require('google-proto-files');
const resolve = require('resolve');
const GoogleAuth = require('google-auth-library');

const PROTO_ROOT_DIR = protoFiles('..');
const embedded_assistant_pb = grpc.load({
    root: PROTO_ROOT_DIR,
    file: path.relative(PROTO_ROOT_DIR, protoFiles.embeddedAssistant.v1alpha2)
}).google.assistant.embedded.v1alpha2;

class GoogleAssistant {
    constructor(credentials) {
        GoogleAssistant.prototype.endpoint_ = "embeddedassistant.googleapis.com";
        this.client = this.createClient_(credentials);
        this.locale = "en-US";
        this.deviceModelId = 'default';
        this.deviceInstanceId = 'default';
    }
    createClient_(credentials) {
        const sslCreds = grpc.credentials.createSsl();
        // https://github.com/google/google-auth-library-nodejs/blob/master/ts/lib/auth/refreshclient.ts
        const auth = new GoogleAuth();
        const refresh = new auth.UserRefreshClient();
        refresh.fromJSON(credentials, function (res) { });
github actions-on-google / actions-on-google-testing-nodejs / actions-on-google.js View on Github external
};

const my_test_app = {
    'en-US': 'my test app',
    'fr-FR': 'mon application de test'
};

const PROTO_ROOT_DIR = protoFiles('..');
const embedded_assistant_pb = grpc.load({
    root: PROTO_ROOT_DIR,
    file: path.relative(PROTO_ROOT_DIR, protoFiles.embeddedAssistant.v1alpha2)
}).google.assistant.embedded.v1alpha2;

const latlng_pb = grpc.load({
    root: PROTO_ROOT_DIR,
    file: path.relative(PROTO_ROOT_DIR, protoFiles.embeddedAssistant.v1alpha2)
}).google.type.LatLng;

class ActionsOnGoogle {
    constructor(credentials) {
        ActionsOnGoogle.prototype.endpoint_ = "embeddedassistant.googleapis.com";

        this.client = this.createClient_(credentials);
        this.locale = "en-US";
        this.location = undefined
        this.deviceModelId = 'default';
        this.deviceInstanceId = 'default';
        this.conversationState = null;
        this.isNewConversation = false;
    }

    createClient_(credentials) {
github actions-on-google / actions-on-google-testing-nodejs / actions-on-google.js View on Github external
};

const cancel = {
    'en-US': 'cancel',
    'fr-FR': 'annuler'
};

const my_test_app = {
    'en-US': 'my test app',
    'fr-FR': 'mon application de test'
};

const PROTO_ROOT_DIR = protoFiles('..');
const embedded_assistant_pb = grpc.load({
    root: PROTO_ROOT_DIR,
    file: path.relative(PROTO_ROOT_DIR, protoFiles.embeddedAssistant.v1alpha2)
}).google.assistant.embedded.v1alpha2;

const latlng_pb = grpc.load({
    root: PROTO_ROOT_DIR,
    file: path.relative(PROTO_ROOT_DIR, protoFiles.embeddedAssistant.v1alpha2)
}).google.type.LatLng;

class ActionsOnGoogle {
    constructor(credentials) {
        ActionsOnGoogle.prototype.endpoint_ = "embeddedassistant.googleapis.com";

        this.client = this.createClient_(credentials);
        this.locale = "en-US";
        this.location = undefined
        this.deviceModelId = 'default';
        this.deviceInstanceId = 'default';