psychic-api / doctran

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error w/ Py version < 3.10

rlancemartin opened this issue · comments

Related to this PR, running notebook (Python 3.9.16) I see import error, which appears to be an error in Py < 3.10:

│ ❱ 8 from doctran import Doctran │
│ 9 │
│ 10 │
│ 11 class DocumentInterrogator(BaseDocumentTransformer, BaseModel): │
│ │
│ /Users/rlm/anaconda3/envs/lcn2/lib/python3.9/site-packages/doctran/init.py:1 in │
│ │
│ ❱ 1 from .doctran import Doctran, Document, DoctranConfig, ContentType, ExtractProperty, Rec │
│ 2 │
│ │
│ /Users/rlm/anaconda3/envs/lcn2/lib/python3.9/site-packages/doctran/doctran.py:14 in │
│ │
│ 11 from typing import List, Optional, Dict, Any, Literal │
│ 12 from pydantic import BaseModel │
│ 13 │
│ ❱ 14 class ExtractProperty(BaseModel): │
│ 15 │ name: str │
│ 16 │ description: str │
│ 17 │ type: Literal["string", "number", "boolean", "array", "object"] │
│ │
│ /Users/rlm/anaconda3/envs/lcn2/lib/python3.9/site-packages/doctran/doctran.py:18 in │
│ ExtractProperty │
│ │
│ 15 │ name: str │
│ 16 │ description: str │
│ 17 │ type: Literal["string", "number", "boolean", "array", "object"] │
│ ❱ 18 │ items: Optional[List | Dict[str, Any]] │
│ 19 │ enum: Optional[List[str]] │
│ 20 │ required: bool = True │
│ 21