View Source ExOpenAI.StreamingClient behaviour (ex_openai.ex v1.5.1)

Summary

Functions

Returns a specification to start this module under a supervisor.

Forwards the given response back to the receiver If receiver is a PID, will use GenServer.cast to send If receiver is a function, will call the function directly

Callback implementation for GenServer.init/1.

Callbacks

@callback handle_data(any(), any()) :: {:noreply, any()}
@callback handle_error(any(), any()) :: {:noreply, any()}
@callback handle_finish(any()) :: {:noreply, any()}

Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

forward_response(pid, data)

View Source

Forwards the given response back to the receiver If receiver is a PID, will use GenServer.cast to send If receiver is a function, will call the function directly

Link to this function

handle_chunk(chunk, map)

View Source

Callback implementation for GenServer.init/1.

Link to this function

start_link(stream_to_pid, convert_response_fx)

View Source