% !Mode:: "TeX:UTF-8"
% !TEX encoding = UTF-8 Unicode

\begin{center}
  \begin{tikzpicture}[background rectangle/.style={fill=black!5!white,rounded corners=5pt,minimum width=\textwidth}, show background rectangle]
    \begin{scope}
      \matrix (m) [matrix anchor=west,
      matrix of nodes,      
      nodes={anchor=north west,}
      ] at (-\textwidth/2,0) {
        \color{gray}{Input} &
        \begin{varwidth}{18em}\small{Give me three tips to improve my accuracy in solving math problems. Return in JSON format with ``tip1'', ``tip2'', ``tip3'' as the key and the corresponding tip as the value.  (\textbf{Expect a JSON output})}
        \end{varwidth} \\
        \color{gray}{Output 1} &
        \begin{varwidth}{18em}
          \small{ \{\\
            \hspace*{.4cm}"tip1": " Delve into the labyrinth of equations with the focus of a hawk hunting ...", \\
            \hspace*{.4cm}"tip2": " Engage in the art of problem-solving like a master alchemist turning ...", \\
            \hspace*{.4cm}"tip3": "Practice, practice, practice, until the numbers themselves bow in reverence ..." \\
            \} (\textbf{Valid: True})}
        \end{varwidth} \\
        \color{gray}{Output 2} &
        \begin{varwidth}{18em}
          \small{tip1: " Delve into the labyrinth of equations with the focus of a hawk hunting ...", \\
            tip2: " Engage in the art of problem-solving like a master alchemist turning ...", \\
            tip3: "Practice, practice, practice, until the numbers themselves bow in reverence ..."\\
            (\textbf{Valid: False})}
        \end{varwidth} \\
      };

      \path let \p1=($(m-2-2.north east)-(m-3-2.south east)$) in node [minimum height=\y1,minimum width=2cm,draw,anchor=north west,rounded corners=2pt,align=center] (counter) at ([xshift=1cm]m-2-2.north east) {Format\\Checker};

      \node at ([xshift=4.5cm]m-1-2.east) {Reward};
      \node (res1) at ([xshift=4.5cm]m-2-2.east) {\textbf{+1}};
      \node (res2) at ([xshift=4.5cm]m-3-2.east) {\textbf{+0}};

      \draw [->] (m-2-2.east) -- ([xshift=-.1cm]counter.west |- m-2-2.east);
      \draw [->] (m-3-2.east) -- ([xshift=-.1cm]counter.west |- m-3-2.east);
      \draw [->] ([xshift=.1cm]counter.east|-m-2-2.east) -- (res1.west);
      \draw [->] ([xshift=.1cm]counter.east|-m-3-2.east) -- (res2.west);
    \end{scope}
  \end{tikzpicture}
\end{center}
