'Frosty',      'dog_breed': 'labrador'},     {'person_name': 'Claudia',      'person_height': 6,      'person_hair_color': 'brunette'}]Unrelated entities‚ÄãIf we use required: [], we allow the model to return only person attributes or only dog attributes for a single entity (person or dog).schema = {    "properties": {        "person_name": {"type": "string"},        "person_height": {"type": "integer"},        "person_hair_color": {"type": "string"},        "dog_name": {"type": "string"},        "dog_breed": {"type": "string"},    },    "required": [],}chain = create_extraction_chain(schema, llm)inp = """Alex is 5 feet tall. Claudia is 1 feet taller Alex and jumps higher than him. Claudia is a brunette and Alex is blonde.Willow is a German Shepherd that likes to play with other dogs and can always be found playing with Milo, a border collie that lives close by."""chain.run(inp)    [{'person_name': 'Alex', 'person_height': 5, 'person_hair_color': 'blonde'},     {'person_name': 'Claudia',      'person_height': 6,      'person_hair_color': 'brunette'},     {'dog_name': 'Willow', 'dog_breed': 'German Shepherd'},     {'dog_name': 'Milo', 'dog_breed': 'border collie'}]Extra information‚ÄãThe power of functions (relative to using parsers alone) lies in the ability to perform semantic extraction.In particular, we can ask for things that are not explicitly enumerated in the schema.Suppose we want unspecified additional information about dogs. We can use add a placeholder for unstructured extraction, dog_extra_info.schema = {    "properties": {        "person_name": {"type": "string"},        "person_height": {"type": "integer"},        "person_hair_color": {"type": "string"},        "dog_name": {"type": "string"},        "dog_breed": {"type": "string"},        "dog_extra_info": {"type": "string"},    },}chain = create_extraction_chain(schema, llm)chain.run(inp)    [{'person_name': 'Alex', 'person_height': 5, 'person_hair_color': 'blonde'},     {'person_name': 'Claudia',
Open In Collab
Open In Collab ->: 'Frosty',      'dog_breed': 'labrador'},     {'person_name': 'Claudia',      'person_height': 6,      'person_hair_color': 'brunette'}]Unrelated entities‚ÄãIf we use required: [], we allow the model to return only person attributes or only dog attributes for a single entity (person or dog).schema = {    "properties": {        "person_name": {"type": "string"},        "person_height": {"type": "integer"},        "person_hair_color": {"type": "string"},        "dog_name": {"type": "string"},        "dog_breed": {"type": "string"},    },    "required": [],}chain = create_extraction_chain(schema, llm)inp = """Alex is 5 feet tall. Claudia is 1 feet taller Alex and jumps higher than him. Claudia is a brunette and Alex is blonde.Willow is a German Shepherd that likes to play with other dogs and can always be found playing with Milo, a border collie that lives close by."""chain.run(inp)    [{'person_name': 'Alex', 'person_height': 5, 'person_hair_color': 'blonde'},     {'person_name': 'Claudia',      'person_height': 6,      'person_hair_color': 'brunette'},     {'dog_name': 'Willow', 'dog_breed': 'German Shepherd'},     {'dog_name': 'Milo', 'dog_breed': 'border collie'}]Extra information‚ÄãThe power of functions (relative to using parsers alone) lies in the ability to perform semantic extraction.In particular, we can ask for things that are not explicitly enumerated in the schema.Suppose we want unspecified additional information about dogs. We can use add a placeholder for unstructured extraction, dog_extra_info.schema = {    "properties": {        "person_name": {"type": "string"},        "person_height": {"type": "integer"},        "person_hair_color": {"type": "string"},        "dog_name": {"type": "string"},        "dog_breed": {"type": "string"},        "dog_extra_info": {"type": "string"},    },}chain = create_extraction_chain(schema, llm)chain.run(inp)    [{'person_name': 'Alex', 'person_height': 5, 'person_hair_color': 'blonde'},     {'person_name': 'Claudia',