Closed Moiyu1998 closed 4 hours ago
To resolve the Pydantic validation errors you're encountering after upgrading to version 0.10.0, you can address the issues with None
values for the description
, options
, and vision.configs
fields as follows:
description
and options
Fields:
None
by providing default values or handling None
values in your code. These fields should be valid strings and sequences, respectively.vision.configs
Field:
field_validator
to handle None
values for the configs
field in the VisionConfig
class. Here's an example of how you can implement this:class VisionConfig(BaseModel):
enabled: bool = False
configs: VisionConfigOptions = Field(default_factory=VisionConfigOptions)
@field_validator("configs", mode="before")
@classmethod
def convert_none_configs(cls, v: Any):
if v is None:
return VisionConfigOptions()
return v
This validator ensures that if configs
is None
, it will be replaced with a default VisionConfigOptions
object, preventing validation errors related to None
values [1].
Make sure these validators are correctly applied and that the VisionConfig
is instantiated properly in your code. This should help resolve the validation issues you're facing.
To continue talking to Dosu, mention @dosu.
The error occurs in one personal space but not in another. Why is that?
Please upgrade to v0.10.1, this version should resolve those errors.
Self Checks
Dify version
0.10.0
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
The workflow application that was working fine in the previous version encountered errors with most variables after updating to version 0.10.0.
✔️ Expected Behavior
No response
❌ Actual Behavior
No response