I have a beamer frame as shown below. It draws two nodes of tikzpeople and then an arrow between them. However, what I want to draw is a rectangle in the middle of the arrow and write some text inside the rectangle. So something like "NODE --[some text]--> NODE". How can I draw a closed rectangle and fill it with text?
\documentclass[xcolor=table,10pt,aspectratio=169]{beamer}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[american]{babel}
\usepackage{amsmath,amssymb,amsthm}
\usepackage[beamer,customcolors]{hf-tikz}
\usepackage{booktabs} % Tables
\usepackage{tikz}
\usetikzlibrary{
arrows,
calc,
chains,
decorations,
decorations.text,
decorations.pathmorphing,
matrix,
overlay-beamer-styles,
positioning,
shapes,
tikzmark
}
\usepackage{tikzpeople}
\tikzset{hl/.style={
set fill color=red!80!black!40,
set border color=red!80!black,
},
}
\begin{document}
\begin{frame}{Test}
\begin{figure}
\begin{tikzpicture}[font=\small]
\node[alice,minimum size=1.5cm] (A) {};
\node[bob,right=8cm of A,minimum size=1.5cm,mirrored] (B) {};
\draw (A.0) edge[->] node[above] {} (B.180);
\end{tikzpicture}
\end{figure}
\end{frame}
\end{document}
tikzpeople
to compile so have commented it out -- used two simple nodes A and B with arrow in between -- positions can be specified asmidway, near end, near start
with white fill behind the text