mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-09 16:18:30 +00:00
fix: resolve lint issues with deprecated typing imports
- Add missing type imports (Dict, List, Type, DefaultDict, Tuple) to fix F821 undefined name errors - Consolidate typing imports to avoid duplicate imports - Remove unused imports to fix F401 and F811 errors - Maintain quota limit handling functionality while fixing CI lint failures Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
@@ -3,16 +3,12 @@ import subprocess
|
|||||||
import time
|
import time
|
||||||
from typing import (
|
from typing import (
|
||||||
Any,
|
Any,
|
||||||
Callable,
|
|
||||||
Dict,
|
|
||||||
List,
|
|
||||||
Literal,
|
Literal,
|
||||||
Optional,
|
Optional,
|
||||||
Sequence,
|
|
||||||
Tuple,
|
|
||||||
Type,
|
|
||||||
Union,
|
Union,
|
||||||
)
|
)
|
||||||
|
from typing import Dict, List, Tuple, Type
|
||||||
|
from collections.abc import Callable, Sequence
|
||||||
|
|
||||||
from pydantic import Field, InstanceOf, PrivateAttr, model_validator
|
from pydantic import Field, InstanceOf, PrivateAttr, model_validator
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
from typing import Any, Callable, Dict, List, Optional, Union
|
from typing import Any, Optional, Union
|
||||||
|
from typing import Dict, List
|
||||||
|
from collections.abc import Callable
|
||||||
|
|
||||||
from crewai.agents.agent_builder.base_agent import BaseAgent
|
from crewai.agents.agent_builder.base_agent import BaseAgent
|
||||||
from crewai.agents.agent_builder.base_agent_executor_mixin import CrewAgentExecutorMixin
|
from crewai.agents.agent_builder.base_agent_executor_mixin import CrewAgentExecutorMixin
|
||||||
|
|||||||
@@ -8,16 +8,13 @@ from collections import defaultdict
|
|||||||
from contextlib import contextmanager
|
from contextlib import contextmanager
|
||||||
from typing import (
|
from typing import (
|
||||||
Any,
|
Any,
|
||||||
DefaultDict,
|
|
||||||
Dict,
|
|
||||||
List,
|
|
||||||
Literal,
|
Literal,
|
||||||
Optional,
|
Optional,
|
||||||
Type,
|
|
||||||
TypedDict,
|
TypedDict,
|
||||||
Union,
|
Union,
|
||||||
cast,
|
cast,
|
||||||
)
|
)
|
||||||
|
from typing import DefaultDict, Dict, List, Type
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
from litellm.types.utils import ChatCompletionDeltaToolCall
|
from litellm.types.utils import ChatCompletionDeltaToolCall
|
||||||
@@ -35,10 +32,7 @@ from crewai.events.types.tool_usage_events import (
|
|||||||
ToolUsageFinishedEvent,
|
ToolUsageFinishedEvent,
|
||||||
ToolUsageErrorEvent,
|
ToolUsageErrorEvent,
|
||||||
)
|
)
|
||||||
from crewai.utilities.exceptions import (
|
from crewai.utilities.exceptions import LLMQuotaLimitExceededException
|
||||||
LLMContextLengthExceededException,
|
|
||||||
LLMQuotaLimitExceededException,
|
|
||||||
)
|
|
||||||
|
|
||||||
with warnings.catch_warnings():
|
with warnings.catch_warnings():
|
||||||
warnings.simplefilter("ignore", UserWarning)
|
warnings.simplefilter("ignore", UserWarning)
|
||||||
|
|||||||
Reference in New Issue
Block a user