docs: Update documentation for inject_date feature

Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
Devin AI
2025-05-21 04:03:52 +00:00
parent 270a473d5d
commit c3dc839b12
2 changed files with 24 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
from crewai import Agent, Task, Crew
from datetime import datetime
agent = Agent(
role="research_analyst",
@@ -12,7 +13,7 @@ agent_custom_format = Agent(
goal="Provide financial insights with proper date context",
backstory="You are a financial analyst who needs precise date formatting.",
inject_date=True,
date_format="%B %d, %Y", # Format as "May 21, 2025"
date_format="%B %d, %Y", # Format as "May 21, 2025" (Month Day, Year)
)
task = Task(
@@ -20,12 +21,14 @@ task = Task(
expected_output="A comprehensive report on current market trends",
agent=agent,
)
#
task_custom = Task(
description="Analyze financial data and provide insights",
expected_output="A detailed financial analysis report",
agent=agent_custom_format,
)
#
crew = Crew(
agents=[agent, agent_custom_format],