runStreaming method

Stream<VanturaResponse> runStreaming(
  1. String prompt, {
  2. CancellationToken? cancellationToken,
})

Streams the overall system execution.

Implementation

Stream<VanturaResponse> runStreaming(
  String prompt, {
  CancellationToken? cancellationToken,
}) async* {
  final stream = activeAgent.runStreaming(
    prompt,
    cancellationToken: cancellationToken,
  );

  await for (final response in stream) {
    yield response;
  }

  // Process any transfer requested during streaming
  if (_pendingTransfer != null) {
    activeAgent = agents[_pendingTransfer]!;
    _pendingTransfer = null;
  }
}