harness_gateway_client/wire/delta.rs
1//! The live pieces of a streamed reply, as the read loop hands them out.
2
3/// One piece of a streamed model reply, delivered as it arrives.
4///
5/// The client passes each piece to the caller's callback as soon as it
6/// decodes the piece from the stream. Answer text and reasoning arrive as
7/// separate variants, so a caller can show them differently.
8///
9/// The client buffers tool-call fragments until the whole batch of tool
10/// calls is complete and validated. They appear only in the finished
11/// completion.
12#[derive(Debug, Clone, PartialEq, Eq)]
13#[non_exhaustive]
14pub enum StreamDelta {
15 /// A fragment of the assistant's answer text.
16 Text(String),
17 /// A fragment of the model's reasoning text. It stays separate from the
18 /// answer.
19 Reasoning(String),
20}