Extracts the plain text content of the assistant's reply from an LLMMessage object.
Use get_reply_data() for structured replies in JSON format.
get_reply(.llm, .index = NULL)last_reply(.llm)
A character string with the assistant's reply, or NA_character_ if no reply
exists. For a list of replies, a character vector with one element per reply.
An LLMMessage object containing the message history, or a list
of them.
A positive integer indicating the index of the assistant reply to retrieve.
Defaults to NULL, which retrieves the last reply.
This function is the core utility for retrieving assistant replies by index.
For convenience, last_reply() is provided as a wrapper to retrieve the
latest assistant reply.
Given a list of replies, as returned by parallel_chat() or fetch_batch(),
it returns one string per element, in the same order. A request that failed
gives NA. An .index that is out of range for one element stops the call.
get_reply_data(), last_reply()