FastGPT icon

FastGPT

AI智能客服平台

集合 → 创建一个外部文件库集合(商业版)

AI-generated

Summary

Creates a FastGPT dataset collection from an external file URL (commercial-edition feature) by POSTing to /proApi/core/dataset/collection/create/externalFileUrl. FastGPT downloads the file and splits it according to the chosen training settings.

Inputs

  • datasetParentId — Parent folder ID in FastGPT, copied from the browser URL. Sent as parentId. Also used to populate the knowledge base dropdown.
  • datasetKnowledgeId — Target knowledge base, picked from a list loaded from /core/dataset/list. Sent as datasetId.
  • datasetExternalFileUrl (required) — Access URL of the external file (a temporary link is fine). Sent as externalFileUrl.
  • datasetExternalFileId — ID identifying the file in the external system. Sent as externalFileId.
  • datasetExternalFileName (required) — Custom file name including the extension, e.g. 文档.pdf. Sent as filename.
  • datasetExternalCreateTime — File creation time in ISO format, e.g. 2024-01-01T00:00:00.000Z. Sent as createTime.
  • datasetExternalTags — Comma-separated tags. The node trims them, drops empty entries and sends an array as tags.
  • datasetTrainingType (required) — Either 'chunk' (split by text length, the default) or 'qa' (QA splitting). Sent as trainingType.
  • datasetChunkSize — Chunk length, default 3000. Only shown when the training type is chunk. Sent as chunkSize.
  • datasetChunkSplitter — Custom highest-priority split delimiter. Only shown when the training type is chunk. Sent as chunkSplitter.
  • datasetQAPrompt — Custom prompt for QA splitting. Only shown when the training type is qa. Sent as qaPrompt.
  • requestOptions — Standard request settings: batching, ignore SSL issues, proxy and timeout.

Output shape

The JSON response body from FastGPT for the created collection, one item per input item.

Errors are thrown as a NodeApiError if the HTTP status is 4xx/5xx or the response body's code is not 200. The message comes from the response's message field. The exact response fields aren't defined in the node. Requires the FastGPT commercial edition.

Examples

Example 1: Import a PDF from a pre-signed storage URL into a knowledge base, chunked by length.

Set the knowledge base, externalFileUrl to the signed URL, filename to 手册.pdf, training type chunk and chunk size 1000.

Example 2: Sync a document from an external system and tag it for later updates.

Set the external file URL, external file ID, filename, and tags 'policy,hr'. Use QA training type with a custom QA prompt.

Links

Discussion