fails

fun fails(message: String, partialText: String = "")

The call to the model fails with a ChatModelException that has message, as when the provider is overloaded. Use it to test a retry, or what the app does with a failed run.

Parameters

partialText

what a streamed run receives before the failure, as when a connection breaks in the middle of an answer.


fun fails(failure: Throwable, partialText: String = "")

The call to the model throws failure. See the overload with a message.