Vamsi
Vamsi

Reputation: 35

GRPC create channel link for Google Assistant API

I'm trying to write a C++ code to create Google Assistant on UDOO x86 board (See https://developers.google.com/assistant/sdk/). I have tried to follow all the steps regarding in the tutorial, but I'm not sure what URL I should have when I call the creatChannel method?

I do have the credentials JSON downloaded and using it through the "GOOGLE_APPLICATION_CREDENTIALS" environment variable

Object creation:

GAssistantClient greeter(grpc::CreateChannel(
      "google.com", grpc::GoogleDefaultCredentials()));

Contructor:

GAssistantClient(std::shared_ptr<Channel> channel)
      : stub_(Greeter::NewStub(channel)) {}

When I put google.com in there, I get the following error: E0505 18:30:34.959710444 7635 ssl_transport_security.c:1226] Invalid toplevel subdomain: com E0505 18:30:34.959836517 7635 ssl_transport_security.c:1226] Invalid toplevel subdomain: com

Upvotes: 2

Views: 762

Answers (2)

alihaqnawaz.965
alihaqnawaz.965

Reputation: 81

You have to authenticate using your credentials and then create a channel, after that you have send audio config request about your audio and then send an audio data request which contains your audio captured etc.

You can use ALSA sound API library to capture and playback audio. and then send and receive in api requests and responses.

You should follow the following order in this doc

Upvotes: 2

Prisoner
Prisoner

Reputation: 50701

The Service name for the Google Assistant API is embeddedassistant.googleapis.com. So your object creation call would look like:

GAssistantClient greeter(grpc::CreateChannel(
      "embeddedassistant.googleapis.com", grpc::GoogleDefaultCredentials()));

Upvotes: 1

Related Questions