gpt_live_stream
Live, multi-message delivery for Codex-backed Stargazer replies.
- class gpt_live_stream.LiveReplyWriter(platform, channel_id, *, stream_id, require_durable, flush_interval=1.0, chunk_length=1800, answer_transform=None, manifest_store=None, manifest_ttl_seconds=7776000)
Bases:
objectCoalesce provider deltas into editable, uncapped platform messages.
Provider callbacks only mutate in-memory buffers and wake a background flusher. They never wait for Discord or Gateway I/O, so a slow edit cannot stall the Codex event stream. Every lane may grow into as many messages as required; final reconciliation replaces the answer lane in place.
- Parameters:
- start()
- Return type:
- callback(event)
Accept one decoded Codex event without performing network I/O.
- begin_attempt()
Start a provider revision while keeping the old answer until replacement begins.
- Return type:
- async reconcile_final(final_text)
Replace the live answer with the exact postprocessed final response.
- async discard_answer()
Remove live answer slots when the final reply must use another renderer.
- Return type: