Find answers from the community

Updated 2 months ago

Hi! While using pydantic program, I'm

Hi! While using pydantic program, I'm getting this error:

Plain Text
pydantic_core._pydantic_core.ValidationError: 3 validation errors for Data102Model
scope_1_emissions
  Field required [type=missing, input_value={}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.6/v/missing
scope_2_emissions_location_based
  Field required [type=missing, input_value={}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.6/v/missing
scope_3_emissions
  Field required [type=missing, input_value={}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.6/v/missing


Does it mean that my declared fields are wrong?


Not sure what's wrong with my pydantic model:


Plain Text
class Data102Model(BaseModel):
    """Data model of scope 1,2 and 3 emissions"""
    scope_1_emissions: str = Field(
        description='scope 1 emissions value. If not found, return "not mentioned"')
    scope_2_emissions_location_based: str = Field(
        description='location based scope 2 emissions value. If not found, return "not mentioned"')
    scope_3_emissions: str = Field(
        description='scope 3 emissions value. If not found, return "not mentioned"')


please, help
L
p
4 comments
I think this just means the LLM refused to write this object πŸ˜…
Does it decide whether to write the object or not after retrieval (seeing node texts) or before?
the pydantic program writes the object after seeing the entire input prompt
okay, maybe retrieved documents are the reason why it refuses to create the object
Add a reply
Sign up and join the conversation on Discord