File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 1313import copy
1414import inspect
1515import json
16+ import sys
1617import uuid
1718import warnings
1819
@@ -1091,9 +1092,17 @@ def __init__(
10911092 super ().__init__ (model_key , params , on_load_progress )
10921093
10931094
1094- class ToolParamDefDict (TypedDict , Generic [T ]):
1095- type : type [T ]
1096- default : NotRequired [T ]
1095+ if sys .version_info < (3 , 11 ):
1096+ # Generic typed dictionaries aren't supported in Python 3.10
1097+ # https://github.com/python/cpython/issues/89026
1098+ class ToolParamDefDict (TypedDict ):
1099+ type : type [Any ]
1100+ default : NotRequired [Any ]
1101+ else :
1102+
1103+ class ToolParamDefDict (TypedDict , Generic [T ]):
1104+ type : type [T ]
1105+ default : NotRequired [T ]
10971106
10981107
10991108class ToolFunctionDefDict (TypedDict ):
You can’t perform that action at this time.
0 commit comments