From 0b8bb850946e7b8ebdb5586e7342a0b769f8e600 Mon Sep 17 00:00:00 2001 From: -LAN- Date: Wed, 22 Apr 2026 00:02:42 +0800 Subject: [PATCH] chore(api): upgrade graphon to v0.3.0 Adapt the backend Graphon integration to the v0.3.0 breaking changes. Migrate provider factory and runtime usage, switch workflow node construction to the new data payload API, and refresh backend tests for the updated VariablePool and node behaviors. --- api/core/plugin/impl/model_runtime_factory.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/api/core/plugin/impl/model_runtime_factory.py b/api/core/plugin/impl/model_runtime_factory.py index fbe307ea60..98a5660fdf 100644 --- a/api/core/plugin/impl/model_runtime_factory.py +++ b/api/core/plugin/impl/model_runtime_factory.py @@ -125,6 +125,20 @@ def create_plugin_model_provider_factory(*, tenant_id: str, user_id: str | None return create_plugin_model_assembly(tenant_id=tenant_id, user_id=user_id).model_provider_factory +def create_plugin_model_type_instance( + *, + tenant_id: str, + provider: str, + model_type: ModelType, + user_id: str | None = None, +) -> AIModel: + """Create a tenant-bound model wrapper for the requested provider and model type.""" + return create_plugin_model_assembly(tenant_id=tenant_id, user_id=user_id).create_model_type_instance( + provider=provider, + model_type=model_type, + ) + + def create_plugin_provider_manager(*, tenant_id: str, user_id: str | None = None) -> ProviderManager: """Create a tenant-bound provider manager for service flows.""" return create_plugin_model_assembly(tenant_id=tenant_id, user_id=user_id).provider_manager