Visitar URL original
fix(types): avoid type-checker errors on params with additional prope… · unlayer/unlayer-python@d03691f · GitHub
Skip to content

Commit d03691f

Browse files
fix(types): avoid type-checker errors on params with additional properties
1 parent ad5130b commit d03691f

3 files changed

Lines changed: 40 additions & 8 deletions

File tree

‎src/unlayer/types/templates/convert_full_to_simple_create_params.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ class ConvertFullToSimpleCreateParams(TypedDict, total=False):
2525
include_default_values: Annotated[bool, PropertyInfo(alias="includeDefaultValues")]
2626

2727

28-
class Design(TypedDict, total=False, extra_items=object): # type: ignore[call-arg]
28+
class Design( # type: ignore[call-arg]
29+
TypedDict,
30+
total=False,
31+
extra_items=object, # pyright: ignore[reportGeneralTypeIssues]
32+
):
2933
body: Required[Dict[str, object]]
3034

3135
counters: Dict[str, object]

‎src/unlayer/types/templates/convert_simple_to_full_create_params.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ class Design_Conversion(TypedDict, total=False):
2424
version: float
2525

2626

27-
class Design(TypedDict, total=False, extra_items=object): # type: ignore[call-arg]
27+
class Design( # type: ignore[call-arg]
28+
TypedDict,
29+
total=False,
30+
extra_items=object, # pyright: ignore[reportGeneralTypeIssues]
31+
):
2832
body: Required[Dict[str, object]]
2933

3034
_conversion: Design_Conversion

‎src/unlayer/types/templates/generate_create_params.py‎

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@ class GenerateCreateParams(TypedDict, total=False):
6161
"""
6262

6363

64-
class MessageContentFile(TypedDict, total=False, extra_items=object): # type: ignore[call-arg]
64+
class MessageContentFile( # type: ignore[call-arg]
65+
TypedDict,
66+
total=False,
67+
extra_items=object, # pyright: ignore[reportGeneralTypeIssues]
68+
):
6569
url: Required[str]
6670

6771
media_type: Annotated[str, PropertyInfo(alias="mediaType")]
@@ -78,11 +82,19 @@ class MessageContent(TypedDict, total=False):
7882
text: str
7983

8084

81-
class MessageMetadataAction(TypedDict, total=False, extra_items=object): # type: ignore[call-arg]
85+
class MessageMetadataAction( # type: ignore[call-arg]
86+
TypedDict,
87+
total=False,
88+
extra_items=object, # pyright: ignore[reportGeneralTypeIssues]
89+
):
8290
id: Required[str]
8391

8492

85-
class MessageMetadata(TypedDict, total=False, extra_items=object): # type: ignore[call-arg]
93+
class MessageMetadata( # type: ignore[call-arg]
94+
TypedDict,
95+
total=False,
96+
extra_items=object, # pyright: ignore[reportGeneralTypeIssues]
97+
):
8698
action: MessageMetadataAction
8799

88100

@@ -102,21 +114,33 @@ class Output(TypedDict, total=False):
102114
schema_version: Annotated[int, PropertyInfo(alias="schemaVersion")]
103115

104116

105-
class ContextCustomTool(TypedDict, total=False, extra_items=object): # type: ignore[call-arg]
117+
class ContextCustomTool( # type: ignore[call-arg]
118+
TypedDict,
119+
total=False,
120+
extra_items=object, # pyright: ignore[reportGeneralTypeIssues]
121+
):
106122
options: Required[Dict[str, object]]
107123

108124
slug: Required[str]
109125

110126

111-
class ContextSelection(TypedDict, total=False, extra_items=object): # type: ignore[call-arg]
127+
class ContextSelection( # type: ignore[call-arg]
128+
TypedDict,
129+
total=False,
130+
extra_items=object, # pyright: ignore[reportGeneralTypeIssues]
131+
):
112132
id: Required[Union[str, float]]
113133

114134
collection: Required[Literal["pages", "bodies", "rows", "columns", "contents", "headers", "footers"]]
115135

116136
value: str
117137

118138

119-
class Context(TypedDict, total=False, extra_items=object): # type: ignore[call-arg]
139+
class Context( # type: ignore[call-arg]
140+
TypedDict,
141+
total=False,
142+
extra_items=object, # pyright: ignore[reportGeneralTypeIssues]
143+
):
120144
available_tools: Annotated[SequenceNotStr[str], PropertyInfo(alias="availableTools")]
121145

122146
custom_tools: Annotated[Iterable[ContextCustomTool], PropertyInfo(alias="customTools")]

0 commit comments

Comments
 (0)