FreeLim icon

FreeLim

逆向LLM

Overview

This node implements a conversational AI completion feature for the "秘塔AI" resource, specifically supporting the "对话补全" (dialogue completion) operation. It allows users to send a sequence of messages with roles (user, assistant, system) to an AI model or agent and receive a generated response that continues or completes the conversation.

Common scenarios include:

  • Building chatbots that simulate human-like conversations.
  • Automating customer support interactions.
  • Generating text completions or replies based on prior dialogue context.
  • Experimenting with different AI models or personas by selecting various predefined models.

Practical example:
A user sends a message as "user" role asking a question, optionally sets some system instructions, and the node returns the assistant's reply completing the conversation.

Properties

Name Meaning
模型 (assistantId) The AI model or intelligent agent to use for generating responses. Options include: 全网-简洁, 全网-深入, 全网-研究, 学术-简洁, 学术-深入, 学术-研究. If resource is not "mit", this can be any string (free text).
消息 (messages) A collection of messages forming the conversation history. Each message has:
- 文本 (content): The message text to send.
- 角色 (role): The role shaping the model's behavior, options are 用户 (user), 助手 (assistant), 系统 (system).
简化输出 (simplify) Boolean flag indicating whether to return a simplified version of the response instead of raw data. Defaults to true.
语音列表 (voice) Selects a voice for text-to-speech output if TTS is used. Multiple modes available:
- 官方发音人: Official voices list (e.g., 思远, 心悦, 子韬, 灵儿, etc.)
- 克隆发音人: Custom cloned voice token string. Required if TTS enabled.

Output

The node outputs JSON data representing the AI-generated completion of the conversation based on the input messages and selected model. The exact structure depends on the API response but generally includes:

  • The assistant's reply text.
  • Possibly metadata about the generation.
  • If text-to-speech is enabled, audio data may be included or referenced via the selected voice.

Binary data output is not explicitly shown in the source but may be supported when using TTS voices.

Dependencies

  • Requires access to the 秘塔AI service API.
  • Needs appropriate API credentials or authentication tokens configured in n8n (not detailed in source).
  • For voice selection, uses a method ttsListSearch to fetch official voice options dynamically.
  • The main execution logic delegates to an imported router module (./actions/router), which handles the actual API calls.

Troubleshooting

  • Missing or invalid model: If the specified model/agent ID is incorrect or unsupported, the API may return errors or no meaningful response. Verify model names especially when not using predefined options.
  • Message format issues: Ensure each message includes both content and a valid role; missing fields may cause request failures.
  • TTS voice selection: If text-to-speech is enabled but no valid voice is selected, audio generation will fail.
  • API connectivity: Network issues or invalid credentials will prevent successful calls to the AI service.
  • Simplify flag: Setting simplify to false may return complex raw data structures that require additional parsing.

Common error messages likely relate to invalid parameters, authentication failures, or exceeding usage limits. Checking logs and verifying configuration usually resolves these.

Links and References

  • No direct external links provided in the source code.
  • Users should refer to the official 秘塔AI API documentation for details on models, message formats, and authentication.
  • For voice options, consult the TTS voice list exposed by the node’s search method.

Discussion