Parses the assistant's reply as JSON and returns the corresponding structured data. If the reply is not marked as JSON, attempts to extract and parse JSON content from the text.
get_reply_data(.llm, .index = NULL)last_reply_data(.llm)
Returns the parsed data from the assistant's reply, or NULL
if parsing fails.
An LLMMessage
object containing the message history.
A positive integer indicating the index of the assistant reply to retrieve.
Defaults to NULL
, which retrieves the last reply.
For convenience, last_reply_data()
is provided as a wrapper to retrieve the
latest assistant reply's data.
get_reply()
, last_reply_data()