Skip to content

Meta

🛈 DocStrings

What every node carries besides its kind: labels, default, flags.

Source code in src/promptantic/form/nodes.py
@dataclass(frozen=True)
class Meta:
    """What every node carries besides its kind: labels, default, flags."""

    title: str | None = None
    description: str | None = None
    default: Any = UNSET
    """The schema's ``default``; :data:`UNSET` when it has none."""
    examples: tuple[Any, ...] = ()
    read_only: bool = False
    write_only: bool = False
    deprecated: bool = False
    extensions: Mapping[str, Any] = field(default_factory=dict)
    """``x-`` keys of the schema (e.g. ``x-completions``), without the prefix."""

    @property
    def has_default(self) -> bool:
        return self.default is not UNSET

default class-attribute instance-attribute

default: Any = UNSET

The schema's default; :data:UNSET when it has none.

extensions class-attribute instance-attribute

extensions: Mapping[str, Any] = field(default_factory=dict)

x- keys of the schema (e.g. x-completions), without the prefix.

:fa-brands-github: Show source on GitHub