Skip to content

Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks.

chore: update template files to use modern type annotations

Chujiang670cdcacaadc
diff --git a/lib/crewai/src/crewai/cli/templates/crew/crew.py b/lib/crewai/src/crewai/cli/templates/crew/crew.py
index 43a2608a4..758d324df 100644
--- a/lib/crewai/src/crewai/cli/templates/crew/crew.py
+++ b/lib/crewai/src/crewai/cli/templates/crew/crew.py
@@ -1,7 +1,6 @@
from crewai import Agent, Crew, Process, Task
from crewai.project import CrewBase, agent, crew, task
from crewai.agents.agent_builder.base_agent import BaseAgent
-from typing import List
# If you want to run a snippet of code before or after the crew starts,
# you can use the @before_kickoff and @after_kickoff decorators
# https://docs.crewai.com/concepts/crews#example-crew-class-with-decorators
@@ -10,8 +9,8 @@ from typing import List
class {{crew_name}}():
"""{{crew_name}} crew"""
- agents: List[BaseAgent]
- tasks: List[Task]
+ agents: list[BaseAgent]
+ tasks: list[Task]
# Learn more about YAML configuration files here:
# Agents: https://docs.crewai.com/concepts/agents#yaml-configuration-recommended
diff --git a/lib/crewai/src/crewai/cli/templates/flow/crews/poem_crew/poem_crew.py b/lib/crewai/src/crewai/cli/templates/flow/crews/poem_crew/poem_crew.py
index 8c3358097..a3feceb77 100644
--- a/lib/crewai/src/crewai/cli/templates/flow/crews/poem_crew/poem_crew.py
+++ b/lib/crewai/src/crewai/cli/templates/flow/crews/poem_crew/poem_crew.py
@@ -1,5 +1,3 @@
-from typing import List
-
from crewai import Agent, Crew, Process, Task
from crewai.agents.agent_builder.base_agent import BaseAgent
from crewai.project import CrewBase, agent, crew, task
@@ -13,8 +11,8 @@ from crewai.project import CrewBase, agent, crew, task
class PoemCrew:
"""Poem Crew"""
- agents: List[BaseAgent]
- tasks: List[Task]
+ agents: list[BaseAgent]
+ tasks: list[Task]
# Learn more about YAML configuration files here:
# Agents: https://docs.crewai.com/concepts/agents#yaml-configuration-recommended