FastGPT icon

FastGPT

AI智能客服平台

集合 → 获取集合列表

AI-generated

Summary

Lists collections (files and folders) inside a FastGPT knowledge base via POST /core/dataset/collection/listV2, with offset pagination and optional fuzzy search.

Inputs

  • 父级目录ID (datasetParentId) — Folder ID to list within, sent as body parentId. Copy it from the browser URL when the folder is open in FastGPT. Leave empty for the root. It also filters the knowledge base dropdown.
  • 选择知识库 (datasetKnowledgeId) — The knowledge base to list, sent as body datasetId. The dropdown is loaded from /core/dataset/list and shows only items of type 'dataset'. It is not marked required, but the API needs a dataset ID.
  • 偏移量 (datasetPageNum) — Pagination offset, sent as body offset. Starts at 0. Default 0.
  • 每页数量 (datasetPageSize) — Page size, sent as body pageSize. Default 30.
  • 模糊搜索文本 (datasetSearchText) — Fuzzy-search text, sent as body searchText. Default is empty.
  • Request Options — Node settings for batching (items per batch, interval), ignoring SSL certificate errors, a proxy URL, and a timeout (default 10000 ms).

Output shape

The FastGPT API JSON response, passed through unchanged. It is the full response body, typically with code, message and data holding the collection list.

Errors are raised as a NodeApiError. This happens on any HTTP 4xx/5xx status or when the body code is not 200. The error message comes from the body message or the status message. Pagination is manual: raise the offset by the page size to fetch the next page. The exact fields in data are not defined in the node source.

Examples

Example 1: List the first 30 collections in the root of a knowledge base

Select the knowledge base, leave the parent folder ID empty, keep offset 0 and page size 30.

Example 2: Find collections whose name matches a keyword inside a folder

Set the parent folder ID, select the knowledge base, and set the fuzzy search text to the keyword.

Example 3: Fetch the second page of 50 results

Set the page size to 50 and the offset to 50.

Links

Discussion