Best practices for designing schemas for visual inputs.
Field
class with descriptive titles to improve extraction quality.Literal
to constrain your field values to a set of possible categories.str
to extract a textual description of the image. Provide some additional details regarding the style, context and also provide a rough estimate of the length of the caption (in number of words).datetime.date
to extract a date from the image. Provide some additional details regarding the format of the date (e.g. YYYY-MM-DD
). One additional caveat is that you can not provide date
as the field name in your Pydantic BaseModel, as it is a reserved keyword in Pydantic. Use datetime.datetime
instead if you need to extract additional time information (e.g. YYYY-MM-DD HH:MM:SS
). Otherwise, always use datetime.date
for date parsing.