Learn R Programming

openaiRtools (version 0.2.2)

handle_stream_response: Handle streaming response from OpenAI API

Description

Handle streaming response from OpenAI API

Usage

handle_stream_response(req, callback = NULL)

Value

If callback is provided, returns invisible(NULL). Otherwise returns an R6 iterator object.

Arguments

req

httr2 request object

callback

Function to call for each chunk (optional)