Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
TuLingRobot Class Reference

#include <nlp_feedback.h>

Public Member Functions

std::string callTulingApi ()
 请求图灵机器人接口,获取回答. More...
 
void setAskJson (const std::string ask_str)
 设置图灵机器人对话请求参数. More...
 
std::string textFromJson ()
 从图灵机器人的完整json回答中解析出最终需要的text回答. More...
 
void uninitTuling ()
 一次回答后释放资源. More...
 

Static Private Member Functions

static size_t http_data_writer (void *data, size_t size, size_t nmemb, void *content)
 

Private Attributes

std::string answer_json_
 
std::string answer_text_
 
std::string ask_json_
 
std::string tuling_key_ = "58dcf416803a401a8b0770b9c551acef"
 
std::string tuling_url_ = "http://openapi.tuling123.com/openapi/api/v2"
 

Detailed Description

图灵对话机器人模块

Definition at line 126 of file nlp_feedback.h.

Member Function Documentation

std::string TuLingRobot::callTulingApi ( )

请求图灵机器人接口,获取回答.

Returns
std::string answer_json_ - 返回图灵机器人的完整json回答.

Definition at line 173 of file nlp_feedback.cpp.

size_t TuLingRobot::http_data_writer ( void *  data,
size_t  size,
size_t  nmemb,
void *  content 
)
staticprivate

Definition at line 161 of file nlp_feedback.cpp.

void TuLingRobot::setAskJson ( const std::string  ask_str)

设置图灵机器人对话请求参数.

Parameters
ask_str- [in] 提问的语句.

Definition at line 149 of file nlp_feedback.cpp.

std::string TuLingRobot::textFromJson ( )

从图灵机器人的完整json回答中解析出最终需要的text回答.

Returns
std::string answer_text_ - 返回需要的text回答.

Definition at line 208 of file nlp_feedback.cpp.

void TuLingRobot::uninitTuling ( )

一次回答后释放资源.

Definition at line 241 of file nlp_feedback.cpp.

Member Data Documentation

std::string TuLingRobot::answer_json_
private

Definition at line 160 of file nlp_feedback.h.

std::string TuLingRobot::answer_text_
private

Definition at line 161 of file nlp_feedback.h.

std::string TuLingRobot::ask_json_
private

Definition at line 159 of file nlp_feedback.h.

std::string TuLingRobot::tuling_key_ = "58dcf416803a401a8b0770b9c551acef"
private

Definition at line 158 of file nlp_feedback.h.

std::string TuLingRobot::tuling_url_ = "http://openapi.tuling123.com/openapi/api/v2"
private

Definition at line 157 of file nlp_feedback.h.


The documentation for this class was generated from the following files:


xbot_talker
Author(s): wangxiaoyun
autogenerated on Sat Oct 10 2020 03:27:54