Skip to content

Commit

Permalink
fix: use default_factory for list fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeuoly committed Dec 5, 2024
1 parent f038eb2 commit fbcd4fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/core/model_runtime/entities/provider_entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from enum import Enum
from typing import Optional

from pydantic import BaseModel, ConfigDict
from pydantic import BaseModel, ConfigDict, Field

from core.model_runtime.entities.common_entities import I18nObject
from core.model_runtime.entities.model_entities import AIModelEntity, ModelType
Expand Down Expand Up @@ -127,7 +127,7 @@ class ProviderEntity(BaseModel):
help: Optional[ProviderHelpEntity] = None
supported_model_types: Sequence[ModelType]
configurate_methods: list[ConfigurateMethod]
models: list[AIModelEntity] = []
models: list[AIModelEntity] = Field(default_factory=list)
provider_credential_schema: Optional[ProviderCredentialSchema] = None
model_credential_schema: Optional[ModelCredentialSchema] = None

Expand Down

0 comments on commit fbcd4fe

Please sign in to comment.