Learn R Programming

gooseR (version 0.1.0)

goose_stream: Stream Response from Goose

Description

Execute a query with streaming response handling

Usage

goose_stream(
  query,
  callback = NULL,
  error_callback = NULL,
  complete_callback = NULL,
  session_id = NULL
)

Value

Invisible NULL (results handled via callbacks)

Arguments

query

The query to send to Goose

callback

Function to call with each chunk (default: cat)

error_callback

Function to call on error

complete_callback

Function to call on completion

session_id

Optional session ID for context

Examples

Run this code
if (FALSE) {
# Simple streaming with default output
goose_stream("Explain R functions")

# Custom callback for processing chunks
goose_stream("Write a function", callback = function(chunk) {
  message("Received: ", nchar(chunk), " characters")
  cat(chunk)
})
}

Run the code above in your browser using DataLab