langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
49.39k stars 7.06k forks source link

The previous application encountered various variable errors after upgrading to version 0.10.0. #9826

Closed Moiyu1998 closed 4 hours ago

Moiyu1998 commented 4 hours ago

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.

lQLPJxdbxn4UecfMxM0K0rByKCqfh4X0VQcA9i-UWK4A_2770_196 ca1173b379e35b6fffb70727b41f51c0

✔️ Expected Behavior

No response

❌ Actual Behavior

No response

dosubot[bot] commented 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:

  1. description and options Fields:

    • Ensure that these fields are not None by providing default values or handling None values in your code. These fields should be valid strings and sequences, respectively.
  2. vision.configs Field:

    • Use a 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.

Moiyu1998 commented 4 hours ago

The error occurs in one personal space but not in another. Why is that?

crazywoola commented 4 hours ago

Please upgrade to v0.10.1, this version should resolve those errors.