@@ -16,7 +16,8 @@ def extract_block_param(param: Parameter, type_system: TypeSystem) -> BlockConfi
1616 param_type = param .annotation
1717 label = param .name
1818 description = None
19-
19+ has_options = False
20+ options_provider = None
2021 if get_origin (param_type ) is Annotated :
2122 args = get_args (param_type )
2223 if len (args ) > 0 :
@@ -26,6 +27,8 @@ def extract_block_param(param: Parameter, type_system: TypeSystem) -> BlockConfi
2627 if isinstance (metadata , ParamMeta ):
2728 label = metadata .label
2829 description = metadata .description
30+ has_options = metadata .options_provider is not None
31+ options_provider = metadata .options_provider
2932
3033 # 递归调用 extract_block_param 处理实际类型
3134 block_config = extract_block_param (
@@ -54,6 +57,9 @@ def extract_block_param(param: Parameter, type_system: TypeSystem) -> BlockConfi
5457 required = required ,
5558 default = default ,
5659 label = label ,
60+ has_options = has_options ,
61+ options = [],
62+ options_provider = options_provider ,
5763 )
5864
5965
@@ -145,7 +151,7 @@ def extract_block_info(
145151 for name , input_info in getattr (block_type , "inputs" , {}).items ():
146152 type_name = self ._type_system .get_type_name (input_info .data_type )
147153 self ._type_system .register_type (type_name , input_info .data_type )
148-
154+
149155 inputs [name ] = BlockInput (
150156 name = name ,
151157 label = input_info .label ,
@@ -158,7 +164,7 @@ def extract_block_info(
158164 for name , output_info in getattr (block_type , "outputs" , {}).items ():
159165 type_name = self ._type_system .get_type_name (output_info .data_type )
160166 self ._type_system .register_type (type_name , output_info .data_type )
161-
167+
162168 outputs [name ] = BlockOutput (
163169 name = name ,
164170 label = output_info .label ,
0 commit comments