-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Thanks for making tooldantic!
The current version of the package does not work for python 3.8 because of an import from typing import Annotated. See below for some examples.
One potential solution (chatgpt suggested) is
from typing_extensions import AnnotatedExample code
from tooldantic import ToolBaseModel as BaseModel---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
Cell In[4], line 2
1 # drop in replacement for pydantic.BaseModel
----> 2 from tooldantic import ToolBaseModel as BaseModel
5 class InnerModel(BaseModel):
6 """nested inner model"""
File ~/anaconda3/envs/cpath/lib/python3.8/site-packages/tooldantic/__init__.py:3
1 from pydantic import Field, ValidationError
----> 3 from .builder import ModelBuilder
4 from .decorators import AsyncToolWrapper, ToolWrapper, ToolWrapperBase
5 from .dispatch import ToolDispatch
File ~/anaconda3/envs/cpath/lib/python3.8/site-packages/tooldantic/builder.py:4
2 import inspect
3 import logging
----> 4 from typing import (
5 Annotated,
6 Any,
7 Callable,
8 Dict,
9 List,
10 Literal,
11 Optional,
12 Tuple,
13 Type,
14 Union,
15 get_args,
16 get_origin,
17 )
19 import docstring_parser
20 import pydantic
ImportError: cannot import name 'Annotated' from 'typing' (/Users/iain/anaconda3/envs/cpath/lib/python3.8/typing.py)or for a more simple demonstration
from typing import AnnotatedImportError Traceback (most recent call last)
Cell In[5], line 1
----> 1 from typing import Annotated
ImportError: cannot import name 'Annotated' from 'typing' (/Users/iain/anaconda3/envs/cpath/lib/python3.8/typing.py)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels