Actions37
- 对话 Actions
- 知识库 Actions
- 集合 Actions
- 数据 Actions
- 应用 Actions
集合 → 创建一个空的集合
AI-generatedSummary
Creates an empty collection in a FastGPT knowledge base, either as a folder or as a virtual (manual) collection, by POSTing to /core/dataset/collection/create.
Inputs
- 选择知识库 (datasetKnowledgeId) — Target knowledge base, picked from a dropdown loaded from /core/dataset/list (only items of type 'dataset', sorted by name). Sent as body.datasetId. The dropdown is filtered by the parent directory ID.
- 父级目录ID (datasetParentId) — ID of the parent folder, copied from the browser URL when the folder is open in FastGPT. Sent as body.parentId. Leave empty for the root.
- 名称 (datasetName) (required) — Name of the new collection. The field description suggests using the file name. Sent as body.name.
- 类型 (datasetType) (required) — Kind of collection to create: 文件夹 (folder, the default) or 虚拟集合(手动集合) (virtual). Sent as body.type.
- Request Options — Node-level HTTP settings: batching (items per batch, interval), ignore SSL issues, proxy, and timeout (default 10000 ms).
Output shape
The parsed JSON response from the FastGPT API for the create call, one item per input item. It typically contains the new collection's ID, but the source doesn't define the exact fields.
The node throws a NodeApiError if the HTTP status is 4xx or 5xx, or if the response body's
codeis not 200. The error message comes from the body'smessage. Credentials (fastGPTApi) supply the base URL.
Examples
Example 1: Create a folder at the root of a knowledge base to organize imported documents.
选择知识库 = target knowledge base; 父级目录ID empty; 名称 = 'Product Docs'; 类型 = 文件夹.
Example 2: Create a virtual collection inside an existing folder to hold manually added data.
父级目录ID = the folder's ID; 选择知识库 = target knowledge base; 名称 = 'FAQ'; 类型 = 虚拟集合(手动集合).