Overview
This node provides integration with a large language model (LLM) API, allowing users to perform two main operations: "Chat" and "Video". For the "Video" operation specifically, the node accepts a prompt and a selected model to generate video-related content or responses based on that prompt. This can be useful for automating video script generation, creating video descriptions, or generating video-related text content dynamically.
Practical examples include:
- Generating a video script from a user prompt.
- Creating video metadata or captions automatically.
- Using AI to brainstorm video ideas or summaries.
Properties
| Name | Meaning |
|---|---|
| Model Name or ID | Choose an LLM model from a dynamically loaded list or specify a model ID via expression. |
| Prompt | The text prompt you want the LLM to respond to, guiding the video content generation. |
Output
The node outputs a JSON object containing at least the following fields:
operation: The operation performed ("video").modelType: The model used for the operation.
Since the provided code only shows these fields being returned in the output JSON, it suggests that the actual response from the LLM API is not handled or included in this snippet. Typically, one would expect the node to return the generated video content or related data in the output JSON.
No binary data output is indicated for the "Video" operation.
Dependencies
- Requires an API key credential for accessing the external LLM service.
- Makes HTTP GET requests to
https://ai.system.sl/llm-modelsto load available models. - The node depends on n8n's HTTP request helper and credential management.
Troubleshooting
- Error loading models: If the node cannot fetch the list of models, it logs an error and returns a placeholder option "Error Loading Models". Ensure the API key credential is valid and has network access.
- No credentials returned: The node throws an error if no API key credential is found. Verify that the required API authentication token is configured correctly.
- Invalid API response: If the model list API does not return an array, the node raises an error. Check the API endpoint and its availability.
- Empty or invalid prompt: Since the prompt is required for meaningful output, ensure it is properly set.
Links and References
- n8n Expressions Documentation
- External LLM API documentation (not provided in source; check your API provider)
Note: The current implementation of the execute() method for the "Video" operation only prepares and returns basic parameters without performing the actual API call to generate video content. Additional implementation would be needed to complete the functionality.