Address code review feedback: enhance error messages and tests

- Include model name in error messages for better context
- Update all test cases to verify enhanced error messages
- Add new test for error message format validation
- Addresses suggestions from PR review by joaomdmoura

Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
Devin AI
2025-06-16 21:11:24 +00:00
parent dc4eb901e8
commit b6155a118d
2 changed files with 17 additions and 4 deletions

View File

@@ -192,7 +192,7 @@ def convert_with_instructions(
) -> Union[dict, BaseModel, str]:
if agent is None:
Printer().print(
content="Failed to convert text into a Pydantic model: No agent available for conversion. Using raw output instead.",
content=f"Failed to convert text into a Pydantic model: No agent available for conversion. Using raw output instead. Model: {model.__name__}",
color="red",
)
return result