Actions2
Overview
This node integrates with various large language models (LLMs) to generate text responses or process videos based on user input. It is designed primarily for AI-driven text generation tasks, such as creating content, answering questions, or generating creative writing prompts. Additionally, it supports a video processing operation that sends a video URL and prompt to an external service for analysis or transformation.
Common scenarios:
- Generating natural language text completions or responses using different LLM models.
- Applying safety filters to control the type of content generated (e.g., blocking hate speech or harassment).
- Processing videos by sending them to a dedicated video processing endpoint with a prompt.
Practical examples:
- Creating chatbot replies or customer support answers dynamically.
- Generating marketing copy or blog post drafts.
- Sending a video URL along with instructions to extract insights or perform transformations on the video content.
Properties
| Name | Meaning |
|---|---|
| Operation | Choose between "Generate Text" (text generation) or "Process Video" (video processing). |
| Model Type | Select the LLM model to use for text generation. Options include Gemini variants, Llama models, Mistral, Mixtral, WizardLM, etc. |
| Prompt | The input text prompt you want the LLM to respond to or use as context. |
| Temperature | Controls randomness in text generation; higher values produce more diverse outputs (default 0.7). |
| Max Tokens | Maximum length of the generated response in tokens (default 2048). |
| Top P | Nucleus sampling parameter controlling token selection breadth (default 1). |
| Top K | Limits token selection to top K candidates (default 2). |
| Safety Settings : Hate Block | Level of filtering for hate speech content: None, Low, Medium, High. Available only for certain Gemini models. |
| Safety Settings : Harassment Block | Level of filtering for harassment content: None, Low, Medium, High. Available only for certain Gemini models. |
| Safety Settings : Sexual Block | Level of filtering for sexual content: None, Low, Medium, High. Available only for certain Gemini models. |
| Safety Settings : Dangerous Content Block | Level of filtering for dangerous content: None, Low, Medium, High. Available only for certain Gemini models. |
| Video URL | URL of the video to be processed (only shown when Operation is "Process Video"). |
Output
The node outputs JSON data structured as follows:
For Generate Text operation:
- The JSON contains the response from the LLM API, which typically includes the generated text completion or answer.
- The exact structure depends on the external API but generally includes fields like the generated text and metadata about the generation.
For Process Video operation:
- The JSON contains the response from the video processing service, which may include analysis results, extracted data, or transformed video information.
If an error occurs during the request, the output JSON will contain an error field with the error message.
The node does not output binary data.
Dependencies
- Requires an API key credential for authentication with the external AI service.
- The domain URL for the AI API is provided via credentials.
- For video processing, the node calls a fixed external endpoint (
https://k8fm9r7b-8000.uks1.devtunnels.ms/process-video). - The node uses HTTP POST requests with JSON payloads to communicate with these services.
Troubleshooting
No credentials returned!
This error indicates missing or misconfigured API credentials. Ensure that the required API key credential is set up correctly in n8n.Request errors (network issues, invalid parameters)
Errors during HTTP requests to the AI or video processing endpoints will throw exceptions. If "Continue On Fail" is enabled, the node returns the error message in the output JSON; otherwise, it stops execution with an error.Invalid or unsupported model types
Selecting a model not supported by the backend API may cause errors. Verify the model name matches one of the listed options.Incorrect property values
Providing invalid values for temperature, max tokens, or safety settings might lead to unexpected behavior or API rejections.
Links and References
- No direct external links are embedded in the code. Users should refer to their AI service provider's documentation for details on model capabilities and API usage.
- For video processing, the endpoint appears custom and may require separate documentation from the service owner.
