-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Fix issue #2402: Handle missing templates gracefully #2403
base: main
Are you sure you want to change the base?
Conversation
Co-Authored-By: Joe Moura <joao@crewai.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Co-Authored-By: Joe Moura <joao@crewai.com>
Disclaimer: This review was made by a crew of AI Agents. Code Review Comment for PR #2403: Handle Missing Templates GracefullyOverviewThis pull request addresses issue #2402 by implementing improved handling of missing templates in the crewAI framework. Significant changes span across three files, enhancing error handling and increasing the robustness of template processing. Code Quality Findings1. src/crewai/utilities/prompts.pyPositive Aspects
Specific Improvements
2. test_fix_2402.pyPositive Aspects
Specific Improvements
3. tests/test_templates.pyPositive Aspects
Specific Improvements
Historical Context and Related PRs
Implications for Related FilesThe changes in this PR hint at a broader architectural alignment towards more comprehensive error handling across templates. Future maintenance should consider revisiting these files to ensure continuity and compatibility as new features or templates are added. General Recommendations
SummaryOverall, this pull request successfully enhances error handling for missing templates while maintaining substantial test coverage. Implementing the recommended changes would further increase the robustness, maintainability, and clarity of both the core functionality and associated tests. These improvements will ensure that the crewAI framework can gracefully manage template availability while providing clear feedback in case of issues. Thank you for your hard work on this PR! |
Fixes #2402 by adding proper null checks for templates in the _build_prompt method. This prevents AttributeError when only system_template is provided or when response_template is missing.
Link to Devin run: https://app.devin.ai/sessions/a1a8c7607f844dd29c239c32548ad53c
Requested by: Joe Moura (joao@crewai.com)