chatSuspending

suspend fun ChatModel.chatSuspending(message: String): String

Sends a single user message to this ChatModel and returns the model's text reply.

LangChain4j calls block on network I/O, so the call runs on Dispatchers.IO and the caller's thread (for example a UI thread) is never blocked.


suspend fun ChatModel.chatSuspending(messages: List<ChatMessage>): ChatResponse

Sends a conversation to this ChatModel and returns the full ChatResponse (AI message, tool execution requests, token usage). Like the single-message overload, it runs on Dispatchers.IO.