From ed61f467b147c8d0c76cb10a73663e41f1350ed2 Mon Sep 17 00:00:00 2001 From: Greyson LaLonde Date: Fri, 29 Dec 2023 20:39:59 -0500 Subject: [PATCH] Update to use absolute imports (#17) Update to use absolute imports --- crewai/__init__.py | 8 ++++---- crewai/agent.py | 4 ++-- crewai/crew.py | 10 +++++----- crewai/task.py | 2 +- crewai/tools/agent_tools.py | 2 +- pyproject.toml | 1 + 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/crewai/__init__.py b/crewai/__init__.py index dbff2fe58..47a761f11 100644 --- a/crewai/__init__.py +++ b/crewai/__init__.py @@ -1,4 +1,4 @@ -from .agent import Agent -from .crew import Crew -from .process import Process -from .task import Task +from crewai.agent import Agent +from crewai.crew import Crew +from crewai.process import Process +from crewai.task import Task diff --git a/crewai/agent.py b/crewai/agent.py index 6759dfdc9..68e657281 100644 --- a/crewai/agent.py +++ b/crewai/agent.py @@ -8,8 +8,8 @@ from langchain.tools.render import render_text_description from langchain_core.runnables.config import RunnableConfig from pydantic import BaseModel, Field, InstanceOf, model_validator -from .agents import CacheHandler, CrewAgentOutputParser, ToolsHandler -from .prompts import Prompts +from crewai.agents import CacheHandler, CrewAgentOutputParser, ToolsHandler +from crewai.prompts import Prompts class Agent(BaseModel): diff --git a/crewai/crew.py b/crewai/crew.py index dab14b2e7..8c302a2a3 100644 --- a/crewai/crew.py +++ b/crewai/crew.py @@ -11,11 +11,11 @@ from pydantic import ( ) from pydantic_core import PydanticCustomError -from .agent import Agent -from .agents import CacheHandler -from .process import Process -from .task import Task -from .tools.agent_tools import AgentTools +from crewai.agent import Agent +from crewai.process import Process +from crewai.task import Task +from crewai.tools.agent_tools import AgentTools +from crewai.agents import CacheHandler class Crew(BaseModel): diff --git a/crewai/task.py b/crewai/task.py index 11dd799c0..e87caf0a0 100644 --- a/crewai/task.py +++ b/crewai/task.py @@ -2,7 +2,7 @@ from typing import Any, List, Optional from pydantic import BaseModel, Field, model_validator -from .agent import Agent +from crewai.agent import Agent class Task(BaseModel): diff --git a/crewai/tools/agent_tools.py b/crewai/tools/agent_tools.py index 3c443261b..9e8cb2d8d 100644 --- a/crewai/tools/agent_tools.py +++ b/crewai/tools/agent_tools.py @@ -4,7 +4,7 @@ from typing import List from langchain.tools import Tool from pydantic import BaseModel, Field -from ..agent import Agent +from crewai.agent import Agent class AgentTools(BaseModel): diff --git a/pyproject.toml b/pyproject.toml index f884696d5..d3dd800db 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,6 +25,7 @@ pre-commit = "^3.6.0" [tool.isort] profile = "black" +known_first_party = ["crewai"] [tool.poetry.group.test.dependencies] pytest = "^7.4"