Skip to contents

ChatCompletionStream R6 class

ChatCompletionStream R6 class

Super classes

openaiapi::Utils -> openaiapi::ChatCompletion -> ChatCompletionStream

Methods

Inherited methods


Method new()

Initialize a ChatCompletionStream object.

Usage

ChatCompletionStream$new(stream_reader)

Arguments

stream_reader

A StreamReader object.


Method stream_async()

Get the chat completion object.

Usage

ChatCompletionStream$stream_async(callback)

Arguments

callback

A function that is called on each event, taking the updated choices field as an argument.


Method do_tool_calls()

Get the chat completion object.

Usage

ChatCompletionStream$do_tool_calls(env = parent.env())

Arguments

env

The environment to use for tool calls.


Method clone()

The objects of this class are cloneable with this method.

Usage

ChatCompletionStream$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.