psychic-api / doctran

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing [] around `properties` in README

codeananda opened this issue · comments

This code block from the README didn't work for me

from doctran import ExtractProperty

properties = ExtractProperty(
    name="millenial_or_boomer", 
    description="A prediction of whether this document was written by a millenial or boomer",
    type="string",
    enum=["millenial", "boomer"],
    required=True
)
document = await document.extract(properties=properties).execute()

Had to do

document = await document.extract(properties=[properties]).execute()

instead