Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update date to current year in template #1860

Merged
merged 2 commits into from
Jan 7, 2025

Conversation

dandawg
Copy link
Contributor

@dandawg dandawg commented Jan 6, 2025

The example task template states "given the current year is 2024". This PR updates the date to 2025--it is a very small change.

An alternative to this PR would be to just keep the date at 2024, but the example will show more relevant results for people if this is updated to 2025.

Signed-off-by: dandawg <12484302+dandawg@users.noreply.github.com>
@joaomdmoura
Copy link
Collaborator

Disclaimer: This review was made by a crew of AI Agents.

Code Review for PR #1860

Overview

This pull request updates the hardcoded year in the task description template located in src/crewai/cli/templates/crew/config/tasks.yaml, changing it from 2024 to 2025. While this change is necessary for keeping our documentation current, it highlights the need for a more sustainable approach to managing dynamic values in our templates.

Code Quality Findings

  1. Hardcoded Date Value:

    • The pull request retains the legacy issue of hardcoding values. Other than updating the year, this approach requires manual intervention each year, risking the potential for outdated information going unnoticed.
  2. Documentation Maintenance:

    • The current documentation practice relies on manual updates. This could lead to inconsistencies and inaccuracies if the year is not updated annually.

Suggestions for Improvement

  1. Dynamic Year Implementation:

    • It would be highly beneficial to adopt a dynamic solution to automatically generate the current year. Consider modifying the YAML template as follows:
    research_task:
      description: >
        Conduct thorough research about {topic}
        Make sure you find any interesting and relevant information given
        the current year is {current_year}.
    • This would necessitate a Python function to inject the current year into the template:
    from datetime import datetime
    
    def get_task_description(topic):
        current_year = datetime.now().year
        return template.format(topic=topic, current_year=current_year)
  2. Configuration Externalization:

    • Consider moving year-related configurations to external configuration files or environment variables. This would centralize the management of dynamic values and reduce future manual updates.
  3. Documentation Updates:

    • If the hardcoded approach is retained, ensure to include comments in the YAML file to inform maintainers about the necessity for regular updates:
    # Note: Update the year value annually
    research_task:
      description: >
        Conduct thorough research about {topic}
        Make sure you find any interesting and relevant information given
        the current year is 2025.

Historical Context and Related PRs

This PR highlights a recurring pattern of hardcoding dynamic values within the templates. Previous pull requests may indicate this has been an oversight that could be addressed through the adoption of more dynamic strategies.

Testing Recommendations

  • Update any tests that reference the year to ensure accuracy.
  • Implement tests to verify that the task description correctly incorporates the current year.

Conclusion

While the change made in PR #1860 is valid and necessary as a quick fix, transitioning to a more dynamic approach will significantly mitigate the risk of outdated content within our task templates. I recommend considering the suggested improvements for future updates to enhance the maintainability and accuracy of our documentation.

Signed-off-by: dandawg <12484302+dandawg@users.noreply.github.com>
@dandawg
Copy link
Contributor Author

dandawg commented Jan 7, 2025

I think this is the first time I've been reviewed by an AI Agent--super cool! I like suggestion 1. Since the quickstart example template already has a parameter ("topic"), I was able to just add a date parameter in.

Copy link
Collaborator

@joaomdmoura joaomdmoura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it :) thanks!

@joaomdmoura joaomdmoura merged commit 673a38c into crewAIInc:main Jan 7, 2025
devin-ai-integration bot pushed a commit that referenced this pull request Feb 9, 2025
* update date to current year in template

Signed-off-by: dandawg <12484302+dandawg@users.noreply.github.com>

* current_year update to example task template

Signed-off-by: dandawg <12484302+dandawg@users.noreply.github.com>

---------

Signed-off-by: dandawg <12484302+dandawg@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants