feat: cleanup Pydantic warning (#2507)

A several warnings were addressed following by  https://docs.pydantic.dev/2.10/migration
This commit is contained in:
Lucas Gomide
2025-04-01 12:45:45 -03:00
committed by GitHub
parent 3c24350306
commit 63ef3918dd
2 changed files with 10 additions and 10 deletions

View File

@@ -287,8 +287,9 @@ def generate_model_description(model: Type[BaseModel]) -> str:
else:
return str(field_type)
fields = model.__annotations__
fields = model.model_fields
field_descriptions = [
f'"{name}": {describe_field(type_)}' for name, type_ in fields.items()
f'"{name}": {describe_field(field.annotation)}'
for name, field in fields.items()
]
return "{\n " + ",\n ".join(field_descriptions) + "\n}"