completion property
Resolves when deltas ends, carrying the token usage, the model that actually served the turn, and the stop reason — which is the only way to tell a refusal from a normal end.
Completes with an error if the stream failed; the same error also reaches whoever is listening to deltas. Consuming deltas is what drives this: abandon the stream part-way and this resolves with whatever arrived before the cancellation, never listen at all and it never resolves, because the request is never sent.
Implementation
final Future<AiCompletion> completion;