@@ -104,23 +104,24 @@ def __select_prompts(self, prompts: list[Prompt]):
104104 result = []
105105 req : EthicalRequirement
106106 for req in self .ethical_requirements :
107- concern = req .concern
108- input_types = [input_type for input_type in req .inputs ]
109- reflection_types = [reflection_type for reflection_type in req .reflections ]
110- for input_type in input_types :
111- for reflection_type in reflection_types :
112- # filter prompts by concern, prompt type and assessment type
113- temp = [prompt for prompt in prompts if
107+ for language in req .languages :
108+ concern = req .concern
109+ input_types = [input_type for input_type in req .inputs ]
110+ reflection_types = [reflection_type for reflection_type in req .reflections ]
111+ for input_type in input_types :
112+ for reflection_type in reflection_types :
113+ # filter prompts by concern, prompt type and assessment type
114+ temp = [prompt for prompt in prompts if
114115 prompt .concern == concern and prompt .input_type == input_type and prompt .reflection_type == reflection_type and
115- prompt .language in req . languages ]
116- # and then select according to num tests specified
117- result = result + self .__sample_list (temp )
118- # 1. assign delta as per requirement
119- # 2. set whether the req forces sentiment analysis to re-check failed tests
120- prompt : Prompt
121- for prompt in result :
122- prompt .set_oracle_delta (req .delta )
123- prompt .set_oracle_reinforce_failed_evaluation (self .use_llm_eval )
116+ prompt .language == language ]
117+ # and then select according to num tests specified
118+ result = result + self .__sample_list (temp )
119+ # 1. assign delta as per requirement
120+ # 2. set whether the req forces sentiment analysis to re-check failed tests
121+ prompt : Prompt
122+ for prompt in result :
123+ prompt .set_oracle_delta (req .delta )
124+ prompt .set_oracle_reinforce_failed_evaluation (self .use_llm_eval )
124125 self .__prompts = result
125126
126127 def __sample_list (self , prompt_list : list [Prompt ]):
0 commit comments