CheapAI icon

CheapAI

Consume Cheap AI

Actions5

Overview

The node "CheapAI" provides text editing capabilities using AI models. Specifically, for the Text resource with the Edit operation, it sends an input text along with an instruction to an AI model that generates an edited version of the text based on the instruction. This is useful for tasks such as fixing spelling mistakes, rephrasing sentences, or applying specific stylistic changes to text.

Common scenarios include:

  • Automatically correcting grammar and spelling errors in user-generated content.
  • Simplifying complex text according to given instructions.
  • Custom text transformations like changing tone or style.

For example, you could input a sentence with typos and instruct the model to fix spelling mistakes, receiving a corrected output.

Properties

Name Meaning
Model The AI model used to generate the edited text. Options: code-davinci-edit-001, text-davinci-edit-001.
Input The original text string that needs to be edited.
Instruction A textual instruction guiding how the input text should be edited (e.g., "Fix the spelling mistakes").
Simplify Boolean flag indicating whether to return a simplified response containing only the essential data or the full raw response. Defaults to true.
Options Additional optional parameters to customize the editing behavior:
  Echo Prompt Whether to echo back the prompt along with the completion (only for complete operation). Default false.
  Frequency Penalty Penalizes repeated tokens to reduce verbatim repetition. Range: -2 to 2. Default 0.
  Maximum Number of Tokens Maximum tokens to generate in the completion. Default 16. Max 32768.
  Number of Completions How many completions to generate per prompt. Default 1.
  Presence Penalty Penalizes new tokens based on their presence in the text so far to encourage new topics. Range: -2 to 2. Default 0.
  Sampling Temperature Controls randomness of output. Range: 0 to 1. Default 1.
  Top P Controls diversity via nucleus sampling. Range: 0 to 1. Default 1.

Output

The node outputs JSON data under the json field. By default (when Simplify is enabled), the output contains a simplified structure with a data property holding the array of choices returned by the AI model. Each choice typically includes the edited text result.

If Simplify is disabled, the node returns the full raw response from the AI service, which may contain additional metadata and details about the request.

The node does not output binary data.

Dependencies

  • Requires an API key credential for accessing the Cheap AI service.
  • The base URL for the API is configurable via credentials.
  • No other external dependencies are indicated.

Troubleshooting

  • Common issues:
    • Invalid or missing API key credential will cause authentication failures.
    • Exceeding token limits (maxTokens) can cause errors or truncated responses.
    • Providing empty or invalid input or instruction may lead to unexpected or empty results.
  • Error messages:
    • HTTP errors from the API (e.g., 401 Unauthorized) indicate credential problems.
    • Rate limit errors may occur if too many requests are sent in a short time.
  • Resolutions:
    • Verify and update the API key credential.
    • Adjust maxTokens and number of completions to reasonable values.
    • Ensure input and instruction fields are properly filled.

Links and References

Discussion