2.3.2-QA knowledge Modify
1. Overview
Interface name: QA single knowledge modification
Version number: v1.0.0
2. Information
Request method: PUT
Request URL: https://DOMAIN/openapi/v1/knowledge/qa/
Domain: Refer to "Service address description"
3. Request parameters
Request header http header field:
Content-Type
string
Yes
Fixedapplication/json
cybertron-robot-key
string
Yes
Robot key
cybertron-robot-token
string
Yes
Robot token
Request body field:
username
string
Yes
User account
id
int
Yes
Knowledge id
knowledge_base_id
string
Yes
Knowledge Base id
question
string
Yes
Knowledge question
answer
string
Yes
Knowledge answer
knowledge_image
array
No
Knowledge-related pictures (returned image name is required through the uploading platform for the image upload interface)
knowledge_attachment
array
No
Knowledge-related attachments
4. Response field description
HTTP status code: 200 OK
Response field description:
code
string
"000000" is normal, other exceptions
message
string
Status description
data
object
message body
id
int
Unique ID of this message
emb_status
int
1 means processing, 2 means entering the knowledge base, and 3 means importing the knowledge base failed
5. Example
Request Example:
curl 'https://_DOMAIN_/openapi/v1/knowledge/qa/' \
-H 'Content-Type: application/json' \
-H 'cybertron-robot-key: l8ia2IOc************Z724%2BU%3D' \
-H 'cybertron-robot-token: MTc0Mzk5************************************************cGRCUTg9' \
-X PUT -d '{
"username": "me@host.com",
"id": 68157,
"knowledge_base_id": "324",
"question": "How big is the sun? v4",
"answer": "The Sun is a star in the solar system, and its size is very huge. The Suns diameter is about 1,391,000 kilometers, which is about 109 times the diameter of the Earth. Its volume is about 1,300,000 times that of the Earth, and its mass is 333,000 times that of the Earth.",
"knowledge_image": [
"172180700265d0ffb0-e821-44f4-9a12-be289220b151.jpeg"
],
"knowledge_attachment": [
"172180700265d0ffb0-e821-44f4-9a12-be289220b151.jpeg"
]
}'Response example:
{
"code": "000000",
"message": "Knowledge has been entered, and is being studied...",
"data": {
"id": 68157,
"knowledge_image_list": [
"https://bucket1.some-host.com/api/app/cybertron/knowledge_file/image/knowledge/qa_img/172180700265d0ffb0-e821-44f4-9a12-be289220b151.jpeg"
],
"creator_name": "zhengdong.zhou",
"editor_name": "zhengdong.zhou",
"question": "How big is the sun? v4",
"answer": "The Sun is a star in the solar system, and its size is very huge. The Sun's diameter is about 1,391,000 kilometers, which is about 109 times the diameter of the Earth. Its volume is about 1,300,000 times that of the Earth, and its mass is 333,000 times that of the Earth.",
"data_source": 1,
"create_time": "2024-07-24 16:00:35",
"update_time": "2024-07-24 16:23:17",
"knowledge_image": "{\"172180700265d0ffb0-e821-44f4-9a12-be289220b151.jpeg\": \"172180700265d0ffb0-e821-44f4-9a12-be289220b151.jpeg\"}",
"emb_status": 1,
"batch_unique": null,
"file_name": null,
"save_name": null,
"folder": 2936,
"knowledge_base": 324,
"knowledge_provider": 61,
"editor": 61,
"correct_source": null
}
}