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.
This commit is contained in:
-LAN- 2026-04-22 00:02:42 +08:00
parent 9a2bea9287
commit 0b8bb85094
No known key found for this signature in database
GPG Key ID: 6BA0D108DED011FF

View File

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