mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-23 23:28:15 +00:00
fix(files): make FileInput available at runtime for Pydantic models
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
from collections.abc import Callable
|
||||
import inspect
|
||||
|
||||
@@ -10,7 +10,6 @@ import logging
|
||||
from pathlib import Path
|
||||
import threading
|
||||
from typing import (
|
||||
TYPE_CHECKING,
|
||||
Any,
|
||||
ClassVar,
|
||||
cast,
|
||||
@@ -31,10 +30,6 @@ from pydantic import (
|
||||
from pydantic_core import PydanticCustomError
|
||||
from typing_extensions import Self
|
||||
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from crewai_files import FileInput
|
||||
|
||||
from crewai.agents.agent_builder.base_agent import BaseAgent
|
||||
from crewai.events.event_bus import crewai_event_bus
|
||||
from crewai.events.types.task_events import (
|
||||
@@ -57,10 +52,11 @@ from crewai.utilities.file_store import (
|
||||
|
||||
|
||||
try:
|
||||
from crewai_files import FilePath
|
||||
from crewai_files import FileInput, FilePath
|
||||
|
||||
HAS_CREWAI_FILES = True
|
||||
except ImportError:
|
||||
FileInput = Any # type: ignore[misc,assignment]
|
||||
HAS_CREWAI_FILES = False
|
||||
from crewai.utilities.guardrail import (
|
||||
process_guardrail,
|
||||
|
||||
Reference in New Issue
Block a user