Reads the role of the last message in a program.
Program to inspect.
The role, or null when the program has no messages.
null
if (getLastMessageRole(request) === "tool") return ctx.invoke(upstream, request); Copy
if (getLastMessageRole(request) === "tool") return ctx.invoke(upstream, request);
Reads the role of the last message in a program.