mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 00:28:31 +00:00
fix linters
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
from typing import Optional
|
|
||||||
from pydantic import BaseModel, Field
|
|
||||||
from crewai.tools.base_tool import BaseTool
|
from crewai.tools.base_tool import BaseTool
|
||||||
from crewai.utilities import I18N
|
from crewai.utilities import I18N
|
||||||
|
from pydantic import BaseModel, Field
|
||||||
|
from typing import Optional
|
||||||
|
|
||||||
i18n = I18N()
|
i18n = I18N()
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
from typing import Optional
|
|
||||||
from pydantic import BaseModel, Field
|
|
||||||
from crewai.tools.agent_tools.base_agent_tools import BaseAgentTool
|
from crewai.tools.agent_tools.base_agent_tools import BaseAgentTool
|
||||||
|
from pydantic import BaseModel, Field
|
||||||
|
from typing import Optional
|
||||||
|
|
||||||
|
|
||||||
class DelegateWorkToolSchema(BaseModel):
|
class DelegateWorkToolSchema(BaseModel):
|
||||||
|
|||||||
@@ -1,26 +1,25 @@
|
|||||||
import ast
|
import ast
|
||||||
import datetime
|
import datetime
|
||||||
import time
|
|
||||||
from difflib import SequenceMatcher
|
from difflib import SequenceMatcher
|
||||||
|
import time
|
||||||
from textwrap import dedent
|
from textwrap import dedent
|
||||||
from typing import Any, List, Union
|
from typing import Any, List, Union
|
||||||
|
|
||||||
from crewai.tools.structured_tool import CrewStructuredTool
|
|
||||||
import crewai.utilities.events as events
|
|
||||||
from crewai.agents.tools_handler import ToolsHandler
|
from crewai.agents.tools_handler import ToolsHandler
|
||||||
from crewai.task import Task
|
from crewai.task import Task
|
||||||
from crewai.telemetry import Telemetry
|
from crewai.telemetry import Telemetry
|
||||||
from crewai.tools import BaseTool
|
from crewai.tools import BaseTool
|
||||||
|
from crewai.tools.structured_tool import CrewStructuredTool
|
||||||
from crewai.tools.tool_calling import InstructorToolCalling, ToolCalling
|
from crewai.tools.tool_calling import InstructorToolCalling, ToolCalling
|
||||||
from crewai.tools.tool_usage_events import ToolUsageError, ToolUsageFinished
|
from crewai.tools.tool_usage_events import ToolUsageError, ToolUsageFinished
|
||||||
from crewai.utilities import I18N, Converter, ConverterError, Printer
|
from crewai.utilities import Converter, ConverterError, I18N, Printer
|
||||||
|
import crewai.utilities.events as events
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import agentops # type: ignore
|
import agentops # type: ignore
|
||||||
except ImportError:
|
except ImportError:
|
||||||
agentops = None
|
agentops = None
|
||||||
|
OPENAI_BIGGER_MODELS = ["gpt-4", "gpt-4o", "o1-preview", "o1-mini", "o1", "o3", "o3-mini"]
|
||||||
OPENAI_BIGGER_MODELS = ["gpt-4", "gpt-4o", "o1-preview", "o1-mini"]
|
|
||||||
|
|
||||||
|
|
||||||
class ToolUsageErrorException(Exception):
|
class ToolUsageErrorException(Exception):
|
||||||
|
|||||||
@@ -417,9 +417,11 @@ def test_crew_with_delegating_agents():
|
|||||||
@pytest.mark.vcr(filter_headers=["authorization"])
|
@pytest.mark.vcr(filter_headers=["authorization"])
|
||||||
def test_crew_with_delegating_agents_should_not_override_task_tools():
|
def test_crew_with_delegating_agents_should_not_override_task_tools():
|
||||||
from typing import Type
|
from typing import Type
|
||||||
from crewai.tools import BaseTool
|
|
||||||
from pydantic import BaseModel, Field
|
from pydantic import BaseModel, Field
|
||||||
|
|
||||||
|
from crewai.tools import BaseTool
|
||||||
|
|
||||||
class TestToolInput(BaseModel):
|
class TestToolInput(BaseModel):
|
||||||
"""Input schema for TestTool."""
|
"""Input schema for TestTool."""
|
||||||
query: str = Field(..., description="Query to process")
|
query: str = Field(..., description="Query to process")
|
||||||
@@ -470,9 +472,9 @@ def test_crew_with_delegating_agents_should_not_override_task_tools():
|
|||||||
|
|
||||||
@pytest.mark.vcr(filter_headers=["authorization"])
|
@pytest.mark.vcr(filter_headers=["authorization"])
|
||||||
def test_crew_with_delegating_agents_should_not_override_agent_tools():
|
def test_crew_with_delegating_agents_should_not_override_agent_tools():
|
||||||
from typing import Type
|
|
||||||
from crewai.tools import BaseTool
|
from crewai.tools import BaseTool
|
||||||
from pydantic import BaseModel, Field
|
from pydantic import BaseModel, Field
|
||||||
|
from typing import Type
|
||||||
|
|
||||||
class TestToolInput(BaseModel):
|
class TestToolInput(BaseModel):
|
||||||
"""Input schema for TestTool."""
|
"""Input schema for TestTool."""
|
||||||
@@ -584,9 +586,9 @@ def test_task_tools_override_agent_tools_with_allow_delegation():
|
|||||||
"""
|
"""
|
||||||
Test that task tools override agent tools while preserving delegation tools when allow_delegation=True
|
Test that task tools override agent tools while preserving delegation tools when allow_delegation=True
|
||||||
"""
|
"""
|
||||||
from typing import Type
|
|
||||||
from crewai.tools import BaseTool
|
from crewai.tools import BaseTool
|
||||||
from pydantic import BaseModel, Field
|
from pydantic import BaseModel, Field
|
||||||
|
from typing import Type
|
||||||
|
|
||||||
class TestToolInput(BaseModel):
|
class TestToolInput(BaseModel):
|
||||||
query: str = Field(..., description="Query to process")
|
query: str = Field(..., description="Query to process")
|
||||||
@@ -2883,10 +2885,10 @@ def test_task_tools_preserve_code_execution_tools():
|
|||||||
"""
|
"""
|
||||||
Test that task tools don't override code execution tools when allow_code_execution=True
|
Test that task tools don't override code execution tools when allow_code_execution=True
|
||||||
"""
|
"""
|
||||||
|
from pydantic import BaseModel, Field
|
||||||
from typing import Type
|
from typing import Type
|
||||||
from crewai.tools import BaseTool
|
from crewai.tools import BaseTool
|
||||||
from crewai_tools import CodeInterpreterTool
|
from crewai_tools import CodeInterpreterTool
|
||||||
from pydantic import BaseModel, Field
|
|
||||||
|
|
||||||
class TestToolInput(BaseModel):
|
class TestToolInput(BaseModel):
|
||||||
"""Input schema for TestTool."""
|
"""Input schema for TestTool."""
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
"""Test Knowledge creation and querying functionality."""
|
"""Test Knowledge creation and querying functionality."""
|
||||||
|
|
||||||
|
import pytest
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import List, Union
|
from typing import List, Union
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
import pytest
|
|
||||||
from crewai.knowledge.source.crew_docling_source import CrewDoclingSource
|
from crewai.knowledge.source.crew_docling_source import CrewDoclingSource
|
||||||
from crewai.knowledge.source.csv_knowledge_source import CSVKnowledgeSource
|
from crewai.knowledge.source.csv_knowledge_source import CSVKnowledgeSource
|
||||||
from crewai.knowledge.source.excel_knowledge_source import ExcelKnowledgeSource
|
from crewai.knowledge.source.excel_knowledge_source import ExcelKnowledgeSource
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
"""Tests for task guardrails functionality."""
|
"""Tests for task guardrails functionality."""
|
||||||
|
|
||||||
from unittest.mock import Mock
|
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from crewai.task import Task
|
from crewai.task import Task
|
||||||
from crewai.tasks.task_output import TaskOutput
|
from crewai.tasks.task_output import TaskOutput
|
||||||
|
from unittest.mock import Mock
|
||||||
|
|
||||||
def test_task_without_guardrail():
|
def test_task_without_guardrail():
|
||||||
"""Test that tasks work normally without guardrails (backward compatibility)."""
|
"""Test that tasks work normally without guardrails (backward compatibility)."""
|
||||||
|
|||||||
Reference in New Issue
Block a user