#pragma once #include #include namespace molo::ai { // SSE parser for OpenAI-compatible chat streams. Shared with the 06-realtime // SSE client contract: text/event-stream, data lines, blank-line framing, // end on "data: [DONE]". This file owns the CLI copy; the realtime part // reuses the same framing rules, never a duplicate parser. class SseStreamParser { public: void feed(const std::string& chunk); std::vector take_events(); bool done() const { return done_; } void reset(); private: std::string buffer_; std::vector events_; bool done_ = false; }; } // namespace molo::ai