fix: ensure type names are quoted in model descriptions

Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
Devin AI
2025-02-21 11:50:37 +00:00
parent f65c31bfd0
commit da0d37af03

View File

@@ -327,9 +327,9 @@ def generate_model_description(model: Type[BaseModel]) -> str:
elif isinstance(field_type, type) and issubclass(field_type, BaseModel):
return generate_model_description(field_type)
elif hasattr(field_type, "__name__"):
return field_type.__name__
return f'"{field_type.__name__}"'
else:
return str(field_type)
return f'"{str(field_type)}"'
fields = model.model_fields
field_descriptions = []