SpringAiModel

constructor(name: String, chatModel: ChatModel, coroutineContext: CoroutineContext = Dispatchers.IO)

Parameters

chatModel

The Spring AI chat model to wrap. Streaming requires the model to support it; a model whose provider does not override streaming surfaces Spring AI's own UnsupportedOperationException.

coroutineContext

The coroutine context the blocking Spring AI call runs on; defaults to Dispatchers.IO and is injectable so tests can supply a deterministic dispatcher.