Eric Botti commited on
Commit
667d00f
·
1 Parent(s): bee27cc

dropping word count validator

Browse files
Files changed (1) hide show
  1. src/output_formats.py +0 -9
src/output_formats.py CHANGED
@@ -4,7 +4,6 @@ import json
4
 
5
  from pydantic import BaseModel, field_validator, Field
6
 
7
- MAX_DESCRIPTION_LEN = 10
8
  FORMAT_INSTRUCTIONS = """Please reformat your previous response as a JSON instance that conforms to the JSON structure below.
9
  Here is the output format:
10
  {schema}
@@ -58,14 +57,6 @@ class AnimalDescriptionFormat(BaseModel):
58
  raise ValueError("Description must begin with 'I'")
59
  return v
60
 
61
- @field_validator('description')
62
- @classmethod
63
- def wordcount(cls, v) -> str:
64
- count = len(v.split())
65
- if count > MAX_DESCRIPTION_LEN:
66
- raise ValueError(f"Animal Description must be {MAX_DESCRIPTION_LEN} words or less")
67
- return v
68
-
69
 
70
  class ChameleonGuessFormat(BaseModel):
71
  animal: str = Field("The name of the animal you think the chameleon is")
 
4
 
5
  from pydantic import BaseModel, field_validator, Field
6
 
 
7
  FORMAT_INSTRUCTIONS = """Please reformat your previous response as a JSON instance that conforms to the JSON structure below.
8
  Here is the output format:
9
  {schema}
 
57
  raise ValueError("Description must begin with 'I'")
58
  return v
59
 
 
 
 
 
 
 
 
 
60
 
61
  class ChameleonGuessFormat(BaseModel):
62
  animal: str = Field("The name of the animal you think the chameleon is")