Skip to contents

Gets the full message history from an existing CassidyAI thread, including both user messages and assistant responses. This is an API function that queries Cassidy's servers, not your local conversation storage.

Usage

cassidy_get_thread(thread_id, api_key = Sys.getenv("CASSIDY_API_KEY"))

Arguments

thread_id

Character. The Cassidy API thread ID (not a local conversation ID). This looks like a UUID from Cassidy's system. If you have a conversation ID from cassidy_list_conversations(), use cassidy_get_thread_id() to get the corresponding thread_id first.

api_key

Character. Your CassidyAI API key. Defaults to the CASSIDY_API_KEY environment variable.

Value

A cassidy_thread S3 object with:

thread_id

The thread identifier

messages

List of messages, each with role, content, and timestamp

assistant_id

The assistant this thread belongs to

created_at

When the thread was created

message_count

Number of messages in the thread

Details

Understanding Thread IDs vs Conversation IDs

To convert between them, use cassidy_get_thread_id().

See also

Other api-functions: cassidy_create_thread(), cassidy_list_threads(), cassidy_send_message()

Examples

if (FALSE) { # \dontrun{
  # From a locally saved conversation
  convs <- cassidy_list_conversations()
  thread_id <- convs$thread_id[1]  # Get the thread_id column
  thread <- cassidy_get_thread(thread_id)
  print(thread)

  # Or use the helper function
  thread_id <- cassidy_get_thread_id("conv_20260131_1234")
  thread <- cassidy_get_thread(thread_id)

  # Access messages
  thread$messages
} # }