Learn R Programming

gooseR (version 0.1.0)

StreamHandler: Stream Handler R6 Class

Description

Manages streaming responses from Goose

Arguments

Public fields

process

The processx process object

buffer

Accumulated response buffer

callback

Chunk callback function

error_callback

Error callback function

complete_callback

Completion callback function Initialize stream handler

Methods


Method new()

Usage

StreamHandler$new(callback, error_callback, complete_callback)

Arguments

callback

Function to call with chunks

error_callback

Function for errors

complete_callback

Function for completion Start streaming process


Method start()

Usage

StreamHandler$start(query, session_id = NULL)

Arguments

query

The query to execute

session_id

Optional session ID Monitor streaming process Get accumulated buffer


Method monitor()

Usage

StreamHandler$monitor()


Method get_response()

Usage

StreamHandler$get_response()

Returns

Complete response text Stop streaming


Method stop()

Usage

StreamHandler$stop()


Method clone()

The objects of this class are cloneable with this method.

Usage

StreamHandler$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.