mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-09-22 10:56:50 +00:00
fix: preserve platform application typing
This commit is contained in:
@@ -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),)
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user