from agent_framework.guardrails.calibrated.prompts._context import format_context_block


def test_format_context_block_suporta_history_em_dict_do_contas():
    context = {
        "conversation_history": [
            {"role": "assistant", "content": "O TIM Music custa R$ 12,90."},
            {"role": "user", "content": "Quero cancelar o TIM Music"},
        ]
    }
    block = format_context_block(context)
    assert "[assistant] O TIM Music custa R$ 12,90." in block
    assert "[user] Quero cancelar o TIM Music" in block
