From 7d3614407b7f7d716edbd18b1152e470b3126152 Mon Sep 17 00:00:00 2001 From: Matt Bernstein Date: Thu, 31 Oct 2024 16:34:16 -0400 Subject: [PATCH 1/2] fix: DIA-1489: backwards compatible autorefinement with non-multiskill --- adala/skills/collection/prompt_improvement.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/adala/skills/collection/prompt_improvement.py b/adala/skills/collection/prompt_improvement.py index ce8c555c..c256c980 100644 --- a/adala/skills/collection/prompt_improvement.py +++ b/adala/skills/collection/prompt_improvement.py @@ -70,6 +70,9 @@ def get_json_template(fields): else: model_json_schema = self.skill_to_improve.response_model.model_json_schema() + # TODO: can remove this when only LabelStudioSkill is supported + label_config = self.skill_to_improve.getattr('label_config', 'Not available') + input_variables = self.input_variables output_variables = list(model_json_schema['properties'].keys()) input_json_template = get_json_template(input_variables) @@ -84,7 +87,7 @@ def get_json_template(fields): ## Current Labeling Config: ```xml -{self.skill_to_improve.label_config} +{label_config} ``` ## Input variables: From 2da04719a3f798c286b5531addae6bc0625c45f1 Mon Sep 17 00:00:00 2001 From: Matt Bernstein Date: Thu, 31 Oct 2024 16:44:38 -0400 Subject: [PATCH 2/2] bugfix --- adala/skills/collection/prompt_improvement.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adala/skills/collection/prompt_improvement.py b/adala/skills/collection/prompt_improvement.py index c256c980..30c86fdf 100644 --- a/adala/skills/collection/prompt_improvement.py +++ b/adala/skills/collection/prompt_improvement.py @@ -71,7 +71,7 @@ def get_json_template(fields): model_json_schema = self.skill_to_improve.response_model.model_json_schema() # TODO: can remove this when only LabelStudioSkill is supported - label_config = self.skill_to_improve.getattr('label_config', 'Not available') + label_config = getattr(self.skill_to_improve, 'label_config', 'Not available') input_variables = self.input_variables output_variables = list(model_json_schema['properties'].keys())