19 YARP_LOG_COMPONENT(GoogleDialogFlowCxChatBotParamsCOMPONENT,
"yarp.device.GoogleDialogFlowCxChatBot")
30 std::vector<std::string> params;
31 params.push_back(
"project");
32 params.push_back(
"location");
33 params.push_back(
"agent_name");
34 params.push_back(
"language_code");
42 if (config.
check(
"help"))
47 std::string config_string = config.
toString();
51 if (config.
check(
"project"))
54 yCInfo(GoogleDialogFlowCxChatBotParamsCOMPONENT) <<
"Parameter 'project' using value:" <<
m_project;
58 yCError(GoogleDialogFlowCxChatBotParamsCOMPONENT) <<
"Mandatory parameter 'project' not found!";
59 yCError(GoogleDialogFlowCxChatBotParamsCOMPONENT) <<
"Description of the parameter: The name of the Google cloud project the wanted agent belongs to";
62 prop_check.
unput(
"project");
67 if (config.
check(
"location"))
70 yCInfo(GoogleDialogFlowCxChatBotParamsCOMPONENT) <<
"Parameter 'location' using value:" <<
m_location;
74 yCError(GoogleDialogFlowCxChatBotParamsCOMPONENT) <<
"Mandatory parameter 'location' not found!";
75 yCError(GoogleDialogFlowCxChatBotParamsCOMPONENT) <<
"Description of the parameter: The world region specified for the wanted agent";
78 prop_check.
unput(
"location");
83 if (config.
check(
"agent_name"))
86 yCInfo(GoogleDialogFlowCxChatBotParamsCOMPONENT) <<
"Parameter 'agent_name' using value:" <<
m_agent_name;
90 yCError(GoogleDialogFlowCxChatBotParamsCOMPONENT) <<
"Mandatory parameter 'agent_name' not found!";
91 yCError(GoogleDialogFlowCxChatBotParamsCOMPONENT) <<
"Description of the parameter: The name of the agent";
94 prop_check.
unput(
"agent_name");
99 if (config.
check(
"language_code"))
102 yCInfo(GoogleDialogFlowCxChatBotParamsCOMPONENT) <<
"Parameter 'language_code' using value:" <<
m_language_code;
106 yCInfo(GoogleDialogFlowCxChatBotParamsCOMPONENT) <<
"Parameter 'language_code' using DEFAULT value:" <<
m_language_code;
108 prop_check.
unput(
"language_code");
143 doc = doc + std::string(
"\n=============================================\n");
144 doc = doc + std::string(
"This is the help for device: GoogleDialogFlowCxChatBot\n");
145 doc = doc + std::string(
"\n");
146 doc = doc + std::string(
"This is the list of the parameters accepted by the device:\n");
147 doc = doc + std::string(
"'project': The name of the Google cloud project the wanted agent belongs to\n");
148 doc = doc + std::string(
"'location': The world region specified for the wanted agent\n");
149 doc = doc + std::string(
"'agent_name': The name of the agent\n");
150 doc = doc + std::string(
"'language_code': The language code to use for the interaction with the bot\n");
151 doc = doc + std::string(
"\n");
152 doc = doc + std::string(
"Here are some examples of invocation command with yarpdev, with all params:\n");
153 doc = doc +
" yarpdev --device googleDialogFlowCxChatBot --project <mandatory_value> --location <mandatory_value> --agent_name <mandatory_value> --language_code en-US\n";
154 doc = doc + std::string(
"Using only mandatory params:\n");
155 doc = doc +
" yarpdev --device googleDialogFlowCxChatBot --project <mandatory_value> --location <mandatory_value> --agent_name <mandatory_value>\n";
156 doc = doc + std::string(
"=============================================\n\n");
return doc;
std::string getDocumentationOfDeviceParams() const override
Get the documentation of the DeviceDriver's parameters.
std::vector< std::string > getListOfParams() const override
Return a list of all params used by the device.
bool parseParams(const yarp::os::Searchable &config) override
Parse the DeviceDriver parameters.
GoogleDialogFlowCxChatBot_ParamsParser()
std::string m_language_code
A class for storing options and configuration information.
void unput(const std::string &key)
Remove the association from the given key to a value, if present.
A base class for nested structures that can be searched.
virtual bool check(const std::string &key) const =0
Check if there exists a property of the given name.
virtual std::string toString() const =0
Return a standard text representation of the content of the object.
virtual Value & find(const std::string &key) const =0
Gets a value corresponding to a given keyword.
#define yCInfo(component,...)
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)