from chatlas import ChatOpenAIfrom pydantic import BaseModel, Fieldimport pandas as pd# | warning: falsetext ="John works at Google in New York. He met with Sarah, the CEO of Acme Inc., last week in San Francisco."class NamedEntity(BaseModel):"""Named entity in the text.""" name: str= Field(description="The extracted entity name") type_: str= Field(description="The entity type, e.g. 'person', 'location', 'organization'") context: str= Field(description="The context in which the entity appears in the text.")class NamedEntities(BaseModel):"""Named entities in the text.""" entities: list[NamedEntity] = Field(description="Array of named entities")chat = ChatOpenAI()data = chat.extract_data(text, data_model=NamedEntities)pd.DataFrame(data["entities"])