浏览代码

Chore: remove unused var in `ModelProviderFactory` (#23690)

tags/1.8.0
Yongtao Huang 2 个月前
父节点
当前提交
a44ca29717
没有帐户链接到提交者的电子邮件

+ 0
- 5
api/core/model_runtime/model_providers/model_provider_factory.py 查看文件

@@ -257,11 +257,6 @@ class ModelProviderFactory:
# scan all 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
providers = []
for plugin_model_provider_entity in plugin_model_provider_entities:

+ 1
- 1
api/core/model_runtime/schema_validators/common_validator.py 查看文件

@@ -68,7 +68,7 @@ class CommonValidator:
if credential_form_schema.max_length:
if len(value) > credential_form_schema.max_length:
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}"
)


+ 0
- 10
api/core/model_runtime/utils/helper.py 查看文件

@@ -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()

正在加载...
取消
保存