# This file was auto-generated by Fern from our API Definition.

from ..core.pydantic_utilities import UniversalBaseModel
import typing
from ..core.pydantic_utilities import IS_PYDANTIC_V2
import pydantic


class OptimizeConfig(UniversalBaseModel):
    lagrangian: typing.Optional[bool] = None
    max_steps: typing.Optional[int] = None
    stopping_steps: typing.Optional[int] = None
    stopping_loss_threshold: typing.Optional[float] = None
    stopping_param_threshold: typing.Optional[float] = None
    lr: typing.Optional[float] = None
    slack_eps: typing.Optional[float] = None
    adam: typing.Optional[bool] = None
    momentum: typing.Optional[float] = None
    jit_compile: typing.Optional[bool] = None

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
