This document describes how to connect Miaobi Writing to data sources. You can connect using an API or by uploading local files. Both methods supply content for your writing tasks.
Connect a data source using an API
-
If you have your own search engine or Retrieval-Augmented Generation (RAG) pipeline, you can configure it as a data source. Configure the API as follows:
1. Call the CreateDataset - Create data source API: http://${host}/api/privateDataset/createDataset
Sample request parameters:
{
"datasetName": "f1869e067f104c2897906e1f9cd268",
"datasetType": "ThirdSearch",
"datasetDescription": "test_11"
}
2. Call the UpdateDataset - Modify data source API: http://${host}/api/privateDataset/updateDataset
Sample request parameters:
{
"agentId": "3",
"tenantId": "3",
"datasetId": 463,
"createUser": "227",
"createTime": "2025-12-08 10:39:21",
"datasetType": "ThirdSearch",
"datasetName": "d18f9d02087c4e309470bf73df3329",
"datasetConfig": {
"searchSourceConfigs": [
{
"searchSourceRequestConfig": {
"url": "http://xxxx/api/search",
"method": "GET",
"connectTimeout": 3000,
"socketTimeout": 3000,
"headers": [
{
"name": "Content-Type",
"value": "application/json"
}
],
"params": [
{
"name": "querySelf",
"value": "${query}"
},
{
"name": "current",
"value": "${current}"
},
{
"name": "size",
"value": "${size}"
},
{
"name": "includeContent",
"valueType": "boolean",
"value": "${includeContent}"
},
{
"name": "startTime",
"valueType": "time",
"valueFormat": "yyyy-MM-dd HH:mm:ss",
"value": "${startTime}"
},
{
"name": "endTime",
"valueType": "time",
"valueFormat": "yyyy-MM-dd HH:mm:ss",
"value": "${endTime}"
}
],
"pathParamsEnable": false,
"body": "{\"query\":\"${querySelf}\",\"size\":\"${size}\",\"current\":\"${current}\"}"
},
"searchSourceResponseConfig": {
"jqNodes": [
{
"key": "total",
"type": "number",
"path": "totalSelf"
},
{
"key": "data",
"type": "list",
"path": "dataSelf",
"jqNodes": [
{
"key": "summary",
"type": "string",
"path": "summary"
},
{
"key": "score",
"type": "string",
"path": "score"
},
{
"key": "docUuid",
"type": "string",
"path": "docUuid"
},
{
"key": "pubTime",
"type": "string",
"path": "pubTime"
},
{
"key": "source",
"type": "string",
"path": "source"
},
{
"key": "tag",
"type": "string",
"path": "tag"
},
{
"key": "title",
"type": "string",
"path": "title"
},
{
"key": "extendInfo",
"type": "object",
"path": ".",
"jqNodes": [
{
"key": "docUuid",
"type": "string",
"path": "docUuid"
}
]
},
{
"key": "url",
"type": "string",
"path": "url"
},
{
"key": "content",
"type": "string",
"path": "content"
}
]
}
]
}
}
]
},
"datasetDescription": "11211",
"searchDatasetEnable": 3,
"documentHandleConfig": {}
}
-
For more information about the parameters, see Miaosou - Import data source via API.
Upload files as a data source
Use this method if you have only raw data and do not have a search engine or RAG pipeline. You must use Quanmiao-Miaosou to build a vector index. Upload your raw data to Miaosou to create the data source. To do this, you must activate the Miaosou service. For more information about activation and billing, see Billing details (Miaosou and Miaodu).
For more information, see the following API documentation: CreateDataset - Create data source and RunSearchGeneration - Miaosou - Intelligent search.