ChatRequest
@Serializable
A fully-formed request wrapping a Chat with optional generation parameters and tools.
Create instances via io.kory.core.dsl.chat.request.koryChatRequest or Chat.asChatRequest.
Parameters
choicesCount
Number of response choices to generate.
topP
Nucleus sampling parameter (0.0–1.0). null uses provider default.
See also
Samples
// For create a chat request using koryChatRequest dsl function.
val chatRequest = koryChatRequest {
temperature = 0.7
maxTokens = 4096
topK = 40
reasoning = ReasoningConfig.Enabled(ReasoningConfig.Level.LOW)
// The “chat” function refers to the chat that will be used in the request.
chat(
model = "gpt-5.6-sol",
) {
// Body for messages.
user("Ping!")
}
}Content copied to clipboard
// Create chat using default Chat constructor or koryChat dsl function.
val chat = koryChat(
model = "gpt-5.6-sol"
) {
user("Ping!")
}
val chatRequest = ChatRequest(
chat = chat,
temperature = 0.7,
maxTokens = 4096,
topK = 40,
reasoning = ReasoningConfig.Enabled(ReasoningConfig.Level.LOW),
tools = emptyList()
)Content copied to clipboard