diff --git a/api/core/entities/provider_configuration.py b/api/core/entities/provider_configuration.py index c8f1a2ab7f..5418dd0490 100644 --- a/api/core/entities/provider_configuration.py +++ b/api/core/entities/provider_configuration.py @@ -101,7 +101,7 @@ class ProviderConfiguration(BaseModel): self.provider.configurate_methods.append(ConfigurateMethod.PREDEFINED_MODEL) return self - def bind_model_runtime(self, model_runtime: "ModelRuntime") -> None: + def bind_model_runtime(self, model_runtime: ModelRuntime) -> None: """Attach the already-composed runtime for request-bound call chains.""" self._bound_model_runtime = model_runtime diff --git a/api/tests/unit_tests/core/entities/test_entities_provider_configuration.py b/api/tests/unit_tests/core/entities/test_entities_provider_configuration.py index 84ecc3d2e8..23ae91fdf2 100644 --- a/api/tests/unit_tests/core/entities/test_entities_provider_configuration.py +++ b/api/tests/unit_tests/core/entities/test_entities_provider_configuration.py @@ -467,7 +467,9 @@ def test_get_model_type_instance_and_schema_reuse_bound_runtime_factory() -> Non mock_factory.get_model_schema.return_value = mock_schema with ( - patch("core.entities.provider_configuration.ModelProviderFactory", return_value=mock_factory) as mock_factory_cls, + patch( + "core.entities.provider_configuration.ModelProviderFactory", return_value=mock_factory + ) as mock_factory_cls, patch("core.entities.provider_configuration.create_plugin_model_provider_factory") as mock_factory_builder, ): model_type_instance = configuration.get_model_type_instance(ModelType.LLM) diff --git a/api/tests/unit_tests/core/plugin/test_model_runtime_adapter.py b/api/tests/unit_tests/core/plugin/test_model_runtime_adapter.py index 4c4d864eb8..a2180bc6ba 100644 --- a/api/tests/unit_tests/core/plugin/test_model_runtime_adapter.py +++ b/api/tests/unit_tests/core/plugin/test_model_runtime_adapter.py @@ -10,7 +10,7 @@ import pytest from core.plugin.entities.plugin_daemon import PluginModelProviderEntity from core.plugin.impl import model_runtime as model_runtime_module from core.plugin.impl.model import PluginModelClient -from core.plugin.impl.model_runtime import PluginModelRuntime, TENANT_SCOPE_SCHEMA_CACHE_USER_ID +from core.plugin.impl.model_runtime import TENANT_SCOPE_SCHEMA_CACHE_USER_ID, PluginModelRuntime from core.plugin.impl.model_runtime_factory import create_plugin_model_runtime from dify_graph.model_runtime.entities.common_entities import I18nObject from dify_graph.model_runtime.entities.model_entities import AIModelEntity, FetchFrom, ModelType