Refactor build method in instantiate_custom_component function
This commit is contained in:
parent
7e42b52d8c
commit
71bb633da9
1 changed files with 3 additions and 3 deletions
|
|
@ -132,12 +132,12 @@ async def instantiate_custom_component(node_type, class_object, params, user_id)
|
|||
|
||||
if is_async:
|
||||
# Await the build method directly if it's async
|
||||
built_object = await custom_component.build(**params_copy)
|
||||
build_result = await custom_component.build(**params_copy)
|
||||
else:
|
||||
# Call the build method directly if it's sync
|
||||
built_object = custom_component.build(**params_copy)
|
||||
build_result = custom_component.build(**params_copy)
|
||||
|
||||
return built_object, {"repr": custom_component.custom_repr()}
|
||||
return build_result, {"repr": custom_component.custom_repr()}
|
||||
|
||||
|
||||
def instantiate_wrapper(node_type, class_object, params):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue