Search code examples
c++google-assistant-sdkgoogle-assist-api

How to send a ConverseRequest message by Converse using C++


I am trying to build an google assistant client by using c++. I've passed the authentication and created channel; Then as the doc say: "Send a ConverseRequest message...", and stuck here, since Converse only has one parameter: ClientContext, How can a ConverseRequest convert to be ClientContext?

my code segment:

ConverseConfig config;
config.set_allocated_audio_in_config(&audio_in_config);
config.set_allocated_audio_out_config(&audio_out_config);

ConverseRequest request;
request.set_allocated_config(&config);

ClientContext context;
//context.AddMetadata(request.GetMetadata());

ConverseResponse *response  = stub_->Converse(&context);

Or some correct code sample will be thankful!


Solution

  • Well, C++ sample has offered:

    https://github.com/googlesamples/assistant-sdk-cpp