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
chore(api): convert RecommendAppRetrievalBase and WorkflowPauseEntity from ABC to Protocol (#37182)
Eric Cao5d814ca8c112
diff --git a/api/repositories/entities/workflow_pause.py b/api/repositories/entities/workflow_pause.pyindex 03ce574dca2..4d9b680e5c9 100644--- a/api/repositories/entities/workflow_pause.py+++ b/api/repositories/entities/workflow_pause.py@@ -6,16 +6,16 @@ by the core workflow module. These models are independent of the storage mechaniand don't contain implementation details like tenant_id, app_id, etc."""-from abc import ABC, abstractmethodfrom collections.abc import Sequencefrom datetime import datetime+from typing import Protocolfrom graphon.entities.pause_reason import PauseReason-class WorkflowPauseEntity(ABC):+class WorkflowPauseEntity(Protocol):"""- Abstract base class for workflow pause entities.+ Protocol for workflow pause entities.This domain model represents a paused workflow execution state,without implementation details like tenant_id, app_id, etc.@@ -27,19 +27,17 @@ class WorkflowPauseEntity(ABC):"""@property- @abstractmethoddef id(self) -> str:"""The identifier of current WorkflowPauseEntity"""- pass+ ...@property- @abstractmethoddef workflow_execution_id(self) -> str:"""The identifier of the workflow execution record the pause associated with.Correspond to `WorkflowExecution.id`."""+ ...- @abstractmethoddef get_state(self) -> bytes:"""Retrieve the serialized workflow state from storage.@@ -56,20 +54,17 @@ class WorkflowPauseEntity(ABC):...@property- @abstractmethoddef resumed_at(self) -> datetime | None:"""`resumed_at` return the resumption time of the current pause, or `None` ifthe pause is not resumed yet."""- pass+ ...@property- @abstractmethoddef paused_at(self) -> datetime:"""`paused_at` returns the creation time of the pause."""- pass+ ...- @abstractmethoddef get_pause_reasons(self) -> Sequence[PauseReason]:"""Retrieve detailed reasons for this pause.diff --git a/api/services/recommend_app/recommend_app_base.py b/api/services/recommend_app/recommend_app_base.pyindex 1f62fbf9d5f..4214d56e4aa 100644--- a/api/services/recommend_app/recommend_app_base.py+++ b/api/services/recommend_app/recommend_app_base.py@@ -1,17 +1,11 @@-from abc import ABC, abstractmethod+from typing import Any, Protocol-class RecommendAppRetrievalBase(ABC):+class RecommendAppRetrievalBase(Protocol):"""Interface for recommend app retrieval."""- @abstractmethod- def get_recommended_apps_and_categories(self, language: str):- raise NotImplementedError+ def get_recommended_apps_and_categories(self, language: str) -> Any: ...- @abstractmethod- def get_recommend_app_detail(self, app_id: str):- raise NotImplementedError+ def get_recommend_app_detail(self, app_id: str) -> Any: ...- @abstractmethod- def get_type(self) -> str:- raise NotImplementedError+ def get_type(self) -> str: ...