Update RunMedQA.

This commit is contained in:
sdk-team
2021-04-17 02:36:08 +00:00
parent ed4870b066
commit b972642ffe
7 changed files with 159 additions and 31 deletions

File diff suppressed because one or more lines are too long

View File

@@ -30,22 +30,50 @@ namespace AlibabaCloud
{
class ALIBABACLOUD_IMAGEPROCESS_EXPORT RunMedQARequest : public RpcServiceRequest
{
public:
struct AnswerImageDataList
{
std::string answerImageData;
};
struct AnswerTextList
{
std::string answerText;
};
struct AnswerImageURLList
{
std::string answerImageURL;
};
public:
RunMedQARequest();
~RunMedQARequest();
std::string getQuestion()const;
void setQuestion(const std::string& question);
std::string getOrgId()const;
void setOrgId(const std::string& orgId);
std::string getSessionId()const;
void setSessionId(const std::string& sessionId);
std::string getOrgName()const;
void setOrgName(const std::string& orgName);
std::vector<AnswerImageDataList> getAnswerImageDataList()const;
void setAnswerImageDataList(const std::vector<AnswerImageDataList>& answerImageDataList);
std::vector<AnswerTextList> getAnswerTextList()const;
void setAnswerTextList(const std::vector<AnswerTextList>& answerTextList);
std::string getDepartment()const;
void setDepartment(const std::string& department);
std::vector<AnswerImageURLList> getAnswerImageURLList()const;
void setAnswerImageURLList(const std::vector<AnswerImageURLList>& answerImageURLList);
std::string getQuestionType()const;
void setQuestionType(const std::string& questionType);
std::string getOrgId()const;
void setOrgId(const std::string& orgId);
private:
std::string question_;
std::string orgId_;
std::string sessionId_;
std::string orgName_;
std::vector<AnswerImageDataList> answerImageDataList_;
std::vector<AnswerTextList> answerTextList_;
std::string department_;
std::vector<AnswerImageURLList> answerImageURLList_;
std::string questionType_;
std::string orgId_;
};
}

View File

@@ -34,20 +34,28 @@ namespace AlibabaCloud
public:
struct Data
{
std::string answer;
std::vector<std::string> similarQuestion;
std::vector<std::string> options;
std::string reports;
std::string questionType;
std::string answerType;
std::string question;
std::string sessionId;
};
RunMedQAResult();
explicit RunMedQAResult(const std::string &payload);
~RunMedQAResult();
std::string getMessage()const;
Data getData()const;
std::string getCode()const;
protected:
void parse(const std::string &payload);
private:
std::string message_;
Data data_;
std::string code_;
};
}

View File

@@ -27,26 +27,15 @@ RunMedQARequest::RunMedQARequest() :
RunMedQARequest::~RunMedQARequest()
{}
std::string RunMedQARequest::getQuestion()const
std::string RunMedQARequest::getSessionId()const
{
return question_;
return sessionId_;
}
void RunMedQARequest::setQuestion(const std::string& question)
void RunMedQARequest::setSessionId(const std::string& sessionId)
{
question_ = question;
setBodyParameter("Question", question);
}
std::string RunMedQARequest::getOrgId()const
{
return orgId_;
}
void RunMedQARequest::setOrgId(const std::string& orgId)
{
orgId_ = orgId;
setBodyParameter("OrgId", orgId);
sessionId_ = sessionId;
setBodyParameter("SessionId", sessionId);
}
std::string RunMedQARequest::getOrgName()const
@@ -60,3 +49,81 @@ void RunMedQARequest::setOrgName(const std::string& orgName)
setBodyParameter("OrgName", orgName);
}
std::vector<RunMedQARequest::AnswerImageDataList> RunMedQARequest::getAnswerImageDataList()const
{
return answerImageDataList_;
}
void RunMedQARequest::setAnswerImageDataList(const std::vector<AnswerImageDataList>& answerImageDataList)
{
answerImageDataList_ = answerImageDataList;
for(int dep1 = 0; dep1!= answerImageDataList.size(); dep1++) {
auto answerImageDataListObj = answerImageDataList.at(dep1);
std::string answerImageDataListObjStr = "AnswerImageDataList." + std::to_string(dep1 + 1);
setParameter(answerImageDataListObjStr + ".AnswerImageData", answerImageDataListObj.answerImageData);
}
}
std::vector<RunMedQARequest::AnswerTextList> RunMedQARequest::getAnswerTextList()const
{
return answerTextList_;
}
void RunMedQARequest::setAnswerTextList(const std::vector<AnswerTextList>& answerTextList)
{
answerTextList_ = answerTextList;
for(int dep1 = 0; dep1!= answerTextList.size(); dep1++) {
auto answerTextListObj = answerTextList.at(dep1);
std::string answerTextListObjStr = "AnswerTextList." + std::to_string(dep1 + 1);
setParameter(answerTextListObjStr + ".AnswerText", answerTextListObj.answerText);
}
}
std::string RunMedQARequest::getDepartment()const
{
return department_;
}
void RunMedQARequest::setDepartment(const std::string& department)
{
department_ = department;
setBodyParameter("Department", department);
}
std::vector<RunMedQARequest::AnswerImageURLList> RunMedQARequest::getAnswerImageURLList()const
{
return answerImageURLList_;
}
void RunMedQARequest::setAnswerImageURLList(const std::vector<AnswerImageURLList>& answerImageURLList)
{
answerImageURLList_ = answerImageURLList;
for(int dep1 = 0; dep1!= answerImageURLList.size(); dep1++) {
auto answerImageURLListObj = answerImageURLList.at(dep1);
std::string answerImageURLListObjStr = "AnswerImageURLList." + std::to_string(dep1 + 1);
setParameter(answerImageURLListObjStr + ".AnswerImageURL", answerImageURLListObj.answerImageURL);
}
}
std::string RunMedQARequest::getQuestionType()const
{
return questionType_;
}
void RunMedQARequest::setQuestionType(const std::string& questionType)
{
questionType_ = questionType;
setBodyParameter("QuestionType", questionType);
}
std::string RunMedQARequest::getOrgId()const
{
return orgId_;
}
void RunMedQARequest::setOrgId(const std::string& orgId)
{
orgId_ = orgId;
setBodyParameter("OrgId", orgId);
}

View File

@@ -40,16 +40,38 @@ void RunMedQAResult::parse(const std::string &payload)
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
if(!dataNode["Answer"].isNull())
data_.answer = dataNode["Answer"].asString();
auto allSimilarQuestion = dataNode["SimilarQuestion"]["SimilarQuestion"];
for (auto value : allSimilarQuestion)
data_.similarQuestion.push_back(value.asString());
if(!dataNode["Reports"].isNull())
data_.reports = dataNode["Reports"].asString();
if(!dataNode["QuestionType"].isNull())
data_.questionType = dataNode["QuestionType"].asString();
if(!dataNode["AnswerType"].isNull())
data_.answerType = dataNode["AnswerType"].asString();
if(!dataNode["Question"].isNull())
data_.question = dataNode["Question"].asString();
if(!dataNode["SessionId"].isNull())
data_.sessionId = dataNode["SessionId"].asString();
auto allOptions = dataNode["Options"]["options"];
for (auto value : allOptions)
data_.options.push_back(value.asString());
if(!value["Message"].isNull())
message_ = value["Message"].asString();
if(!value["Code"].isNull())
code_ = value["Code"].asString();
}
std::string RunMedQAResult::getMessage()const
{
return message_;
}
RunMedQAResult::Data RunMedQAResult::getData()const
{
return data_;
}
std::string RunMedQAResult::getCode()const
{
return code_;
}