PydanticOutputParser ` ValidationError: Field required [type=missing,' for an Optional field
Labels: name: auto:bug

### Checked other resources

- [X] I added a very descriptive title to this issue.
- [X] I searched the LangChain documentation with the integrated search.
- [X] I used the GitHub search to find a similar question and didn't find it.

### Example Code

The following code follows the example from [langchain docs](https://python.langchain.com/docs/use_cases/extraction#option-2-parsing).
```python
class Person(BaseModel):
    person_name: str
    person_height: int
    person_hair_color: str

    dog_breed: Optional[str]
    dog_name: Optional[str]

class People(BaseModel):
    """Identifying information about all people in a text."""

    people: Sequence[Person]

query = """Alex is 5 feet tall. Claudia is 1 feet taller Alex and jumps higher than him. Claudia is a brunette and Alex is blonde. Alex has a poodle named Rex."""

# Set up a parser + inject instructions into the prompt template
parser = PydanticOutputParser(pydantic_object=People)

prompt = PromptTemplate(
    template="Follow the given instructions and perform the task mentioned in the context of given information. \n{format_instructions}\n Context is:\n{query}\n",
    input_variables=["query"],
    partial_variables={"format_instructions": parser.get_format_instructions()},
)

input_to_model=prompt.format_prompt(query=query)
print(input_to_model.to_string())

# output=FLAN.generate_text(input_to_model.to_string())
output=LLAMA.generate_text(input_to_model.to_string())


