Returns the assistant content from a single Message, from a flat list of Message objects
(e.g. the output of llmapply with extract_responses = FALSE), or from a list of lists of
Message objects (e.g. the output of map() on an Agent with extract_responses = FALSE).
Arguments
- x
Messageobject, list ofMessageobjects, or list of lists ofMessageobjects.NULLelements are allowed: llmapply and agentapply leave one in the slot of every call that failed underon_error = "na".
Value
Character vector of assistant responses. Returns NA_character_ in slots where no
assistant message is present (including failed calls), so that the length of the result
matches the length of x. An agent history returned by generate yields
only the final assistant response. Attached validation reports are preserved.