Skip to contents

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).

Usage

responses(x)

Arguments

x

Message object, list of Message objects, or list of lists of Message objects.

Value

Character vector of assistant responses. Returns NA_character_ in slots where no assistant message is present, so that the length of the result matches the length of x.

Author

EDG

Examples