Skip to content

StringPropertySchema

Base classes

Name Children Inherits
AnnotatedObject
aclientp.schema.base
Base class for generated models.

⋔ Inheritance diagram

graph TD
  95970861162496["elicitation.StringPropertySchema"]
  95970862258240["base.AnnotatedObject"]
  95970862254416["base.Schema"]
  95970851503232["main.BaseModel"]
  125067848591872["builtins.object"]
  95970862258240 --> 95970861162496
  95970862254416 --> 95970862258240
  95970851503232 --> 95970862254416
  125067848591872 --> 95970851503232

🛈 DocStrings

Bases: AnnotatedObject

Schema for string properties in an elicitation form.

When enum_values or one_of is set, this represents a single-select enum.

Source code in src/aclientp/schema/elicitation.py
class StringPropertySchema(AnnotatedObject):
    """Schema for string properties in an elicitation form.

    When ``enum_values`` or ``one_of`` is set, this represents a single-select enum.
    """

    type: Literal["string"] = "string"
    """Type discriminator."""

    title: str | None = None
    """Optional title for the property."""

    description: str | None = None
    """Human-readable description."""

    min_length: int | None = Field(default=None, ge=0)
    """Minimum string length."""

    max_length: int | None = Field(default=None, ge=0)
    """Maximum string length."""

    pattern: str | None = None
    """Pattern the string must match."""

    format: StringFormatLiteral | None = None
    """String format."""

    default: str | None = None
    """Default value."""

    enum: Sequence[str] | None = None
    """Enum values for untitled single-select enums."""

    one_of: Sequence[EnumOption] | None = None
    """Titled enum options for titled single-select enums."""

default class-attribute instance-attribute

default: str | None = None

Default value.

description class-attribute instance-attribute

description: str | None = None

Human-readable description.

enum class-attribute instance-attribute

enum: Sequence[str] | None = None

Enum values for untitled single-select enums.

format class-attribute instance-attribute

format: StringFormatLiteral | None = None

String format.

max_length class-attribute instance-attribute

max_length: int | None = Field(default=None, ge=0)

Maximum string length.

min_length class-attribute instance-attribute

min_length: int | None = Field(default=None, ge=0)

Minimum string length.

one_of class-attribute instance-attribute

one_of: Sequence[EnumOption] | None = None

Titled enum options for titled single-select enums.

pattern class-attribute instance-attribute

pattern: str | None = None

Pattern the string must match.

title class-attribute instance-attribute

title: str | None = None

Optional title for the property.

type class-attribute instance-attribute

type: Literal['string'] = 'string'

Type discriminator.

:fa-brands-github: Show source on GitHub