print(output)
parser.parse(output)
```



### Description

* I'm trying to use PydanticOutputParser for structured output.
* Incase of an optional field missing from JSON, pydanticoutput parser raises a validation error saying missing a required field

Output from model:
```json
```
{
  "people": [
    {
      "person_name": "Alex",
      "person_height": 5,
      "person_hair_color": "blonde",
      "dog_breed": "poodle",
      "dog_name": "Rex"
    },
    {
      "person_name": "Claudia",
      "person_height": 6,
      "person_hair_color": "brunette"
    }
  ]
}
```
```

Complete Error:
```json
{
	"name": "ValidationError",
	"message": "2 validation errors for People\npeople.1.dog_breed\n  Field required [type=missing, input_value={'person_name': 'Claudia'...hair_color': 'brunette'}, input_type=dict]\n    For further information visit https://errors.pydantic.dev/2.5/v/missing\npeople.1.dog_name\n  Field required [type=missing, input_value={'person_name': 'Claudia'...hair_color': 'brunette'}, input_type=dict]\n    For further information visit https://errors.pydantic.dev/2.5/v/missing",
	"stack": "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mValidationError\u001b[0m                           Traceback (most recent call last)\nCell \u001b[1;32mIn[70], line 33\u001b[0m\n\u001b[0;32m     30\u001b[0m \u001b[38;5;66;03m# output=FLAN.generate_text(input_to_model.to_string())\u001b[39;00m\n\u001b[0;32m     32\u001b[0m \u001b[38;5;28mprint\u001b[39m(output)\n\u001b[1;32m---> 33\u001b[0m \u001b[43mparser\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mparse\u001b[49m\u001b[43m(\u001b[49m\u001b[43moutput\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m     35\u001b[0m \u001b[38;5;66;03m# print(parser.get_format_instructions())\u001b[39;00m\n\nFile \u001b[1;32mc:\\Users\\user\\repos\\.venv\\Lib\\site-packages\\langchain\\output_parsers\\pydantic.py:30\u001b[0m, in \u001b[0;36mPydanticOutputParser.parse\u001b[1;34m(self, text)\u001b[0m\n\u001b[0;32m     28\u001b[0m         json_str \u001b[38;5;241m=\u001b[39m match\u001b[38;5;241m.\u001b[39mgroup()\n\u001b[0;32m     29\u001b[0m     json_object \u001b[38;5;241m=\u001b[39m json\u001b[38;5;241m.\u001b[39mloads(json_str, strict\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m)\n\u001b[1;32m---> 30\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mpydantic_object\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mparse_obj\u001b[49m\u001b[43m(\u001b[49m\u001b[43mjson_object\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m     32\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m (json\u001b[38;5;241m.\u001b[39mJSONDecodeError, ValidationError) \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[0;32m     33\u001b[0m     name \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mpydantic_object\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__name__\u001b[39m\n\nFile \u001b[1;32mc:\\Users\\user\\repos\\.venv\\Lib\\site-packages\\typing_extensions.py:2499\u001b[0m, in \u001b[0;36mdeprecated.__call__.<locals>.wrapper\u001b[1;34m(*args, **kwargs)\u001b[0m\n\u001b[0;32m   2496\u001b[0m \u001b[38;5;129m@functools\u001b[39m\u001b[38;5;241m.\u001b[39mwraps(arg)\n\u001b[0;32m   2497\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mwrapper\u001b[39m(\u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs):\n\u001b[0;32m   2498\u001b[0m     warnings\u001b[38;5;241m.\u001b[39mwarn(msg, category\u001b[38;5;241m=\u001b[39mcategory, stacklevel\u001b[38;5;241m=\u001b[39mstacklevel \u001b[38;5;241m+\u001b[39m \u001b[38;5;241m1\u001b[39m)\n\u001b[1;32m-> 2499\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43marg\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\nFile \u001b[1;32mc:\\Users\\user\\repos\\.venv\\Lib\\site-packages\\pydantic\\main.py:1027\u001b[0m, in \u001b[0;36mBaseModel.parse_obj\u001b[1;34m(cls, obj)\u001b[0m\n\u001b[0;32m   1021\u001b[0m \u001b[38;5;129m@classmethod\u001b[39m\n\u001b[0;32m   1022\u001b[0m \u001b[38;5;129m@typing_extensions\u001b[39m\u001b[38;5;241m.\u001b[39mdeprecated(\n\u001b[0;32m   1023\u001b[0m     \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mThe `parse_obj` method is deprecated; use `model_validate` instead.\u001b[39m\u001b[38;5;124m'\u001b[39m, category\u001b[38;5;241m=\u001b[39mPydanticDeprecatedSince20\n\u001b[0;32m   1024\u001b[0m )\n\u001b[0;32m   1025\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mparse_obj\u001b[39m(\u001b[38;5;28mcls\u001b[39m: \u001b[38;5;28mtype\u001b[39m[Model], obj: Any) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m Model:  \u001b[38;5;66;03m# noqa: D102\u001b[39;00m\n\u001b[0;32m   1026\u001b[0m     warnings\u001b[38;5;241m.\u001b[39mwarn(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mThe `parse_obj` method is deprecated; use `model_validate` instead.\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;167;01mDeprecationWarning\u001b[39;00m)\n\u001b[1;32m-> 1027\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mcls\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmodel_validate\u001b[49m\u001b[43m(\u001b[49m\u001b[43mobj\u001b[49m\u001b[43m)\u001b[49m\n\nFile \u001b[1;32mc:\\Users\\user\\repos\\.venv\\Lib\\site-packages\\pydantic\\main.py:503\u001b[0m, in \u001b[0;36mBaseModel.model_validate\u001b[1;34m(cls, obj, strict, from_attributes, context)\u001b[0m\n\u001b[0;32m    501\u001b[0m \u001b[38;5;66;03m# `__tracebackhide__` tells pytest and some other tools to omit this function from tracebacks\u001b[39;00m\n\u001b[0;32m    502\u001b[0m __tracebackhide__ \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mTrue\u001b[39;00m\n\u001b[1;32m--> 503\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mcls\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m__pydantic_validator__\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mvalidate_python\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m    504\u001b[0m \u001b[43m    \u001b[49m\u001b[43mobj\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstrict\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mstrict\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mfrom_attributes\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mfrom_attributes\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcontext\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcontext\u001b[49m\n\u001b[0;32m    505\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\n\u001b[1;31mValidationError\u001b[0m: 2 validation errors for People\npeople.1.dog_breed\n  Field required [type=missing, input_value={'person_name': 'Claudia'...hair_color': 'brunette'}, input_type=dict]\n    For further information visit https://errors.pydantic.dev/2.5/v/missing\npeople.1.dog_name\n  Field required [type=missing, input_value={'person_name': 'Claudia'...hair_color': 'brunette'}, input_type=dict]\n    For further information visit https://errors.pydantic.dev/2.5/v/missing"
}
```

### System Info

Langchain:
```
langchain==0.1.0
langchain-community==0.0.10
langchain-core==0.1.8
```

platform: 
```
Windows 11 Enterprise Version	10.0.22621 Build 22621
```

python : 
```
Python 3.11.7
```

### Related Components

- [ ] LLMs/Chat Models
- [ ] Embedding Models
- [ ] Prompts / Prompt Templates / Prompt Selectors
- [X] Output Parsers
- [ ] Document Loaders
- [ ] Vector Stores / Retrievers
- [ ] Memory
- [ ] Agents / Agent Executors
- [ ] Tools / Toolkits
- [ ] Chains
- [ ] Callbacks/Tracing
- [ ] Async