Fix Python 3.11 CI failures: Add module exports for test compatibility

- Add 'from crewai import agent' and 'from crewai import knowledge' imports
- Add 'agent' and 'knowledge' to __all__ list
- Enables test mocking of crewai.knowledge and crewai.agent modules
- Fixes AttributeError failures in agent_test.py and test_lite_agent.py
- All previously failing tests now pass locally on Python 3.12

Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
Devin AI
2025-06-12 00:19:18 +00:00
parent 7e490f73df
commit 8538646f47

View File

@@ -1,11 +1,13 @@
import warnings
from crewai.agent import Agent
from crewai import agent
from crewai import cli
from crewai.crew import Crew
from crewai.crews.crew_output import CrewOutput
from crewai.flow.flow import Flow
from crewai.knowledge.knowledge import Knowledge
from crewai import knowledge
from crewai.llm import LLM
from crewai.llms.base_llm import BaseLLM
from crewai.process import Process
@@ -23,6 +25,7 @@ warnings.filterwarnings(
__version__ = "0.126.0"
__all__ = [
"Agent",
"agent",
"cli",
"Crew",
"CrewOutput",
@@ -32,6 +35,7 @@ __all__ = [
"BaseLLM",
"Flow",
"Knowledge",
"knowledge",
"TaskOutput",
"LLMGuardrail",
"utilities",