FastGPT icon

FastGPT

AI智能客服平台

对话 → 多模态对话

AI-generated

Summary

Sends a chat request to a FastGPT app via POST /v1/chat/completions (OpenAI-compatible), building the messages array from text, image URLs and document URLs, and returns the API response.

Inputs

  • chatId (required) — Session ID sent as chatId in the body. Default 'n8n-chat-id'. Reuse it to continue a conversation.
  • prompt (required) — Sortable list of messages. Each has a role (assistant/system/user) and text content. For user messages, an optional image URL and an optional document URL (with file name including extension) can be added. If an image or document URL is present, content is sent as an array of text, image_url and file_url parts. Otherwise it is sent as a plain string.
  • variables — Key/value pairs sent as the FastGPT module variables object.
  • detail — Sent as detail in the body (the 响应对话 toggle). Default false.
  • responseChatItemId — Optional ID for the response chat item, used for tracking.
  • stream — Sent as stream in the body. Default false. The node does not process streamed responses itself, so leave it off unless you know the response will be handled.
  • simplifyOutput — When on, the output is reduced to the response's choices array, one item per choice, each carrying its message.
  • requestOptions — Node settings for batching (items per batch, interval), ignoring SSL errors, proxy and timeout (default 10000 ms).

Output shape

By default, the full FastGPT/OpenAI-style completion response JSON. With Simplify Output on, one item per entry in choices, each including its message.

Errors are raised as NodeApiError if the HTTP status is 4xx or 5xx, or if the response body's code is not 200. Requires the fastGPTApi credential, whose baseUrl is used. The request returns one response per input item.

Examples

Example 1: Ask a question about an image

chatId 'session-1'; one user message with text 'What is in this picture?' and an image URL; Simplify Output on.

Example 2: Summarize a PDF with a system prompt

Two messages: a system message with instructions, and a user message with a document URL and file name 'report.pdf'.

Example 3: Pass app variables

A user message plus variables such as key 'language' and value 'en'.

Links

Discussion