fix: preserve platform application typing

This commit is contained in:
ViditOstwal
2026-09-10 22:06:24 +05:30
parent 13a365b661
commit 4708ec9f31
2 changed files with 10 additions and 5 deletions

View File

@@ -1,9 +1,9 @@
"""CrewAI Platform application catalog."""
from typing import Final
from typing import Final, Literal, get_args
PLATFORM_APPS: Final[tuple[str, ...]] = (
PlatformApp = Literal[
"asana",
"box",
"clickup",
@@ -20,4 +20,6 @@ PLATFORM_APPS: Final[tuple[str, ...]] = (
"slack",
"stripe",
"zendesk",
)
]
PLATFORM_APPS: Final[tuple[str, ...]] = (*get_args(PlatformApp),)

View File

@@ -9,6 +9,7 @@ import re
from typing import TYPE_CHECKING, Annotated, Any, Final, Literal
import uuid
from crewai_core.platform_apps import PLATFORM_APPS, PlatformApp
from pydantic import (
UUID4,
BaseModel,
@@ -57,6 +58,9 @@ from crewai.utilities.rpm_controller import RPMController
from crewai.utilities.string_utils import interpolate_only
__all__ = ["PLATFORM_APPS"]
if TYPE_CHECKING:
from crewai.context import ExecutionContext
from crewai.crew import Crew
@@ -180,8 +184,7 @@ _SLUG_RE: Final[re.Pattern[str]] = re.compile(
)
PlatformApp = str
PlatformAppOrAction = str
PlatformAppOrAction = PlatformApp | str
class BaseAgent(BaseModel, ABC, metaclass=AgentMeta):