FreeLim icon

FreeLim

逆向LLM

Overview

This node implements a conversational AI interface for the "智谱清言" resource, specifically supporting the "对话补全" (dialogue completion) operation. It allows users to send a series of messages with roles (user, assistant, system) to an AI model or agent, which then generates a contextual response to continue the conversation.

Common scenarios include:

  • Building chatbots that maintain context over multiple turns.
  • Creating virtual assistants that respond in different personas or tones.
  • Automating customer support conversations with dynamic role-based inputs.

For example, a user can send a message as "用户" (user), set some system instructions as "系统" (system), and receive a reply from the assistant modeled as "助手" (assistant).

Properties

Name Meaning
模型 The AI model or intelligent agent identifier to use for generating responses.
消息 A collection of messages forming the conversation history. Each message has:
- 文本: The content of the message to send.
- 角色: The role shaping the model's behavior and interaction style. Options: 用户, 助手, 系统.
简化输出 Whether to return a simplified version of the response instead of the raw data (true/false).
语音列表 Selection of voice profiles for text-to-speech output if enabled. Includes official and cloned voices.

Output

The node outputs JSON data representing the AI-generated completion of the dialogue based on the input messages and selected model. If text-to-speech is used, it may also output audio data corresponding to the chosen voice profile.

The json output typically contains the generated text response from the assistant. If binary data is present, it corresponds to synthesized speech audio matching the response.

Dependencies

  • Requires access to the 智谱清言 AI service API.
  • Needs an API authentication token or key configured in n8n credentials (generic API key credential).
  • For voice synthesis, requires selection of a valid voice token from the provided list, which is fetched dynamically via a search method.

Troubleshooting

  • Missing or invalid model identifier: Ensure the "模型" property is correctly set; otherwise, the AI service may reject the request.
  • Improper message formatting: Each message must have valid content and a recognized role ("用户", "助手", or "系统"). Invalid roles or empty content may cause errors.
  • API authentication errors: Verify that the API key or token is properly configured and has sufficient permissions.
  • Voice selection issues: When using TTS, ensure the selected voice exists in the available list; otherwise, audio generation will fail.
  • Simplify output toggle: If unexpected data structure is returned, try toggling the "简化输出" option to get raw or simplified responses.

Links and References

  • 智谱清言 Official Documentation (Chinese)
  • n8n Documentation on creating custom nodes and handling API credentials
  • General AI chatbot design principles and best practices

Discussion