@@ -177,7 +177,7 @@ def get_type(cls) -> str:
177
177
return cls .model_fields ["type" ].default
178
178
179
179
@classmethod
180
- def get_output_annotation (cls ) -> BaseInvocationOutput :
180
+ def get_output_annotation (cls ) -> Type [ BaseInvocationOutput ] :
181
181
"""Gets the invocation's output annotation (i.e. the return annotation of its `invoke()` method)."""
182
182
return signature (cls .invoke ).return_annotation
183
183
@@ -209,7 +209,7 @@ def invoke_internal(self, context: InvocationContext, services: "InvocationServi
209
209
Internal invoke method, calls `invoke()` after some prep.
210
210
Handles optional fields that are required to call `invoke()` and invocation cache.
211
211
"""
212
- for field_name , field in self .model_fields .items ():
212
+ for field_name , field in type ( self ) .model_fields .items ():
213
213
if not field .json_schema_extra or callable (field .json_schema_extra ):
214
214
# something has gone terribly awry, we should always have this and it should be a dict
215
215
continue
@@ -224,9 +224,9 @@ def invoke_internal(self, context: InvocationContext, services: "InvocationServi
224
224
setattr (self , field_name , orig_default )
225
225
if orig_required and orig_default is PydanticUndefined and getattr (self , field_name ) is None :
226
226
if input_ == Input .Connection :
227
- raise RequiredConnectionException (self .model_fields ["type" ].default , field_name )
227
+ raise RequiredConnectionException (type ( self ) .model_fields ["type" ].default , field_name )
228
228
elif input_ == Input .Any :
229
- raise MissingInputException (self .model_fields ["type" ].default , field_name )
229
+ raise MissingInputException (type ( self ) .model_fields ["type" ].default , field_name )
230
230
231
231
# skip node cache codepath if it's disabled
232
232
if services .configuration .node_cache_size == 0 :
0 commit comments