Skip to content
Prompty

Property

Represents a single property.

  • This model defines the structure of properties that can be used in prompts, including their type, description, whether they are required, and other attributes.
  • It allows for the definition of dynamic inputs that can be filled with data and processed to generate prompts for AI models.
---
title: Property
config:
  look: handDrawn
  theme: colorful
  class:
    hideEmptyMembersBox: true
---
classDiagram
    class Property {
        +string name
        +string kind
        +string description
        +boolean required
        +boolean nullable
        +unknown default
        +unknown example
        +unknown[] enumValues
    }
    class ArrayProperty {
        +string kind
        +Property items
    }
    Property <|-- ArrayProperty
    class ObjectProperty {
        +string kind
        +Property[] properties
    }
    Property <|-- ObjectProperty
    class UnionProperty {
        +string kind
        +Property[] oneOf
        +Property[] anyOf
    }
    Property <|-- UnionProperty
name: my-input
kind: string
description: A description of the input property
required: true
nullable: true
default: default value
example: example value
enumValues:
- value1
- value2
- value3
Name Type Description
name string Name of the property
kind string The data type of the input property
description string A short description of the input property
required boolean Whether the property is required
nullable boolean Whether the property also accepts a JSON null value
default unknown The default value of the property - this represents the default value if none is provided
example unknown Example value used for either initialization or tooling
enumValues unknown[] Allowed enumeration values for the property

The following types extend Property:

The following alternate constructions are available for Property. These allow for simplified creation of instances using a single property.

Simple construction with just a kind of boolean

The following simplified representation can be used:

input: true

This is equivalent to the full representation:

input:
kind: boolean
example: true

Simple construction with just a kind of float

The following simplified representation can be used:

input: 3.14

This is equivalent to the full representation:

input:
kind: float
example: 3.14

Simple construction with just a kind of integer

The following simplified representation can be used:

input: 5

This is equivalent to the full representation:

input:
kind: integer
example: 5

Simple construction with just a kind of string

The following simplified representation can be used:

input: "example"

This is equivalent to the full representation:

input:
kind: string
example: "example"