---
title: "GenerationHandle"
sidebar_label: "GenerationHandle"
description: "Kotlin binding reference: GenerationHandle."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

//[clika-runtime](../../../index.md)/[io.clika.modelverse](../index.md)/[GenerationHandle](index.md)

# GenerationHandle

[common]\
interface [GenerationHandle](index.md)

A running generation. [cancel](cancel.md) may be called from any thread: the decode stops at its next step, the listener receives the text streamed so far, and [GenerationListener.onDone](../GenerationListener/onDone.md) arrives with [FinishReason.CANCELED](../FinishReason/CANCELED/index.md). Calling it after the generation ended is a no-op.

## Properties

| Name | Summary |
|---|---|
| [isDone](isDone.md) | [common]<br>abstract val [isDone](isDone.md): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)<br>True once the listener's terminal call has been made. |

## Functions

| Name | Summary |
|---|---|
| [cancel](cancel.md) | [common]<br>abstract fun [cancel](cancel.md)() |