object

open_ai_event_stream

Small Server-Sent Events helpers used by OpenAI streaming endpoints.

Availability:
logtalk_load(open_ai(loader))
Author: Paulo Moura
Version: 1:0:0
Date: 2026-07-09
Compilation flags:
static, context_switching_calls
Dependencies:
(none)
Remarks:
(none)
Inherited public predicates:
(none)

Public predicates

event/2

Parses a single OpenAI event-stream frame atom into event(Name, Data). Unknown fields are ignored.

Compilation flags:
static
Template:
event(Frame,Event)
Mode and number of proofs:
event(+atom,-compound) - one_or_error
Exceptions:
Frame is not an event-stream frame atom:
domain_error(open_ai_event_stream_frame,Frame)

frame/2

Generates an event-stream frame atom from event(Name, Data).

Compilation flags:
static
Template:
frame(Event,Frame)
Mode and number of proofs:
frame(+compound,-atom) - one_or_error
Exceptions:
Event is not an event-stream event term:
domain_error(open_ai_event_stream_event,Event)

Protected predicates

(none)

Private predicates

(none)

Operators

(none)