You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789
  1. import pydantic
  2. from pydantic import BaseModel
  3. def dump_model(model: BaseModel) -> dict:
  4. if hasattr(pydantic, "model_dump"):
  5. return pydantic.model_dump(model)
  6. else:
  7. return model.model_dump()