There is no direct prompt escape sequence like %n for displaying the current_role in the psql prompt. However, you can work around this by using a \set command to define a custom prompt that includes the result of current_role.
Please do not use chatgpt or other LLMs to answer questions on this mailing list! If you had even done the bare minimum of trying your own lazily-generated answer, you would have found it did not work.