Generate Text with Generative AI

Definition

The "Generate Text with Generative AI" action allows users to create text-based content and insights using Zenphi’s built-in generative AI integration. This action requires no setup since it leverages Zenphi’s AI account, making it easy to integrate AI-generated text into your workflows.

With this action, users can:

  • Generate creative, structured, or analytical text based on a given prompt.
  • Customize prompts and examples using the Prompt Gallery to match specific use cases.
  • Control the output format and structure with parameters like temperature, max length, and JSON formatting.

This action is ideal for automating content creation, data extraction, rewriting text in different styles, and more—without the need for an external API key. 🚀


Example Use Cases

  1. Creative Party Ideas
    Generate unique and fun ideas for dinner parties, events, or gatherings. Perfect for event planners or anyone looking to add creativity to their social gatherings.

  2. Extract Names to JSON
    Automatically extract names and places from a paragraph or text and convert them into a structured JSON format for easier data processing.

  3. Grammar Rewrite
    Improve the grammar and readability of a provided text. Useful for proofreading, editing, and enhancing writing clarity.

  4. Reverse Dictionary
    Use a definition to look up a word, making it a great tool for expanding vocabulary or finding precise terms based on descriptions.

  5. Science Fiction Writer
    Generate creative science fiction stories, such as a narrative about climate change. Ideal for writers looking for inspiration or content generation.

  6. Sentiment Analysis
    Analyze and classify the sentiment (positive, negative, or neutral) of a given sentence, useful for understanding feedback or customer opinions.

  7. Step-by-Step Instructions from Paragraph
    Automatically convert a paragraph of instructions into a well-organized bullet-point list, perfect for clearer presentations or instructional content.

  8. Style Rewrite
    Rewrite text according to a specific style or tone, like formal, casual, or professional. Useful for adapting content to fit different audiences or branding.

  9. Topic to Related Questions
    Generate relevant and insightful questions based on a given topic. Ideal for brainstorming, surveys, or creating educational content.

  10. Unhedge
    Make a sentence more assertive by removing hedging language (e.g., “maybe” or “I think”). Ideal for professional communications or strengthening arguments.


Inputs

Prompt

In generative AI, a prompt is the starting point or instruction you provide to the AI model to guide its response. It can be as simple as a sentence, a question, or a paragraph, depending on the task you're asking the AI to perform. A well-crafted prompt helps generate more accurate, relevant, and coherent output. In this action, you’ll need to define the prompt clearly to guide the AI model toward generating the desired output. The more specific and detailed your prompt, the better and more relevant the response will be.

Example:

  • If you want the AI to generate a creative idea for a party, your prompt might be: "Generate some unique dinner party theme ideas."
  • For grammar improvement, you could use: "Rewrite the following paragraph to improve grammar and clarity: [insert text]."
  1. Examples
    The Examples section allows you to provide specific instances of inputs and outputs that demonstrate how the AI should behave. These examples are used to train or fine-tune the AI’s understanding of how to handle similar situations. In addition to crafting your own examples, you can select pre-configured prompts from the Prompt Gallery that come with predefined examples for common use cases. This makes it easier to generate relevant results without needing to fully customize everything.

View Prompt Gallery

The View Prompt Gallery is a unique feature that allows you to choose from a variety of pre-defined templates, each designed to cater to specific content generation needs. This gallery acts as a quick starting point, offering a variety of tasks or objectives that the generative AI can help with.

When you select an option from the gallery, it automatically populates the Prompt and Examples fields with relevant content that aligns with the selected task. For example, if you choose the "Creative Party Ideas" gallery, the Prompt field will automatically be filled with a prompt such as “Generate creative and fun ideas for a dinner party,” and the Examples section may contain sample party ideas.

Customization After Selection

Once you select a gallery option, you can customize the Prompt and Examples fields further to ensure the generated output perfectly matches your needs.

  1. Modify the Prompt:

    • After selecting a gallery option, the Prompt field will display a pre-filled prompt designed for the chosen task.
    • You can edit or enhance this prompt to be more specific or to include more context. For example, if you choose "Creative Party Ideas", you might change the prompt to “Generate creative, themed dinner party ideas for a small group of friends interested in international cuisine.”
  2. Adjust the Examples:

    • The Examples section will provide a few sample input-output pairs related to the task. You can either use these as-is or modify them to better fit your specific needs. For instance, if the example shows a dinner party theme but you'd prefer an outdoor picnic, you can update the example to reflect that.
    • By adjusting these examples, you guide the AI in producing responses that are more in line with your exact requirements.

Prompt Gallery Categories

The View Prompt Gallery has a range of predefined categories, each aimed at different content generation goals. Some common categories might include:

  1. Creative Party Ideas: For generating ideas for various kinds of parties or gatherings.
  2. Extract Names to JSON: For structuring and extracting relevant names or locations from text into a JSON format.
  3. Grammar Rewrite: To improve the grammar and syntax of an existing piece of text.
  4. Science Fiction Writer: To help you craft stories or entire novels, especially in the science fiction genre.
  5. Topic to Related Questions: For generating insightful questions based on a given topic.

This gallery provides a powerful starting point for users who may not be sure how to phrase their prompts, but still want to customize them for more tailored responses. The Prompt Gallery ensures that you can leverage AI’s capabilities for a wide range of tasks, all while offering the flexibility to make adjustments and ensure a perfect output.


