Actions21
Overview
This node implements a conversational completion feature for the resource "跃问" with the operation "对话补全" (dialogue completion). It allows users to send a series of messages to an AI model or assistant and receive generated responses. The node supports shaping the assistant's behavior by specifying roles for each message, such as user, assistant, or system, which helps guide the conversation context.
Common scenarios where this node is beneficial include:
- Building chatbots that simulate human-like conversations.
- Creating interactive assistants that respond based on prior dialogue.
- Generating text completions or replies in customer support or content creation workflows.
For example, a user can input a sequence of messages representing a conversation history, specify the role of each message, and get a coherent response from the selected AI model. Additionally, the node supports voice synthesis options to convert text responses into speech using various official or cloned voices.
Properties
| Name | Meaning |
|---|---|
| 模型 | The AI model or intelligent agent to use for generating responses. |
| 消息 | A collection of messages forming the conversation history. Each message includes: |
| - 文本: The text content of the message to send. | |
| - 角色: The role of the message sender, influencing the assistant's response style. Options: | |
| - 用户 (user): Message from the user seeking a response. | |
| - 助手 (assistant): Message from the assistant, used to set tone or personality. | |
| - 系统 (system): System-level instructions or context for the model. | |
| 简化输出 | Boolean flag indicating whether to return a simplified version of the response instead of raw data. |
| 语音列表 | Voice selection for text-to-speech output. Supports: |
| - 官方发音人: Official voices selectable from a searchable list. | |
| - 克隆发音人: Custom cloned voices specified by string identifier. |
Output
The node outputs JSON data containing the AI-generated response to the input messages. If text-to-speech is enabled, it may also provide audio data synthesized in the selected voice.
json: Contains the structured response from the AI model, typically including the generated text reply.- Binary data (if TTS is used): Audio files representing the spoken version of the response.
Dependencies
- Requires access to an external AI service capable of conversational completions.
- For voice synthesis, depends on a text-to-speech service providing multiple official and cloned voices.
- The node uses internal routing logic (
actions/router) to handle execution, implying configuration of API credentials or tokens for authentication with these services.
Troubleshooting
- Missing or invalid model identifier: Ensure the "模型" property is correctly set; otherwise, the AI service may reject requests.
- Improper message formatting: Each message must have valid text and a recognized role; missing fields can cause errors.
- Voice selection issues: When using TTS, selecting an unsupported or unavailable voice may lead to failures.
- API authentication errors: Verify that required API keys or tokens are configured properly in n8n credentials.
- Simplify output flag confusion: If enabled, the response format differs; downstream nodes should handle both raw and simplified formats accordingly.
Links and References
- No direct external links provided in the source code.
- For more information on conversational AI and text-to-speech integration, consider exploring:
- OpenAI Chat Completion API documentation
- Text-to-Speech service provider docs relevant to your environment