FreeLim icon

FreeLim

逆向LLM

Overview

This node implements a conversational text completion feature for the "Kim" resource, specifically the "对话补全" (dialogue completion) operation. It allows users to send a series of messages with defined roles (user, assistant, system) to a language model or intelligent 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.
  • Creating interactive assistants that respond contextually based on prior messages.
  • Generating dialogue content for games or storytelling applications.

For example, a user can input a sequence of messages representing a conversation history, specify the role of each message, and get a coherent reply from the assistant modeled by the selected AI.

Properties

Name Meaning
模型 (assistantId) The model or intelligent agent identifier to use for generating responses. Can be any string; if unknown, a placeholder can be used.
消息 (messages) A collection of messages forming the conversation history. Each message includes:
- 文本 (content): The text content of the message.
- 角色 (role): The role shaping the model's response behavior:
• 用户 (user): Message from the user.
• 助手 (assistant): Message from the assistant, influencing tone/personality.
• 系统 (system): System-level instructions or context settings.
简化输出 (simplify) Boolean flag indicating whether to return a simplified version of the response instead of raw data. Defaults to true.
语音列表 (voice) Selection of voice profiles for text-to-speech output when TTS is enabled. Options include official voices and cloned voices. This property is required if TTS is used.

Output

The node outputs JSON data containing the model's generated response completing the dialogue based on the input messages. If text-to-speech (TTS) is enabled, it may also output audio data corresponding to the selected voice profile.

  • json: Contains the structured response from the model, typically including the assistant's reply text.
  • Binary data (if applicable): Represents synthesized speech audio matching the response text and chosen voice.

Dependencies

  • Requires access to an external conversational AI service or API capable of processing message sequences and returning dialogue completions.
  • For voice synthesis, depends on a TTS service providing multiple voice options.
  • Needs proper configuration of API credentials or authentication tokens in n8n to connect to these services.
  • The voice list is dynamically fetched via a search method integrated into the node.

Troubleshooting

  • Missing or invalid model identifier: Ensure the "模型" property is correctly set; using an unsupported or empty string might cause errors or unexpected results.
  • Improper message formatting: Each message must have valid content and a recognized role. Omitting these or using unsupported roles may lead to failures.
  • TTS voice selection issues: If TTS is enabled but no valid voice is selected, the node may error out or skip audio generation.
  • API connectivity problems: Network issues or incorrect API credentials will prevent successful calls to the external AI or TTS services.
  • Simplify flag confusion: Setting "简化输出" to false returns raw data which might be complex; users expecting plain text should keep it true.

Links and References

  • No direct external links are provided in the source code.
  • Users should refer to their conversational AI provider’s documentation for details on message formatting and model capabilities.
  • For TTS voice options, consult the relevant text-to-speech service documentation.

Discussion