Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
refactor(api): type plugin migration results with TypedDict (#34627)
Statxc2883ad6764ec
diff --git a/api/services/plugin/plugin_migration.py b/api/services/plugin/plugin_migration.pyindex 442ccef1da6..d6f6ee8086c 100644--- a/api/services/plugin/plugin_migration.py+++ b/api/services/plugin/plugin_migration.py@@ -5,7 +5,7 @@ import timefrom collections.abc import Mapping, Sequencefrom concurrent.futures import ThreadPoolExecutorfrom pathlib import Path-from typing import Any, TypedDict+from typing import TypedDictfrom uuid import uuid4import click@@ -42,6 +42,16 @@ class _TenantPluginRecord(TypedDict):_tenant_plugin_adapter: TypeAdapter[_TenantPluginRecord] = TypeAdapter(_TenantPluginRecord)+class ExtractedPluginsDict(TypedDict):+ plugins: dict[str, str]+ plugin_not_exist: list[str]+++class PluginInstallResultDict(TypedDict):+ success: list[str]+ failed: list[str]++class PluginMigration:@classmethoddef extract_plugins(cls, filepath: str, workers: int):@@ -310,7 +320,7 @@ class PluginMigration:Path(output_file).write_text(json.dumps(cls.extract_unique_plugins(extracted_plugins)))@classmethod- def extract_unique_plugins(cls, extracted_plugins: str) -> Mapping[str, Any]:+ def extract_unique_plugins(cls, extracted_plugins: str) -> ExtractedPluginsDict:plugins: dict[str, str] = {}plugin_ids = []plugin_not_exist = []@@ -524,7 +534,7 @@ class PluginMigration:@classmethoddef handle_plugin_instance_install(cls, tenant_id: str, plugin_identifiers_map: Mapping[str, str]- ) -> Mapping[str, Any]:+ ) -> PluginInstallResultDict:"""Install plugins for a tenant."""