Skip to content

ml4den/PromptCanvas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to Prompt Canvas!

Prompt Canvas is a web-based tool designed for effective prompt engineering. It allows you to create, manage, and use structured prompt templates in YAML format. Whether you're building a simple instruction or a complex, multi-part prompt, Prompt Canvas provides the tools to design, populate, and share your creations with ease.

Core Features

  • Prompt Generator: Load templates and fill in the fields to generate a complete, formatted prompt, ready to be copied and used with any AI model.

  • Schema Editor: A powerful visual editor to create or modify your own prompt schemas. Add, remove, and reorder fields with drag-and-drop, and define the structure of your templates.

  • YAML-Powered: Templates are simple, human-readable YAML files, making them easy to share, version-control, and edit by hand.

  • Value Persistence: Save a prompt's filled-in values back to a YAML file. Load it later to continue your work or share a pre-populated prompt with others.

Why Prompt Canvas?

While there are many great prompt engineering tools available, Prompt Canvas was built with a specific set of principles in mind:

  • Privacy First: There is no server-side component. All your templates and data are processed directly in your browser. Nothing leaves your computer unless you explicitly save and share a .yaml file.

  • Complete Freedom: This tool is free and open source. You have the freedom to use it however you see fit, without restrictions.

  • Simplicity: The goal is to provide a clean, intuitive interface that works entirely in your web browser. It's a tool for everyone - writers, marketers, researchers, and developers - not just for engineers.

  • True Portability: By using the universal YAML format, your prompt schemas and filled-in prompts are not locked into any ecosystem. You can easily share them, track them in version control (like Git), or even parse them in other applications.

How to Use the App

The application is divided into three main views:

  1. Prompt Generator: This is where you bring your templates to life.

    • Select a Template: Choose a schema from the dropdown.

    • Upload: Upload a YAML file. If it contains value fields, the form will be pre-populated.

    • Fill the Form: Complete the dynamically generated fields.

    • Download with Values: Save a new YAML file that includes both the schema and the data you've entered.

    • Copy Prompt: The final, formatted prompt appears at the bottom. Click "Copy" to use it.

  2. Schema Editor: This is your workshop for designing prompt templates.

    • Create from Scratch: Add template details (name, version, description) and start adding fields.

    • Upload to Edit: Load an existing .yaml template to modify it visually.

    • Drag & Drop: Easily reorder fields by clicking and dragging the handle.

    • Configure Fields: Set the name, description, type, and other options for each field.

    • Download as YAML: Save your creation as a clean .yaml schema file.

    • Note: If you upload a file with value data, the editor will preserve this data in the background, but it will not be visible or editable here.

  3. Guide: The page you're reading now! It provides comprehensive instructions on how to use the app and its features.

Supported Field Types

You can use the following field types in your schemas:

  • string: A single-line text input.

  • text: A multi-line text area for longer content.

  • number: An input for numerical values.

  • boolean: A dynamic group of key-value pairs. In the generator, you can add multiple named settings, each with a true/false checkbox.

  • list: A dynamic list of items. List items can be of type string, text, or number.

Advanced Option: XML Wrapping

For string, text, number, and list item fields, you can specify an xml_tag_name. If a tag name is provided, the final prompt output will wrap the content of that field in the corresponding XML tags. This is useful for providing structured data to AI models.

Example Template File (example.yaml)

Here is an example of a YAML file that showcases the various field types and options available.

template:
  name: "Advanced Content Request"
  version: "2.1"
  description: "A template for requesting structured content with specific constraints."
  fields:
    - name: "role"
      type: "string"
      description: "The persona the AI should adopt."
      xml_tag_name: "persona"
    - name: "task_description"
      type: "text"
      description: "The main task the AI needs to accomplish."
    - name: "word_count"
      type: "number"
      description: "The target word count for the output."
      xml_tag_name: "target_length"
    - name: "key_topics"
      type: "list"
      description: "A list of key topics that must be included."
      items:
        type: "string"
        xml_tag_name: "topic"
    - name: "content_settings"
      type: "boolean"
      description: "Specify content generation options."
      value: # Example of saved boolean values
        - key: "include_examples"
          value: true
        - key: "use_formal_tone"
          value: false

Get in Touch

Open issues on GitHub, leave a star, or get in touch at ai@ml4den.com.

About

Prompt engineering with reusable templates in YAML format.

Resources

Stars

Watchers

Forks

Contributors

Languages