refactor: rename plugin manager to plugin client and rename path from manager to impl (#18876)

This commit is contained in:
Yeuoly 2025-04-27 14:22:25 +08:00 committed by GitHub
commit abafa68647
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
38 changed files with 116 additions and 103 deletions

View file

@ -6,7 +6,7 @@ import pytest
# import monkeypatch
from _pytest.monkeypatch import MonkeyPatch
from core.plugin.manager.model import PluginModelManager
from core.plugin.impl.model import PluginModelClient
from tests.integration_tests.model_runtime.__mock.plugin_model import MockModelClass
@ -23,9 +23,9 @@ def mock_plugin_daemon(
def unpatch() -> None:
monkeypatch.undo()
monkeypatch.setattr(PluginModelManager, "invoke_llm", MockModelClass.invoke_llm)
monkeypatch.setattr(PluginModelManager, "fetch_model_providers", MockModelClass.fetch_model_providers)
monkeypatch.setattr(PluginModelManager, "get_model_schema", MockModelClass.get_model_schema)
monkeypatch.setattr(PluginModelClient, "invoke_llm", MockModelClass.invoke_llm)
monkeypatch.setattr(PluginModelClient, "fetch_model_providers", MockModelClass.fetch_model_providers)
monkeypatch.setattr(PluginModelClient, "get_model_schema", MockModelClass.get_model_schema)
return unpatch

View file

@ -19,10 +19,10 @@ from core.model_runtime.entities.model_entities import (
)
from core.model_runtime.entities.provider_entities import ConfigurateMethod, ProviderEntity
from core.plugin.entities.plugin_daemon import PluginModelProviderEntity
from core.plugin.manager.model import PluginModelManager
from core.plugin.impl.model import PluginModelClient
class MockModelClass(PluginModelManager):
class MockModelClass(PluginModelClient):
def fetch_model_providers(self, tenant_id: str) -> Sequence[PluginModelProviderEntity]:
"""
Fetch model providers for the given tenant.
@ -232,7 +232,7 @@ class MockModelClass(PluginModelManager):
)
def invoke_llm(
self: PluginModelManager,
self: PluginModelClient,
*,
tenant_id: str,
user_id: str,