Skip to content

Commit d5e5e45

Browse files
dcydcy
authored andcommitted
Fix IndexError in pipeline registry when allowed_prompts is empty
1 parent c22f977 commit d5e5e45

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

backend/app/services/pipeline_registry.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,8 @@ def _enrich_pipeline_operators_internal(self, pipeline_data: Dict[str, Any]) ->
801801
p_val = param_def.get("default_value")
802802
if p_val is None and param_def.get("name") == "prompt_template":
803803
# Get @prompt_restrict decorator from operator class
804-
p_val = op_details["allowed_prompts"][0]
804+
if op_details.get("allowed_prompts"):
805+
p_val = op_details["allowed_prompts"][0]
805806
# Create enriched param object
806807
enriched_param = param_def.copy()
807808
enriched_param["value"] = p_val

0 commit comments

Comments
 (0)