Responding to Multi-Round Q&A
Function
Respond to multi-round Q&A.
URI
POST /v2/irobot/ask
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
question |
Yes |
String |
Specifies the question entered by a user. Minimum length: 1 Maximum length: 1000 |
|
top |
No |
Integer |
Specifies the maximum number of returned data records. Minimum value: 1 Maximum value: 10 |
|
themes |
No |
Array of RelationTheme objects |
Specifies the theme list. Array length: 0 - 10 |
|
source |
No |
String |
Specifies the source of the Q&A. Minimum length: 0 Maximum length: 64 Options: |
|
session_id |
No |
String |
Specifies the session ID. Minimum length: 0 Maximum length: 64 |
|
source_qa_pair_id |
No |
String |
Specifies the Q&A pair ID. Minimum length: 0 Maximum length: 64 |
|
alternative_answer_enable |
No |
Boolean |
Specifies whether alternative answers are required. |
|
product_type_id |
No |
String |
Specifies the product type ID. Minimum length: 0 Maximum length: 64 |
|
specify_node_id |
No |
String |
Specifies the ID of a specified node. Minimum length: 0 Maximum length: 64 |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Specifies the error code. Minimum length: 0 Maximum length: 32 |
|
error_msg |
String |
Describes the error. Minimum length: 0 Maximum length: 32 |
|
lang_result |
LangResult object |
Specifies the language detection result. |
|
reply_type |
String |
Specifies the reply type. Options: |
|
session_id |
String |
Specifies the session ID. Minimum length: 0 Maximum length: 64 |
|
request_id |
String |
Specifies the request ID. Minimum length: 0 Maximum length: 64 |
|
answers_detail |
AnswerDetail object |
Specifies the answer. |
|
Parameter |
Type |
Description |
|---|---|---|
|
language |
String |
Specifies the language. Minimum length: 0 Maximum length: 64 |
|
is_en |
Boolean |
Specifies whether English is used or not. |
|
Parameter |
Type |
Description |
|---|---|---|
|
qabot_answers |
Array of QabotAnswer objects |
Specifies the answer list. Array length: 0 - 65535 |
|
qa_flow_answers |
QaFlowHitResult object |
Specifies the list of answers for multi-round Q&A. |
|
chat_answer |
String |
Specifies the question. Minimum length: 0 Maximum length: 65535 |
|
graph_answer |
QaGraphAnswer object |
Specifies the list of graph-based answers. |
|
Parameter |
Type |
Description |
|---|---|---|
|
question |
String |
Specifies the question. Minimum length: 0 Maximum length: 65535 |
|
answer |
String |
Specifies the answer. Minimum length: 0 Maximum length: 65535 |
|
score |
Double |
Specifies the score. Minimum value: 0 Maximum value: 1 |
|
domain |
String |
Specifies the domain. Minimum length: 0 Maximum length: 200 |
|
link |
String |
Specifies the link. Minimum length: 0 Maximum length: 1024 |
|
qa_pair_id |
String |
Specifies the Q&A pair ID. Minimum length: 0 Maximum length: 64 |
|
domain_id |
String |
Specifies the domain ID. Minimum length: 0 Maximum length: 64 |
|
top_score_question |
String |
Specifies the recommended answer. Minimum length: 0 Maximum length: 65535 |
|
relevance_details |
Array of RelevanceQapair objects |
Specifies the list of related questions. Array length: 0 - 65535 |
|
Parameter |
Type |
Description |
|---|---|---|
|
link |
String |
Specifies the link. Minimum length: 0 Maximum length: 65535 |
|
question |
String |
Specifies the standard question. Minimum length: 0 Maximum length: 9223372036854775807 |
|
qa_pair_id |
String |
Specifies the standard question ID. Minimum length: 0 Maximum length: 64 |
|
Parameter |
Type |
Description |
|---|---|---|
|
session_id |
String |
Specifies the session ID. Minimum length: 0 Maximum length: 64 |
|
current_node |
QaFlowHitNodeVo object |
Specifies the current node. |
|
candidate_nodes |
Array of QaFlowHitNodeVo objects |
Specifies the candidate nodes. Array length: 0 - 65535 |
|
is_completed |
Boolean |
Specifies whether the Q&A flow is complete. |
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
String |
Specifies the flow node ID. Minimum length: 0 Maximum length: 64 |
|
name |
String |
Specifies the flow node name. Minimum length: 0 Maximum length: 255 |
|
content |
String |
Specifies the content. Minimum length: 0 Maximum length: 65535 |
|
answer_type |
String |
Specifies the answer type. Options: |
|
Parameter |
Type |
Description |
|---|---|---|
|
answer |
String |
Specifies the answer. Minimum length: 0 Maximum length: 65535 |
|
score |
Double |
Specifies the answer matching score. Minimum value: 0 Maximum value: 1 |
|
type |
Integer |
Specifies the answer type. Minimum value: 0 Maximum value: 2147483647 |
|
options |
Array of strings |
Specifies the list of candidate answers. Minimum length: 0 Maximum length: 65535 Array length: 0 - 65535 |
Request Example
POST https://{endpoint}/v2/irobot/ask
{
"question" : "How can I purchase ECS?"
}
Response Example
Status code: 200
Code 200 is returned if the operation is successful.
{
"lang_result" : null,
"reply_type" : "QA_BOT",
"session_id" : "session-id",
"request_id" : "request-id",
"answers_detail" : {
"qabot_answers" : [ {
"question" : "Question",
"answer" : "Answer",
"score" : 0.85,
"domain" : "ECS",
"link" : "link",
"qa_pair_id" : "Q&A pair ID",
"domain_id" : "Domain ID",
"top_score_question" : "Recommended question",
"relevance_details" : [ {
"link" : "link",
"question" : "Standard question",
"qa_pair_id" : "Standard question ID"
} ]
} ],
"qa_flow_answers" : [ {
"session_id" : "seesionID",
"is_completed" : true,
"current_node" : [ {
"id" : "node-id",
"name" : "node-name",
"content" : "Content",
"answer_type" : "TEXT"
} ],
"candidate_nodes" : [ {
"id" : "node-id",
"name" : "node-name",
"content" : "Content",
"answer_type" : "TEXT"
} ]
} ],
"chat_answer" : "Answer to the question",
"graph_answer" : [ {
"answer" : "Answer",
"score" : 0.85,
"type" : 1,
"options" : [ "option" ]
} ]
}
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Code 200 is returned if the operation is successful. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.