Calls client.streamComplete with retries only when failure occurs before any chunk is emitted. Binary-compatible overload that delegates to the full version with Thread.sleep.
Calls client.streamComplete with retries only when failure occurs before any chunk is emitted. Binary-compatible overload that delegates to the full version with Thread.sleep.
Calls client.streamComplete with retries only when failure occurs before any chunk is emitted. Once streaming has started (at least one chunk delivered), any error is returned immediately without retry.
Calls client.streamComplete with retries only when failure occurs before any chunk is emitted. Once streaming has started (at least one chunk delivered), any error is returned immediately without retry.
Value parameters
baseDelay
base delay for backoff when provider retry-delay hints are absent (default: 1 second); must be positive
client
LLM client
conversation
conversation to complete
maxAttempts
maximum attempts including the first (default: 3); must be positive
onChunk
callback for each streamed chunk
options
completion options (default: CompletionOptions())
sleepFn
function used to pause between retries (default: Thread.sleep); override for testing
Attributes
Returns
Right(Completion) on success, Left(error) when retries exhausted, non-recoverable error, invalid input, or interrupted