@field_validator("top_p",mode="before")@classmethoddefcheck_top_p(cls,v:Any,info:ValidationInfo)->Any:ifvisnotNoneandinfo.data.get("temperature")isnotNone:raiseValueError("temperature and top_p cannot be set at the same time.")returnv
@field_validator("base_url",mode="before")@classmethoddefcheck_base_url(cls,v:Any,info:ValidationInfo)->Any:ifvisNone:# Handle None case explicitlyreturnNoneifnotstr(v).startswith("https://")andnotstr(v).startswith("http://"):v=f"http://{str(v)}"returnv