# pydantic 2.14.2 (MIT), harvested by tools/harvest_corpus.py
=== input
!!! abstract "Usage Documentation"
        [Fields](../concepts/fields.md)

    Create a field for objects that can be configured.

    Used to provide extra information about a field, either for the model schema or complex validation. Some arguments
    apply only to number fields (`int`, `float`, `Decimal`) and some apply only to `str`.

    Note:
        - Any `_Unset` objects will be replaced by the corresponding default value of the `FieldInfo` constructor.

    Args:
        default: Default value if the field is not set.
        default_factory: A callable to generate the default value. The callable can either take 0 arguments
            (in which case it is called as is) or a single argument containing the already validated data.
        alias: The name to use for the attribute when validating or serializing by alias.
            This is often used for things like converting between snake and camel case.
        alias_priority: Priority of the alias. This affects whether an alias generator is used.
        validation_alias: Like `alias`, but only affects validation, not serialization.
        serialization_alias: Like `alias`, but only affects serialization, not validation.
        title: Human-readable title.
        field_title_generator: A callable that takes a field's name and info and returns title for it.
        description: Human-readable description.
        examples: Example values for this field.
        exclude: Whether to exclude the field from the model serialization.
        exclude_if: A callable that determines whether to exclude a field during serialization based on its value.
        discriminator: Field name or Discriminator for discriminating the type in a tagged union.
        deprecated: A deprecation message, an instance of `warnings.deprecated` or the `typing_extensions.deprecated` backport,
            or a boolean. If `True`, a default deprecation message will be emitted when accessing the field.
        json_schema_extra: A dict or callable to provide extra JSON schema properties.
        frozen: Whether the field is frozen. If true, attempts to change the value on an instance will raise an error.
        validate_default: If `True`, apply validation to the default value every time you create an instance.
            Otherwise, for performance reasons, the default value of the field is trusted and not validated.
        repr: A boolean indicating whether to include the field in the `__repr__` output.
        init: Whether the field should be included in the constructor of the dataclass.
            (Only applies to dataclasses.)
        init_var: Whether the field should _only_ be included in the constructor of the dataclass.
            (Only applies to dataclasses.)
        kw_only: Whether the field should be a keyword-only argument in the constructor of the dataclass.
            (Only applies to dataclasses.)
        coerce_numbers_to_str: Whether to enable coercion of any `Number` type to `str` (not applicable in `strict` mode).
        strict: If `True`, strict validation is applied to the field.
            See [Strict Mode](../concepts/strict_mode.md) for details.
        gt: Greater than. If set, value must be greater than this. Only applicable to numbers.
        ge: Greater than or equal. If set, value must be greater than or equal to this. Only applicable to numbers.
        lt: Less than. If set, value must be less than this. Only applicable to numbers.
        le: Less than or equal. If set, value must be less than or equal to this. Only applicable to numbers.
        multiple_of: Value must be a multiple of this. Only applicable to numbers.
        min_length: Minimum length for iterables.
        max_length: Maximum length for iterables.
        pattern: Pattern for strings (a regular expression).
        allow_inf_nan: Allow `inf`, `-inf`, `nan`. Only applicable to float and [`Decimal`][decimal.Decimal] numbers.
        max_digits: Maximum number of allowed digits for [`Decimal`][decimal.Decimal] numbers.
        decimal_places: Maximum number of decimal places allowed for numbers.
        union_mode: The strategy to apply when validating a union. Can be `smart` (the default), or `left_to_right`.
            See [Union Mode](../concepts/unions.md#union-modes) for details.
        fail_fast: If `True`, validation will stop on the first error. If `False`, all validation errors will be collected.
            This option can be applied only to iterable types (list, tuple, set, and frozenset).
        extra: (Deprecated) Extra fields that will be included in the JSON schema.

            !!! warning Deprecated
                The `extra` kwargs is deprecated. Use `json_schema_extra` instead.

    Returns:
        A new [`FieldInfo`][pydantic.fields.FieldInfo]. The return annotation is `Any` so `Field` can be used on
            type-annotated fields without causing a type error.
    
=== parse google
short_description: '!!! abstract "Usage Documentation"'
long_description: |
      [Fields](../concepts/fields.md)
  
  Create a field for objects that can be configured.
  
  Used to provide extra information about a field, either for the model schema or complex validation. Some arguments
  apply only to number fields (`int`, `float`, `Decimal`) and some apply only to `str`.
blank_after_short_description: False
blank_after_long_description: True
style: google
- DocstringMeta
  description: '- Any `_Unset` objects will be replaced by the corresponding default value of the `FieldInfo` constructor.'
  kind: text
  key: 'notes'
  title: 'Note'
- DocstringParam
  description: 'Default value if the field is not set.'
  kind: param
  key: 'param'
  arg_name: 'default'
  is_optional: False
- DocstringParam
  description: |
    A callable to generate the default value. The callable can either take 0 arguments
    (in which case it is called as is) or a single argument containing the already validated data.
  kind: param
  key: 'param'
  arg_name: 'default_factory'
  is_optional: False
- DocstringParam
  description: |
    The name to use for the attribute when validating or serializing by alias.
    This is often used for things like converting between snake and camel case.
  kind: param
  key: 'param'
  arg_name: 'alias'
  is_optional: False
- DocstringParam
  description: 'Priority of the alias. This affects whether an alias generator is used.'
  kind: param
  key: 'param'
  arg_name: 'alias_priority'
  is_optional: False
- DocstringParam
  description: 'Like `alias`, but only affects validation, not serialization.'
  kind: param
  key: 'param'
  arg_name: 'validation_alias'
  is_optional: False
- DocstringParam
  description: 'Like `alias`, but only affects serialization, not validation.'
  kind: param
  key: 'param'
  arg_name: 'serialization_alias'
  is_optional: False
- DocstringParam
  description: 'Human-readable title.'
  kind: param
  key: 'param'
  arg_name: 'title'
  is_optional: False
- DocstringParam
  description: "A callable that takes a field's name and info and returns title for it."
  kind: param
  key: 'param'
  arg_name: 'field_title_generator'
  is_optional: False
- DocstringParam
  description: 'Human-readable description.'
  kind: param
  key: 'param'
  arg_name: 'description'
  is_optional: False
- DocstringParam
  description: 'Example values for this field.'
  kind: param
  key: 'param'
  arg_name: 'examples'
  is_optional: False
- DocstringParam
  description: 'Whether to exclude the field from the model serialization.'
  kind: param
  key: 'param'
  arg_name: 'exclude'
  is_optional: False
- DocstringParam
  description: 'A callable that determines whether to exclude a field during serialization based on its value.'
  kind: param
  key: 'param'
  arg_name: 'exclude_if'
  is_optional: False
- DocstringParam
  description: 'Field name or Discriminator for discriminating the type in a tagged union.'
  kind: param
  key: 'param'
  arg_name: 'discriminator'
  is_optional: False
- DocstringParam
  description: |
    A deprecation message, an instance of `warnings.deprecated` or the `typing_extensions.deprecated` backport,
    or a boolean. If `True`, a default deprecation message will be emitted when accessing the field.
  kind: param
  key: 'param'
  arg_name: 'deprecated'
  is_optional: False
- DocstringParam
  description: 'A dict or callable to provide extra JSON schema properties.'
  kind: param
  key: 'param'
  arg_name: 'json_schema_extra'
  is_optional: False
- DocstringParam
  description: 'Whether the field is frozen. If true, attempts to change the value on an instance will raise an error.'
  kind: param
  key: 'param'
  arg_name: 'frozen'
  is_optional: False
- DocstringParam
  description: |
    If `True`, apply validation to the default value every time you create an instance.
    Otherwise, for performance reasons, the default value of the field is trusted and not validated.
  kind: param
  key: 'param'
  arg_name: 'validate_default'
  is_optional: False
- DocstringParam
  description: 'A boolean indicating whether to include the field in the `__repr__` output.'
  kind: param
  key: 'param'
  arg_name: 'repr'
  is_optional: False
- DocstringParam
  description: |
    Whether the field should be included in the constructor of the dataclass.
    (Only applies to dataclasses.)
  kind: param
  key: 'param'
  arg_name: 'init'
  is_optional: False
- DocstringParam
  description: |
    Whether the field should _only_ be included in the constructor of the dataclass.
    (Only applies to dataclasses.)
  kind: param
  key: 'param'
  arg_name: 'init_var'
  is_optional: False
- DocstringParam
  description: |
    Whether the field should be a keyword-only argument in the constructor of the dataclass.
    (Only applies to dataclasses.)
  kind: param
  key: 'param'
  arg_name: 'kw_only'
  is_optional: False
- DocstringParam
  description: 'Whether to enable coercion of any `Number` type to `str` (not applicable in `strict` mode).'
  kind: param
  key: 'param'
  arg_name: 'coerce_numbers_to_str'
  is_optional: False
- DocstringParam
  description: |
    If `True`, strict validation is applied to the field.
    See [Strict Mode](../concepts/strict_mode.md) for details.
  kind: param
  key: 'param'
  arg_name: 'strict'
  is_optional: False
- DocstringParam
  description: 'Greater than. If set, value must be greater than this. Only applicable to numbers.'
  kind: param
  key: 'param'
  arg_name: 'gt'
  is_optional: False
- DocstringParam
  description: 'Greater than or equal. If set, value must be greater than or equal to this. Only applicable to numbers.'
  kind: param
  key: 'param'
  arg_name: 'ge'
  is_optional: False
- DocstringParam
  description: 'Less than. If set, value must be less than this. Only applicable to numbers.'
  kind: param
  key: 'param'
  arg_name: 'lt'
  is_optional: False
- DocstringParam
  description: 'Less than or equal. If set, value must be less than or equal to this. Only applicable to numbers.'
  kind: param
  key: 'param'
  arg_name: 'le'
  is_optional: False
- DocstringParam
  description: 'Value must be a multiple of this. Only applicable to numbers.'
  kind: param
  key: 'param'
  arg_name: 'multiple_of'
  is_optional: False
- DocstringParam
  description: 'Minimum length for iterables.'
  kind: param
  key: 'param'
  arg_name: 'min_length'
  is_optional: False
- DocstringParam
  description: 'Maximum length for iterables.'
  kind: param
  key: 'param'
  arg_name: 'max_length'
  is_optional: False
- DocstringParam
  description: 'Pattern for strings (a regular expression).'
  kind: param
  key: 'param'
  arg_name: 'pattern'
  is_optional: False
- DocstringParam
  description: 'Allow `inf`, `-inf`, `nan`. Only applicable to float and [`Decimal`][decimal.Decimal] numbers.'
  kind: param
  key: 'param'
  arg_name: 'allow_inf_nan'
  is_optional: False
- DocstringParam
  description: 'Maximum number of allowed digits for [`Decimal`][decimal.Decimal] numbers.'
  kind: param
  key: 'param'
  arg_name: 'max_digits'
  is_optional: False
- DocstringParam
  description: 'Maximum number of decimal places allowed for numbers.'
  kind: param
  key: 'param'
  arg_name: 'decimal_places'
  is_optional: False
- DocstringParam
  description: |
    The strategy to apply when validating a union. Can be `smart` (the default), or `left_to_right`.
    See [Union Mode](../concepts/unions.md#union-modes) for details.
  kind: param
  key: 'param'
  arg_name: 'union_mode'
  is_optional: False
- DocstringParam
  description: |
    If `True`, validation will stop on the first error. If `False`, all validation errors will be collected.
    This option can be applied only to iterable types (list, tuple, set, and frozenset).
  kind: param
  key: 'param'
  arg_name: 'fail_fast'
  is_optional: False
- DocstringParam
  description: |
    (Deprecated) Extra fields that will be included in the JSON schema.
    
    !!! warning Deprecated
        The `extra` kwargs is deprecated. Use `json_schema_extra` instead.
  kind: param
  key: 'param'
  arg_name: 'extra'
  is_optional: False
- DocstringReturns
  description: |
    A new [`FieldInfo`][pydantic.fields.FieldInfo]. The return annotation is `Any` so `Field` can be used on
    type-annotated fields without causing a type error.
  kind: returns
  key: 'returns'
  is_generator: False
=== detect
google
=== compose google
!!! abstract "Usage Documentation"
    [Fields](../concepts/fields.md)

Create a field for objects that can be configured.

Used to provide extra information about a field, either for the model schema or complex validation. Some arguments
apply only to number fields (`int`, `float`, `Decimal`) and some apply only to `str`.

Note:
    - Any `_Unset` objects will be replaced by the corresponding default value of the `FieldInfo` constructor.

Args:
    default: Default value if the field is not set.
    default_factory: A callable to generate the default value. The callable can either take 0 arguments
        (in which case it is called as is) or a single argument containing the already validated data.
    alias: The name to use for the attribute when validating or serializing by alias.
        This is often used for things like converting between snake and camel case.
    alias_priority: Priority of the alias. This affects whether an alias generator is used.
    validation_alias: Like `alias`, but only affects validation, not serialization.
    serialization_alias: Like `alias`, but only affects serialization, not validation.
    title: Human-readable title.
    field_title_generator: A callable that takes a field's name and info and returns title for it.
    description: Human-readable description.
    examples: Example values for this field.
    exclude: Whether to exclude the field from the model serialization.
    exclude_if: A callable that determines whether to exclude a field during serialization based on its value.
    discriminator: Field name or Discriminator for discriminating the type in a tagged union.
    deprecated: A deprecation message, an instance of `warnings.deprecated` or the `typing_extensions.deprecated` backport,
        or a boolean. If `True`, a default deprecation message will be emitted when accessing the field.
    json_schema_extra: A dict or callable to provide extra JSON schema properties.
    frozen: Whether the field is frozen. If true, attempts to change the value on an instance will raise an error.
    validate_default: If `True`, apply validation to the default value every time you create an instance.
        Otherwise, for performance reasons, the default value of the field is trusted and not validated.
    repr: A boolean indicating whether to include the field in the `__repr__` output.
    init: Whether the field should be included in the constructor of the dataclass.
        (Only applies to dataclasses.)
    init_var: Whether the field should _only_ be included in the constructor of the dataclass.
        (Only applies to dataclasses.)
    kw_only: Whether the field should be a keyword-only argument in the constructor of the dataclass.
        (Only applies to dataclasses.)
    coerce_numbers_to_str: Whether to enable coercion of any `Number` type to `str` (not applicable in `strict` mode).
    strict: If `True`, strict validation is applied to the field.
        See [Strict Mode](../concepts/strict_mode.md) for details.
    gt: Greater than. If set, value must be greater than this. Only applicable to numbers.
    ge: Greater than or equal. If set, value must be greater than or equal to this. Only applicable to numbers.
    lt: Less than. If set, value must be less than this. Only applicable to numbers.
    le: Less than or equal. If set, value must be less than or equal to this. Only applicable to numbers.
    multiple_of: Value must be a multiple of this. Only applicable to numbers.
    min_length: Minimum length for iterables.
    max_length: Maximum length for iterables.
    pattern: Pattern for strings (a regular expression).
    allow_inf_nan: Allow `inf`, `-inf`, `nan`. Only applicable to float and [`Decimal`][decimal.Decimal] numbers.
    max_digits: Maximum number of allowed digits for [`Decimal`][decimal.Decimal] numbers.
    decimal_places: Maximum number of decimal places allowed for numbers.
    union_mode: The strategy to apply when validating a union. Can be `smart` (the default), or `left_to_right`.
        See [Union Mode](../concepts/unions.md#union-modes) for details.
    fail_fast: If `True`, validation will stop on the first error. If `False`, all validation errors will be collected.
        This option can be applied only to iterable types (list, tuple, set, and frozenset).
    extra: (Deprecated) Extra fields that will be included in the JSON schema.

        !!! warning Deprecated
            The `extra` kwargs is deprecated. Use `json_schema_extra` instead.

Returns:
    A new [`FieldInfo`][pydantic.fields.FieldInfo]. The return annotation is `Any` so `Field` can be used on
    type-annotated fields without causing a type error.
