Overview
This node integrates with AI language models from providers like Gemini and OpenAI to generate text completions based on user prompts. It supports selecting the provider, model, and various generation options such as maximum tokens, safety settings, temperature, and sampling parameters. The node is useful for automating content creation, chatbots, summarization, and other natural language processing tasks.
Use Case Examples
- Generating text completions using Gemini or OpenAI models.
- Customizing prompt and generation parameters for tailored AI responses.
- Applying safety filters to block harmful content in generated text.
Properties
| Name | Meaning |
|---|---|
| Provider | Selects the AI model provider (Gemini or OpenAI). |
| Model Name or ID | Specifies the model to use for text generation, either from a list or via expression. |
| API Key | API key for custom provider authentication, shown only if provider is custom. |
| Custom Prompt | Boolean flag to enable entering a custom prompt string. |
| Prompt | The text prompt to send to the AI model when custom prompt is enabled. |
| Options | Additional generation options including max tokens, safety settings, temperature, top K, and top P sampling parameters. |
Output
JSON
completion- The generated text completion from the AI model.model- The model name or ID used for generation.provider- The AI provider used (Gemini or OpenAI).usage- Token usage statistics for the request.
Dependencies
- Requires API key credentials for the selected AI provider.
Troubleshooting
- Ensure the API key is valid and has permissions for the selected provider.
- Check that the model name or ID is correct and supported by the provider.
- Verify that the prompt is not empty when custom prompt is enabled.
- Adjust safety settings if completions are blocked unexpectedly.
- Lower max tokens or adjust temperature if generation is slow or incomplete.
Links
- n8n AI Node Documentation - Official documentation for AI integration node in n8n.
- OpenAI Models Documentation - Details on available OpenAI models and parameters.
- Gemini AI Developer Portal - Resources and API reference for Gemini AI provider.