DataForSEO Content Generation API icon

DataForSEO Content Generation API

DataForSEO

Generate Text From Initial Input (Deprecated)

AI-generated

Summary

Generates text based on an initial input prompt, extending it with configurable parameters.

Inputs

  • text (required) — The initial text or prompt to generate additional content from.
  • max_new_tokens — The maximum number of new tokens to generate (required if max_tokens is not specified).
  • max_tokens — The total maximum number of tokens for the entire response (required if max_new_tokens is not specified).
  • creativity_index — A value between 0 and 1 indicating the creativity of the generation (default 0.8).
  • token_repetition_penalty — A penalty applied to tokens that have been repeated to reduce repetition (default 1).
  • top_k — The number of initial tokens to consider for choosing the next word (default 40).
  • top_p — Filters tokens based on cumulative probability (default 0.9).
  • temperature — Controls the randomness of the output (default 0.7).
  • avoid_words (required) — A list of words or phrases to exclude from the generated text (up to 50).
  • avoid_starting_words (required) — A list of words or phrases to exclude from the beginning of the generated text (up to 50).
  • stop_words (required) — A list of words or phrases that cause the generation to stop (up to 50).
  • supplement_token — A token to continue generation from a previous response.

Output shape

The raw API response object from DataForSEO containing the generated text and metadata.

The node returns the API response for each input item. The response is mapped to the item's JSON property. The node implements polling to wait for the task to complete (up to 150 iterations).

Examples

Example 1: Extend a product description with a marketing tagline.

Use the 'text' parameter with the product description and add 'Free shipping', 'High quality', and 'Guaranteed' to the 'avoid_words' list to ensure they are not used in the output.

Example 2: Generate a blog post intro.

Provide a topic in 'text' and set a 'max_new_tokens' value of 150 to control the length of the generated intro.

Links

Discussion