To add data to the knowledge base, you need to create an API for file collections
功能描述 如下是官方教程提供的添加数据的示例,但是要求提供collectionId,而不能创建collectionId
curl --location --request POST 'https://fastgpt.run/api/core/dataset/data/pushData' \
--header 'Authorization: Bearer apikey' \
--header 'Content-Type: application/json' \
--data-raw '{
"collectionId": "64663f451ba1676dbdef0499",
"mode": "chunk",
"prompt": "可选。qa 拆分引导词,chunk 模式下忽略",
"billId": "可选。如果有这个值,本次的数据会被聚合到一个订单中,这个值可以重复使用。可以参考 [创建训练订单] 获取该值。",
"data": [
{
"q": "你是谁?",
"a": "我是FastGPT助手"
}]
}
]
}'
在示例的教程中,必须指定collectionId,才能将数据添加到该文件集合中。
我本地有很多文件,我希望上传的每一个文件,在云端知识库中都是一个单独的文件集合collectionId。
期望能够提供API,能够根据本地的文件夹结构,在云端创建出类似本地文件夹的知识库结构。
期望提供:
- 创建文件夹的API
- 创建文件(文件集合
collectionId)的API
应用场景 这将实现本地知识库的结构,与本地文件夹结构一一对应。 能极大地方便用户,梳理、理顺知识库结构
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
Function description The following is an example of adding data provided by the official tutorial, but it requires a collectionId and cannot create a collectionId.
curl --location --request POST 'https://fastgpt.run/api/core/dataset/data/pushData' \
--header 'Authorization: Bearer apikey' \
--header 'Content-Type: application/json' \
--data-raw '{
"collectionId": "64663f451ba1676dbdef0499",
"mode": "chunk",
"prompt": "Optional. qa split guide word, ignored in chunk mode",
"billId": "Optional. If there is this value, this time's data will be aggregated into an order, and this value can be reused. You can refer to [Create Training Order] to obtain this value.",
"data": [
{
"q": "Who are you?",
"a": "I am FastGPT Assistant"
}]
}
]
}'
In the example tutorial, a collectionId must be specified in order to add data to the file collection.
I have a lot of files locally, and each file I want to upload will be a separate file collection collectionId in the cloud knowledge base.
It is expected to provide an API that can create a knowledge base structure similar to a local folder in the cloud based on the local folder structure.
Expected to provide:
- API for creating folders
- API for creating files (file collection
collectionId)
Application Scenario This will implement the structure of the local knowledge base, which corresponds to the local folder structure. It can greatly facilitate users to sort out and rationalize the structure of the knowledge base.
https://github.com/labring/FastGPT/issues/570#issuecomment-1886165927
参考这个不太正规的方式,测试传了1w+txt文件能用
4.6.7已支持接口。