{# Assignement in if clause breaks test, we need to declare variables in global scope first: https://github.com/pallets/jinja/issues/1314 #} {% set selected_question = "" %} {% set selected_answer = "" %} {% set random_question_id = -1 %} {% if annotations.type[0] == "multipleQAs" %} {% set random_question_id = range(0, annotations.qaPairs[0].question | length) | choice%} {% set selected_question = annotations.qaPairs[0].question[random_question_id]%} {% set selected_answer = annotations.qaPairs[0].answer[random_question_id] | choice%} {% else %} {% set selected_question = question %} {% set selected_answer = annotations.answer[0] | choice %} {% endif %} Question: {{question}} Answer: {{selected_answer}} Knowing that the question can be ambiguous, can you perform question disambiguation by generating a question such that "{{selected_answer}}" is a more suitable answer? If you deem that the question is not ambiguous, generate the same question given above.
Pensando...
