Find answers from the community

Updated 4 months ago

Hi! While using pydantic program, I'm

At a glance
The community member is using a pydantic program and is getting a validation error related to missing fields in their Data102Model. The error message indicates that the fields scope_1_emissions, scope_2_emissions_location_based, and scope_3_emissions are required but are missing. The community member is unsure if the declared fields are wrong. The comments suggest that the issue may be related to the way the pydantic program writes the object, with one community member speculating that the program may refuse to write the object due to the retrieved documents. However, there is no explicitly marked answer in the provided information.
Useful resources
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