get_conversation_attachments {PacketLLM} | R Documentation |
Gets the list of attachments for the conversation with the given ID
Description
Retrieves the list of attachments (files provided as context) associated with a specific conversation ID.
Usage
get_conversation_attachments(id)
Arguments
id |
Character string. The ID of the conversation. |
Value
List or NULL
. A list where each element is itself a list containing
name
(character) and content
(character) for an attachment
associated with the conversation specified by id
. Returns NULL
if
the conversation does not exist. Returns an empty list (list()
) if
the conversation exists but has no attachments.
Examples
# Setup
reset_history_manager()
conv_attach_id <- create_new_conversation(activate = TRUE)
# Get attachments for new conversation (empty list)
print("Initial attachments by ID:")
print(get_conversation_attachments(conv_attach_id)) # list()
# Add an attachment using the exported function
add_attachment_to_active_conversation("file1.txt", "File content here")
# Get attachments again
print("Attachments after adding:")
print(get_conversation_attachments(conv_attach_id))
# Get attachments for non-existent ID
print("Attachments for non-existent:")
print(get_conversation_attachments("bad_id")) # NULL
# Clean up
reset_history_manager()
[Package PacketLLM version 0.1.0 Index]