Formatron v0.4.9
Formatron empowers everyone to control the output format of language models with minimal overhead.
Loading...
Searching...
No Matches
formatron.schemas.json_schema.FieldInfo Class Reference
Inheritance diagram for formatron.schemas.json_schema.FieldInfo:
formatron.schemas.schema.FieldInfo

Public Member Functions

 __init__ (self, typing.Type annotation, bool required)
 Initialize the field information.
 
- Public Member Functions inherited from formatron.schemas.schema.FieldInfo

Protected Attributes

 _annotation
 
 _required
 

Properties

typing.Type[typing.Any]|None annotation (self)
 Get the type annotation of the field.
 
bool required (self)
 Check if the field is required for the schema.
 

Detailed Description

Definition at line 18 of file json_schema.py.

Constructor & Destructor Documentation

◆ __init__()

formatron.schemas.json_schema.FieldInfo.__init__ ( self,
typing.Type annotation,
bool required )

Initialize the field information.

Parameters
annotationThe type annotation of the field.
requiredWhether the field is required for the schema.

Definition at line 28 of file json_schema.py.

Member Function Documentation

◆ annotation()

typing.Type[typing.Any] | None formatron.schemas.json_schema.FieldInfo.annotation ( self)

Get the type annotation of the field.

Reimplemented from formatron.schemas.schema.FieldInfo.

Definition at line 43 of file json_schema.py.

◆ required()

bool formatron.schemas.json_schema.FieldInfo.required ( self)

Check if the field is required for the schema.

Reimplemented from formatron.schemas.schema.FieldInfo.

Definition at line 59 of file json_schema.py.

Member Data Documentation

◆ _annotation

formatron.schemas.json_schema.FieldInfo._annotation
protected

Definition at line 29 of file json_schema.py.

◆ _required

formatron.schemas.json_schema.FieldInfo._required
protected

Definition at line 30 of file json_schema.py.


The documentation for this class was generated from the following file: