Formatron v0.4.9
Formatron empowers everyone to control the output format of language models with minimal overhead.
Loading...
Searching...
No Matches
formatron.schemas.pydantic.FieldInfo Class Reference

A wrapper for pydantic FieldInfo. More...

Inheritance diagram for formatron.schemas.pydantic.FieldInfo:
formatron.schemas.schema.FieldInfo

Public Member Functions

 __init__ (self, pydantic.fields.FieldInfo field)
 Initialize the field information.
 
 __repr__ (self)
 
 __str__ (self)
 
- Public Member Functions inherited from formatron.schemas.schema.FieldInfo

Protected Attributes

 _field
 
 _annotation
 

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

A wrapper for pydantic FieldInfo.

Definition at line 19 of file pydantic.py.

Constructor & Destructor Documentation

◆ __init__()

formatron.schemas.pydantic.FieldInfo.__init__ ( self,
pydantic.fields.FieldInfo field )

Initialize the field information.

Definition at line 25 of file pydantic.py.

Member Function Documentation

◆ __repr__()

formatron.schemas.pydantic.FieldInfo.__repr__ ( self)

Definition at line 63 of file pydantic.py.

◆ __str__()

formatron.schemas.pydantic.FieldInfo.__str__ ( self)

Definition at line 66 of file pydantic.py.

◆ annotation()

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

Get the type annotation of the field.

Reimplemented from formatron.schemas.schema.FieldInfo.

Definition at line 45 of file pydantic.py.

◆ required()

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

Check if the field is required for the schema.

Reimplemented from formatron.schemas.schema.FieldInfo.

Definition at line 58 of file pydantic.py.

Member Data Documentation

◆ _annotation

formatron.schemas.pydantic.FieldInfo._annotation
protected

Definition at line 27 of file pydantic.py.

◆ _field

formatron.schemas.pydantic.FieldInfo._field
protected

Definition at line 26 of file pydantic.py.


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