Overview
This node integrates with a large language model (LLM) API to perform two main operations: generating chat completions and processing videos based on prompts. It is useful for automating content generation, natural language understanding, or video analysis tasks that require AI-powered responses.
- Chat operation: Sends a text prompt to an LLM and receives a generated response. This can be used for conversational agents, content creation, summarization, or any scenario where you want the AI to generate or complete text.
- Video operation: Sends a prompt along with a video URL to the API for processing. This could be used for video captioning, analysis, or extracting insights from video content.
Practical examples:
- Automatically generate customer support replies based on user queries.
- Create video summaries or extract metadata by providing a video URL and a descriptive prompt.
Properties
| Name | Meaning |
|---|---|
| Model Name or ID | Choose the LLM model to use from a dynamically loaded list or specify an ID via expression. Only shown for the Chat operation. |
| Prompt | The input text prompt you want the LLM to respond to or use as context for video processing. |
| Operation | Select between "Chat" (text generation) and "Video" (video processing). |
Note: For the Video operation, only "Prompt" and "Operation" are relevant inputs according to the provided properties.
Output
The node outputs an array of JSON objects, each corresponding to one input item processed:
- For Chat operation: The output JSON contains the LLM's generated response. The exact structure depends on the API but generally includes the generated text or JSON response if requested.
- For Video operation: The output JSON contains the result of the video processing request, which may include analyzed data, captions, or other metadata returned by the API.
No binary data output is indicated in the code.
Dependencies
- Requires an API key credential for authentication with the external LLM service.
- Makes HTTP requests to the API endpoints:
https://ai.system.sl/llm-modelsto load available models.${domain}/llmsfor chat completions.${domain}/process-videofor video processing.
- The domain and API key are obtained from the configured credentials.
- The node expects the API to accept and return JSON-formatted data.
Troubleshooting
No credentials returned!
Error thrown if the required API key credential is missing or not configured properly. Ensure the API key is set up in n8n credentials.Error loading models
If the model list cannot be fetched, the node will show an error option. Check network connectivity and API key validity.API request failures
Errors during the HTTP requests (e.g., invalid parameters, server errors) will cause the node to throw exceptions unless "Continue On Fail" is enabled. Review the error message for details and verify the prompt, model selection, and video URL.Invalid operation or missing parameters
Make sure to select the correct operation ("Chat" or "Video") and provide all required inputs like prompt and video URL (for video).
Links and References
- n8n Expressions Documentation — for using expressions in property fields.
- External API documentation (not provided) would be needed for detailed usage of the LLM and video processing endpoints.