Skip to contents

Saves the full response from a Cassidy chat to a file without any processing. Use cassidy_write_code() to separate code from explanations.

Usage

cassidy_write_file(x, path, open = interactive(), append = FALSE)

Arguments

x

A cassidy_chat or cassidy_response object.

path

Character. File path where to save the response.

open

Logical. Whether to open the file after writing (default: TRUE in interactive sessions).

append

Logical. Whether to append to existing file (default: FALSE).

Value

Invisibly returns the file path.

Examples

if (FALSE) { # \dontrun{
result <- cassidy_chat("Write documentation for this function", context = ctx)

# Save full response (no separation)
cassidy_write_file(result, "notes/function-docs.md")
} # }