from typing import Optional
from langchain_core.pydantic_v1 import BaseModel, Field
class Person(BaseModel):
# ^ Doc-string for the entity Person.
# This doc-string is sent to the LLM as the description of the schema Person,
# and it can help to improve extraction results.
# 1. Each field is an `optional` -- this allows the model to decline to extract it!
# 2. Each field has a `description` -- this description is used by the LLM.
# Having a good description can help improve extraction results.
name: Optional[str] = Field(..., description="个人姓名")
hair_color: Optional[str] = Field(
..., description="如果已知,该人头发的颜色。"
height_in_meters: Optional[str] = Field(
..., description="身高,以米为单位测量。"