complete

open suspend override fun complete(messages: List<AiMessage>, config: AiConfig = AiConfig()): AiResult<String>(source)

No separate HTTP call of its own — collects completeStream under AiConfig.timeoutMs and joins its tokens. One call site for the wire contract instead of a second copy of the request/ response handling that completeStream already has right.

Unlike AnthropicProvider/OpenAiProvider/GeminiProvider's complete(), there's no catch (_: Exception) below the timeout catch — completeStream never lets an ordinary exception escape its channelFlow (it turns those into AiChunk.Failed instead), so a plain CancellationException here has nothing broader to fall into and already propagates uncaught; a catch (e: CancellationException) { throw e } would be a no-op rethrow.