last_reply | R Documentation |
This function extracts the last reply made by the assistant from a given LLMMessage object. It is particularly useful for fetching the most recent response from the assistant to display or log it separately.
last_reply(.llm = NULL, .json = FALSE)
.llm |
An LLMMessage object containing the history of messages exchanged. This must be a valid LLMMessage object; otherwise, the function will stop with an error. |
.json |
Should structured json data from the last reply be returned as R list (default: FALSE) |
Returns the content of the last reply made by the assistant. If the assistant
has not replied yet, or if there are no assistant messages in the history, NULL
is returned.
This function only returns the content of the last assistant message and does not include media or other types of content that might be attached to the message.
LLMMessage
for details on the message object structure.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.