complete method
Returns the channel's stream directly, rather than re-yielding it from
a generator: a wrapping async* would swallow cancellation exactly when
the completion is still in flight, which is the only time cancelling is
worth anything. No stall bound is applied here; the provider applies the
one bound every transport gets (boundedAiRun).
Implementation
@override
Stream<AgentSdkCompletionEvent> complete(AgentSdkCompletionRequest request) {
final channel = _channel;
if (channel == null) {
return Stream.error(
LlmTransportException(
LlmErrorKind.unreachable,
'The hosted AI transport is not connected.',
transportId: id,
),
);
}
return channel.complete(request);
}