textbook_quality icon indicating copy to clipboard operation
textbook_quality copied to clipboard

Change Prerequisites - Python 3.9+ to Python 3.10+

Open omkar-334 opened this issue 1 year ago • 0 comments

The match-case statement was introduced to Python in v3.10.
When I run the code in Python 3.9.13, It gives me this -
File "C:\Users\omkar\Desktop\textbook_quality\app\llm\llm.py", line 74
match model:
^
SyntaxError: invalid syntax

I encountered another syntax error -
created: datetime | None = Field(
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType' The reason for this is -
datetime | None syntax is only supported in 3.10 or later.
A solution for this could be -
from typing import Optional
name: Optional[datetime] = None

omkar-334 avatar Apr 05 '24 08:04 omkar-334