Actions2
Overview
This node integrates with StrangeLogic large language models (LLMs) to generate text based on a user-provided prompt. It supports multiple advanced AI models, allowing users to customize the generation parameters such as randomness, token limits, and sampling strategies. The node is useful for automating content creation, generating conversational responses, drafting text, or any scenario requiring AI-generated natural language output.
For example, you can use this node to:
- Generate creative writing prompts or story continuations.
- Produce customer support replies automatically.
- Summarize or rephrase input text.
- Experiment with different LLM models to compare outputs.
Properties
| Name | Meaning |
|---|---|
| Model Type | Selects the AI model to use for text generation. Options include Gemini variants, Llama models, Mistral, Mixtral, WizardLM, and others. |
| Prompt | The input text prompt that the LLM will respond to or continue from. |
| Temperature | Controls randomness in the generated text; higher values produce more diverse outputs. |
| Max Tokens | Maximum length (in tokens) of the generated response. |
| Top P | Nucleus sampling parameter controlling the diversity by limiting token selection to a cumulative probability. |
| Top K | Limits token selection to the top K most likely tokens at each step. |
| Saftey Settings : Hate Block | Level of filtering applied to block hateful content. Available only for certain Gemini models. Options: None, Low, Medium, High. |
| Saftey Settings : Harrasment Block | Level of filtering applied to block harassment content. Available only for certain Gemini models. Options: None, Low, Medium, High. |
| Saftey Settings : Sexual Block | Level of filtering applied to block sexual content. Available only for certain Gemini models. Options: None, Low, Medium, High. |
| Saftey Settings : Dangerous Content Block | Level of filtering applied to block dangerous content. Available only for certain Gemini models. Options: None, Low, Medium, High. |
Output
The node outputs JSON data containing the response from the selected LLM API. The structure typically includes the generated text or an error message if the request failed. The exact JSON structure depends on the external API response but generally contains fields representing the generated completion.
If the operation were "video" (not requested here), it would process video URLs and return related JSON data, but for the "Generate Text" operation, the output is purely textual JSON.
No binary data output is produced by this operation.
Dependencies
- Requires an API key credential for authentication with the StrangeLogic LLM service.
- The node sends HTTP POST requests to the configured domain endpoint of the LLM API.
- Proper network access to the API endpoint is necessary.
- No additional environment variables are explicitly required beyond the API credentials.
Troubleshooting
- No credentials returned!: This error occurs if the node cannot find the required API key credential. Ensure the credential is properly configured in n8n.
- API request failures: Network issues, invalid API keys, or incorrect endpoint domains can cause errors. Check connectivity and credential validity.
- Continue on Fail behavior: If enabled, the node will output error messages per item instead of stopping execution.
- Model compatibility: Safety settings are only applicable to specific Gemini models. Using them with unsupported models may have no effect.
- Parameter validation: Providing invalid values for temperature, max tokens, or sampling parameters might lead to API errors. Use recommended ranges.
Links and References
- StrangeLogic LLM API Documentation (replace with actual URL if available)
- General concepts on Temperature in Language Models
- Explanation of Top-p (Nucleus) Sampling
- Explanation of Top-k Sampling
