View module source on GitHub This module contains utility functions for parsing attachments from messages.

parse_attachments_from_messages

def parse_attachments_from_messages(
    messages: list["GenerationRequestMessage"]
) -> Tuple[list["GenerationRequestMessage"], list["Attachment"]]
Parses the attachment from the result. Arguments:
NameTypeDescription
messagesList[GenerationRequestMessage]The messages to parse attachments from.
Returns:
NameDescription
tupleA tuple containing the modified messages and the list of attachments.