GenerationConfigKt


public final class GenerationConfigKt


摘要

公共方法

static final @NonNull GenerationConfig

用于以 DSL 方式构建 GenerationConfig 的辅助方法。

公共方法

generationConfig

public static final @NonNull GenerationConfig generationConfig(
    @ExtensionFunctionType @NonNull Function1<@NonNull GenerationConfig.BuilderUnit> init
)

用于以 DSL 方式构建 GenerationConfig 的辅助方法。

用法示例:

generationConfig {
context = context // required
workerExecutor = workerThread // Set the [ExecutorService] on which background tasks should be run. If no value is specified, a background thread pool will be used.
callbackExecutor = callbackExecutor // Set the [Executor] on which callbacks should be invoked. If no value is specified, callbacks will be invoked on the UI thread.
temperature = 0.75f
topK = 30
candidateCount = 4
maxOutputTokens = 300
stopSequences = listOf("in conclusion", "-----", "do you need")
}