1- from typing import (TypedDict , Literal , TypeVar , Union , NotRequired , Generic )
1+ from typing import TypedDict , Literal , TypeVar , Union , Generic , Optional
2+
3+ try :
4+ from typing import NotRequired
5+ except ImportError :
6+ NotRequired = TypeVar ("NotRequired" , bound = Optional )
27
38
49class ParamSchema (TypedDict ):
@@ -10,6 +15,7 @@ class ParamSchema(TypedDict):
1015 enum (Optional[list[str]]): The list of allowed values for the parameter (optional).
1116 default (Optional[str]): The default value for the parameter (optional).
1217 """
18+
1319 type : str
1420 description : str
1521 enum : NotRequired [list [str ]]
@@ -23,11 +29,12 @@ class RootProperty(TypedDict):
2329 type (str): Root property can only be "object".
2430 properties (dict[str, ParamSchema]): The properties of the object.
2531 """
32+
2633 type : Literal ["object" ]
2734 properties : dict [str , ParamSchema ]
2835
2936
30- T = TypeVar ('T' , bound = Union [' WithParameters' , ' WithInputSchema' ])
37+ T = TypeVar ("T" , bound = Union [" WithParameters" , " WithInputSchema" ])
3138
3239
3340class WithParameters (TypedDict ):
@@ -52,6 +59,7 @@ class FunctionSchema(FunctionSchemaBase, Generic[T]):
5259 parameters (RootProperty): The schema for the function parameters.
5360 input_schema (ParamSchema): The schema for the function parameters if format is "claude".
5461 """
62+
5563 pass
5664
5765
0 commit comments