ValidationError
Fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
loc | List[Any] | ✓ | None | - |
msg | str | ✓ | None | - |
type | str | ✓ | None | - |
Usage Example
from credoai.models import ValidationError
# Create a new instance
model = ValidationError(
loc=None, # Required field
msg="example_value", # Required field
type="example_value", # Required field
)
# Convert to dictionary
model_dict = model.model_dump()
print(model_dict)
# Create from dictionary
data = {
"loc": None,
"msg": "example_value",
"type": "example_value",
}
model_from_dict = ValidationError(**data)
JSON Schema
{
"type": "object",
"title": "ValidationError",
"properties": {
"loc": {
"type": "list[any]"
},
"msg": {
"type": "str"
},
"type": {
"type": "str"
}
},
"required": ["loc", "msg", "type"]
}