Actions2
- Prompt Actions
- Image Actions
Overview
The node integrates with the Straico API to generate text completions based on user prompts. It allows users to select one or more language models and send a message prompt to receive generated text completions. This is useful for scenarios such as content creation, chatbots, summarization, or any application requiring AI-generated text responses.
For example, a user can input a question or partial sentence, select a model like "anthropic/claude-3-haiku:beta", and get a creative or factual completion from the AI. Additional options allow controlling the creativity level (temperature), maximum length of the output, and providing URLs to files or YouTube videos for context analysis.
Properties
| Name | Meaning |
|---|---|
| Models | Select one or multiple AI models to use for generating the completion. |
| Message | The input text prompt or message to send to the model for completion. |
| File URLs | (Optional) Comma-separated list of file URLs that the model should analyze for context. |
| YouTube URLs | (Optional) Comma-separated list of YouTube video URLs to analyze for additional context. |
| Temperature | Controls creativity and diversity of the generated text; ranges from 0 (deterministic) to 2 (very creative). Default is 0.7. |
| Max Tokens | Maximum number of tokens (words/pieces) to generate in the completion. Range: 1 to 2048. Default is 100. |
Output
The node outputs JSON data containing the completion results returned by the Straico API. The exact structure depends on the API response but typically includes the generated text completions corresponding to the input prompt and selected models.
No binary data output is indicated for this operation.
Dependencies
- Requires an API key credential for the Straico API.
- The node makes HTTP requests to
https://api.straico.com/v1/prompt/completion. - The node dynamically loads available models from the Straico API endpoint
/v1/models.
Troubleshooting
- Missing API Key: If the API key credential is not provided or invalid, the node will fail to authenticate. Ensure the API key is correctly configured in n8n credentials.
- Invalid Model Selection: Selecting models not supported or unavailable may cause errors. Use the dynamic model loader to pick valid models.
- Malformed URLs: File URLs or YouTube URLs must be comma-separated strings; improper formatting may lead to request failures.
- Temperature Out of Range: Values outside 0 to 2 for temperature may be rejected by the API.
- Max Tokens Limits: Setting max tokens below 1 or above 2048 may cause errors.
Common error messages usually relate to authentication failure, invalid parameters, or network issues. Verify credentials, input formats, and network connectivity to resolve these.
Links and References
- Straico API Documentation: https://api.straico.com/docs (assumed, please verify)
- n8n Documentation on Custom Nodes: https://docs.n8n.io/integrations/creating-nodes/