6#ifndef YARP_GOOGLEDIALOGCXBOT_H
7#define YARP_GOOGLEDIALOGCXBOT_H
14#include <google/cloud/dialogflow_cx/agents_client.h>
15#include <google/cloud/dialogflow/cx/v3/agent.pb.h>
16#include <google/cloud/dialogflow_cx/sessions_client.h>
17#include <google/cloud/dialogflow/cx/v3/session.grpc.pb.h>
18#include <google/cloud/dialogflow/cx/v3/session.pb.h>
19#include <grpcpp/grpcpp.h>
48 bool open(
yarp::os::Searchable& config) override;
49 bool close() override;
52 yarp::dev::ReturnValue
interact(const
std::
string& messageIn,
std::
string& messageOut) override;
59 std::
string m_agentId;
60 std::
string m_sessionId;
61 std::
string m_currentPage;
62 std::shared_ptr<grpc::Channel> m_channel;
63 std::unique_ptr<google::cloud::dialogflow::cx::v3::Sessions::Stub> m_sessionStub;
64 std::shared_ptr<google::cloud::dialogflow_cx::SessionsClient> m_session{
nullptr};
66 std::string _getRandSession_();
This class is the parameters parser for class GoogleDialogFlowCxChatBot.
googleDialogFlowCxChatBot: A yarp device to enable interaction with Google's DialogFlow CX service
GoogleDialogFlowCxChatBot()=default
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
yarp::dev::ReturnValue interact(const std::string &messageIn, std::string &messageOut) override
Sends a message to the chatbot.
yarp::dev::ReturnValue getLanguage(std::string &language) override
Gets the current chatbot language.
yarp::dev::ReturnValue getStatus(std::string &status) override
Gets the current status of the bot.
GoogleDialogFlowCxChatBot(const GoogleDialogFlowCxChatBot &)=delete
yarp::dev::ReturnValue resetBot() override
Resets the chatbot.
GoogleDialogFlowCxChatBot(GoogleDialogFlowCxChatBot &&) noexcept=delete
bool close() override
Close the DeviceDriver.
yarp::dev::ReturnValue setLanguage(const std::string &language) override
Sets the chat bot language.
Interface implemented by all device drivers.
The main, catch-all namespace for YARP.