get_active_conversation_attachments {PacketLLM}R Documentation

Gets the list of attachments for the active conversation

Description

Retrieves the list of attachments (files provided as context) associated with the currently active conversation.

Usage

get_active_conversation_attachments()

Value

List. A list where each element is a list containing name (character) and content (character) for an attachment associated with the currently active conversation. Returns an empty list (list()) if no conversation is active or if the active conversation has no attachments.

Examples

# Setup
reset_history_manager()
conv_getactiveattach_id <- create_new_conversation(activate = TRUE)

# Get attachments when none added
print("Attachments initially:")
print(get_active_conversation_attachments()) # list()

# Add some attachments
add_attachment_to_active_conversation("data.csv", "col1,col2\n1,2")
add_attachment_to_active_conversation("notes.txt", "Reminder")

# Get attachments again
print("Attachments after adding:")
attachments_list <- get_active_conversation_attachments()
print(attachments_list)
print(paste("Number of attachments:", length(attachments_list))) # 2

# Deactivate and check (should be empty list)
set_active_conversation(NULL)
print("Attachments when none active:")
print(get_active_conversation_attachments()) # list()

# Clean up
reset_history_manager()

[Package PacketLLM version 0.1.0 Index]