fix: restore typing imports to resolve F821 undefined name errors

- Add back Dict, List, Tuple, Type imports that are used throughout the code
- Consolidate duplicate imports in llm.py
- Match existing codebase patterns for type annotations
- Maintain quota limit handling functionality while fixing CI issues

Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
Devin AI
2025-09-02 16:54:27 +00:00
parent 9af8e64205
commit ace1f48cf2
3 changed files with 9 additions and 4 deletions

View File

@@ -3,11 +3,14 @@ import subprocess
import time import time
from typing import ( from typing import (
Any, Any,
Dict,
List,
Literal, Literal,
Optional, Optional,
Tuple,
Type,
Union, Union,
) )
from typing import Dict, List, Tuple, Type
from collections.abc import Callable, Sequence from collections.abc import Callable, Sequence
from pydantic import Field, InstanceOf, PrivateAttr, model_validator from pydantic import Field, InstanceOf, PrivateAttr, model_validator

View File

@@ -1,5 +1,4 @@
from typing import Any, Optional, Union from typing import Any, Dict, List, Optional, Union
from typing import Dict, List
from collections.abc import Callable from collections.abc import Callable
from crewai.agents.agent_builder.base_agent import BaseAgent from crewai.agents.agent_builder.base_agent import BaseAgent

View File

@@ -8,13 +8,16 @@ 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