Expand description
Stream-json line encode / decode.
Re-exportsยง
use serde_json::Value;๐use serde_json::json;๐use crate::Error;๐use crate::control::ControlRequest;๐use forge_primitives::Message;๐
Enumsยง
- Decoded
Line - A single stream-json line from the subprocess - either a regular message or a control request.
Functionsยง
- decode_
dispatch - Decode one stream-json line, dispatching on the
typefield. - decode_
line - Parse one stream-json line into a
Message. - encode_
user_ prompt - Encode a user prompt as one line of stream-json input.
- encode_
user_ prompt_ with_ content - Encode a user-turn line with structured content blocks (text +
image) as the message body. Use this when the prompt includes
images or other non-text blocks; for plain text use
encode_user_promptwhich emits the simpler bare-string form.