Eric Botti commited on
Commit
ff62b8a
·
1 Parent(s): c6447fa

readding starts with "I" validation

Browse files
Files changed (1) hide show
  1. src/output_formats.py +6 -6
src/output_formats.py CHANGED
@@ -28,12 +28,12 @@ class AnimalDescriptionFormat(OutputFormatModel):
28
  description: str = Field(description="A brief description of the animal")
29
  """A brief description of the animal"""
30
 
31
- # @field_validator('description')
32
- # @classmethod
33
- # def check_starting_character(cls, v) -> str:
34
- # if not v[0].upper() == 'I':
35
- # raise ValueError("Description must begin with 'I'")
36
- # return v
37
 
38
 
39
  class ChameleonGuessFormat(OutputFormatModel):
 
28
  description: str = Field(description="A brief description of the animal")
29
  """A brief description of the animal"""
30
 
31
+ @field_validator('description')
32
+ @classmethod
33
+ def check_starting_character(cls, v) -> str:
34
+ if not v[0].upper() == 'I':
35
+ raise ValueError("Please rewrite your description so that it begins with 'I'")
36
+ return v
37
 
38
 
39
  class ChameleonGuessFormat(OutputFormatModel):