File tree 1 file changed +4
-4
lines changed
python/packages/autogen-core/src/autogen_core
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -304,18 +304,18 @@ def normalize_annotated_type(type_hint: Type[Any]) -> Type[Any]:
304
304
305
305
def args_base_model_from_signature (name : str , sig : inspect .Signature ) -> Type [BaseModel ]:
306
306
fields : Dict [str , tuple [Type [Any ], Any ]] = {}
307
- for name , param in sig .parameters .items ():
307
+ for param_name , param in sig .parameters .items ():
308
308
# This is handled externally
309
- if name == "cancellation_token" :
309
+ if param_name == "cancellation_token" :
310
310
continue
311
311
312
312
if param .annotation is inspect .Parameter .empty :
313
313
raise ValueError ("No annotation" )
314
314
315
315
type = normalize_annotated_type (param .annotation )
316
- description = type2description (name , param .annotation )
316
+ description = type2description (param_name , param .annotation )
317
317
default_value = param .default if param .default is not inspect .Parameter .empty else PydanticUndefined
318
318
319
- fields [name ] = (type , Field (default = default_value , description = description ))
319
+ fields [param_name ] = (type , Field (default = default_value , description = description ))
320
320
321
321
return cast (BaseModel , create_model (name , ** fields )) # type: ignore
You can’t perform that action at this time.
0 commit comments