chat

abstract suspend fun chat(request: ChatRequest): ChatResponse

Sends a chat request to the LLM provider and returns a non-streaming response.

Return

A io.kory.core.chat.response.ChatResponse with one or more io.kory.core.chat.choice.ChatChoice objects.

Parameters

request

A fully configured io.kory.core.chat.request.ChatRequest containing the chat, model parameters, and optional tools.

Throws

if the request fails (provider-specific).


abstract suspend fun chat(model: String, blocks: ChatBuilder.() -> Unit): ChatResponse

Sends a chat using DSL-style message construction.

Return

A ChatResponse with the model's reply.

Parameters

model

The model identifier (e.g. "gpt-5.6-sol", "qwen3.5:4b").

blocks

A io.kory.core.dsl.chat.ChatBuilder lambda for adding system, user, and assistant messages.


abstract suspend fun chat(block: ChatRequestBuilder.() -> Unit): ChatResponse

Sends a chat using full DSL configuration.

Return

A ChatResponse with the model's reply.

Parameters

block

A io.kory.core.dsl.chat.request.ChatRequestBuilder lambda for configuring the chat, temperature, max tokens, reasoning, and tools.