**Input **

The Input section is where you provide the information or text that the AI model will use to generate the output. This input can be a question, instruction, or content that the AI will process and transform into a meaningful response. For example, if you're asking the AI to generate creative party ideas, your input might be the theme or the setting for the party. Similarly, if you're asking for grammar rewrites, your input would be the paragraph you want the AI to improve.

Temperature

Temperature is a setting that controls the randomness of the generated response.

  • Higher Values (e.g., 1.0 or higher): Results in more creative and varied outputs. The AI may generate responses that are unexpected, creative, or out-of-the-box, which is useful for tasks that require novel or diverse ideas.
  • Lower Values (e.g., 0.2 - 0.3): Makes the response more deterministic, focused, and less random. This is useful when you want to ensure the generated text stays within a particular context or format.

A Temperature value of around 0.7 is often used as a good balance between creativity and predictability.

Maximum Length

Maximum Length specifies the maximum number of tokens (words, characters, and symbols) the AI is allowed to generate in its response. A token is typically about 4 characters of English text.

  • Increasing Maximum Length: Allows the AI to generate longer responses, such as detailed explanations, extended narratives, or complex instructions.
  • Decreasing Maximum Length: Limits the AI's output to shorter text, such as concise answers or summaries.

Be mindful of setting the maximum length according to the content you need. For example, if you're generating a list of party ideas, you might want a longer response; but if you're asking for a simple grammar correction, a shorter output might be sufficient.

Return JSON Object

The Return JSON Object option allows the output to be formatted as a JSON (JavaScript Object Notation) object. JSON is a lightweight data-interchange format used to represent structured data.

  • When enabled: The output will be structured in a machine-readable format, typically with key-value pairs, making it easier to process programmatically, integrate into other systems, or analyze.

  • Use Cases:

    • If you want to extract specific data like names, places, or dates from a paragraph, you may prefer the output in JSON format to neatly structure the information.
    • For tasks such as sentiment analysis or classification, JSON allows you to return results with labels and values, which can be easily used in downstream processes or applications.

When disabled, the output will be a plain text response instead of a structured JSON object.


**Output **

The Output section contains the final results generated by the AI model in response to the prompt and input you've provided. This output is the AI's interpretation or response based on the configuration settings such as temperature, maximum length, and whether JSON formatting is enabled.

  • Generated Output: This is the key result—the AI's text response based on the input prompt. It could be a direct answer, a piece of creative writing, a rewritten text, a list of ideas, or any other text-based result depending on the task. This output will reflect the instructions you set in the Examples and Prompt fields.

  • Total Tokens: This field indicates the total number of tokens used by the AI model for both the input prompt and the generated output. Tokens refer to the chunks of text processed by the AI (including spaces and punctuation). This information helps you understand how much of your token allowance has been consumed and can be important if you're tracking usage or if you're working with API limits, especially in paid plans.

Best Practices

  • Be Clear and Specific in Your Prompts: The clearer and more specific your prompt, the better and more accurate the AI's response will be. For example, if you're asking for creative writing, provide some context or boundaries for the AI to follow.

  • Adjust the Temperature According to Task:

    • For creative tasks (e.g., generating ideas, writing stories), use higher temperature values (e.g., 0.7 to 1.0).
    • For factual, deterministic outputs (e.g., grammar correction, summarization), use lower temperature values (e.g., 0.2 to 0.3).
  • Use Examples for Customization: Leverage the Examples field to customize the AI's behavior. Examples guide the AI on how to respond in a more tailored way, so it's useful for setting expectations or patterns.

  • Limit Maximum Length for Focused Responses: If you need concise answers, make sure to set a reasonable maximum length. For broader responses, allow more tokens, but be aware of your usage limits.

  • Enable Return JSON Object When Needed: If you are working with structured data, such as extracting information, sentiment analysis, or categorizing responses, enabling the Return JSON Object option is very useful.

  • Monitor Token Usage: Keep track of your token consumption, especially if you're working on a paid plan with a usage limit. Total tokens will help you manage how many requests and responses you can generate within your budget.

Example

Scenario: Generating Party Ideas

  • Prompt: "Generate some creative dinner party ideas for a small group of friends."
  • Examples:
    • Example 1: "Generate ideas for a dinner party with a casual, homey vibe."
    • Example 2: "Suggest creative themes for a dinner party."
  • Input: A short description of the party setting or atmosphere you want to create.
  • Temperature: 0.8 (creative and diverse ideas)
  • Maximum Length: 150 tokens (brief suggestions)
  • Return JSON Object: Disabled (you want simple text suggestions)

Generated Output:

  • "Here are a few creative dinner party ideas:
    1. "Themed Potluck Party – Each guest brings a dish from a different country."
    2. "Murder Mystery Dinner – Have a themed night where everyone plays a character and solves a mystery."
    3. "DIY Pizza Party – Provide a variety of toppings for guests to make their own pizza."

Total Tokens: 65 tokens (prompt + output)


This documentation is designed to guide users through the different steps and configuration options available to produce text-based insights or responses using Zenphi's generative AI integration. Whether you're generating creative ideas, analyzing sentiment, or rewriting content, this action offers the flexibility and ease of use with no setup required. The clear settings, like prompt customization, temperature control, and the option to format outputs as JSON, ensure that users can tailor the AI's output to meet their specific needs efficiently and effectively.