mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-12 17:48:30 +00:00
feat: Add inject_date flag to Agent for automatic date injection
Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
22
docs/usage_examples/inject_date_example.py
Normal file
22
docs/usage_examples/inject_date_example.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from crewai import Agent, Task, Crew
|
||||
|
||||
agent = Agent(
|
||||
role="research_analyst",
|
||||
goal="Provide timely and accurate research",
|
||||
backstory="You are a research analyst who always provides up-to-date information.",
|
||||
inject_date=True, # Enable automatic date injection
|
||||
)
|
||||
|
||||
task = Task(
|
||||
description="Research market trends and provide analysis",
|
||||
expected_output="A comprehensive report on current market trends",
|
||||
agent=agent,
|
||||
)
|
||||
|
||||
crew = Crew(
|
||||
agents=[agent],
|
||||
tasks=[task],
|
||||
)
|
||||
|
||||
result = crew.kickoff()
|
||||
print(result)
|
||||
Reference in New Issue
Block a user