Actions37
- 对话 Actions
- 知识库 Actions
- 集合 Actions
- 数据 Actions
- 应用 Actions
数据 → 更新单条数据
AI-generatedSummary
Updates a single data entry in a FastGPT knowledge-base collection by sending a PUT request to /core/dataset/data/update with the new content, indexes and metadata.
Inputs
- dataKnowledgeId (required) — 选择知识库: dropdown of knowledge bases (type 'dataset') loaded from /core/dataset/list. Sent as body field datasetId.
- dataCollectionId (required) — 集合ID: ID of the collection that holds the data. Sent as collectionId.
- dataIdToUpdate (required) — 数据ID: ID of the data entry to modify. Sent as dataId.
- dataQ — 主要数据(q): main content used for vectorization and retrieval matching. Multi-line text, sent as q.
- dataA — 辅助数据(a): auxiliary content such as an answer or supplementary notes. Sent as a.
- dataFullTextToken — 分词: custom full-text search tokens. If left empty, FastGPT generates them automatically. Sent as fullTextToken.
- dataIndexes — 向量索引: JSON array of up to 5 indexes. Each has type (default/custom/summary/question/image, default custom), dataId (linked vector ID; if given, the index is updated incrementally) and text (required). The node parses a string value into an array before sending. Invalid JSON is silently sent as an empty array [].
- dataUpdateTime — 更新时间: ISO date string such as 2024-01-01T00:00:00.000Z. If empty, the current time is used. Sent as updateTime.
- requestOptions — Node-level request settings: batching (items per batch and interval), ignore SSL issues, proxy, and timeout (default 10000 ms).
Output shape
The parsed JSON response from the FastGPT update endpoint, returned as the node's output item(s).
A postReceive check throws a NodeApiError if the HTTP status is 4xx/5xx or the response body's code is not 200. The error message comes from the body's message field. The exact success body is not defined in the node, so it is whatever FastGPT returns. Because empty strings are routed into the body, leaving optional fields blank still sends them (for example a blank q or a), which may overwrite existing content depending on server behavior.
Examples
Example 1: Correct the answer text of an FAQ entry in a knowledge base.
Pick the knowledge base, set 集合ID and 数据ID, then fill 主要数据(q) with the question and 辅助数据(a) with the corrected answer.
Example 2: Replace the custom vector indexes of an entry.
Set the IDs and q, then set 向量索引 to [{"type":"custom","text":"alternate phrasing"}]. Include dataId in an index to update it incrementally.