Chore: remove unused var in ModelProviderFactory (#23690)

This commit is contained in:
Yongtao Huang
2025-08-11 22:04:11 +08:00
committed by GitHub
parent 332e8e68ee
commit a44ca29717
3 changed files with 1 additions and 16 deletions

View File

@@ -257,11 +257,6 @@ class ModelProviderFactory:
# scan all providers # scan all providers
plugin_model_provider_entities = self.get_plugin_model_providers() plugin_model_provider_entities = self.get_plugin_model_providers()
# convert provider_configs to dict
provider_credentials_dict = {}
for provider_config in provider_configs:
provider_credentials_dict[provider_config.provider] = provider_config.credentials
# traverse all model_provider_extensions # traverse all model_provider_extensions
providers = [] providers = []
for plugin_model_provider_entity in plugin_model_provider_entities: for plugin_model_provider_entity in plugin_model_provider_entities:

View File

@@ -68,7 +68,7 @@ class CommonValidator:
if credential_form_schema.max_length: if credential_form_schema.max_length:
if len(value) > credential_form_schema.max_length: if len(value) > credential_form_schema.max_length:
raise ValueError( raise ValueError(
f"Variable {credential_form_schema.variable} length should not" f"Variable {credential_form_schema.variable} length should not be"
f" greater than {credential_form_schema.max_length}" f" greater than {credential_form_schema.max_length}"
) )

View File

@@ -1,10 +0,0 @@
import pydantic
from pydantic import BaseModel
def dump_model(model: BaseModel) -> dict:
if hasattr(pydantic, "model_dump"):
# FIXME mypy error, try to fix it instead of using type: ignore
return pydantic.model_dump(model) # type: ignore
else:
return model.model_dump()