FIMCompletion Params
Parameters for configuring Fill-in-the-Middle (FIM) completion requests to DeepSeek models.
FIM allows the model to complete text where you provide both a prefix and a suffix, making it useful for code completion, text infilling, and template-based generation.
Example:
val params = fimCompletionParams {
temperature = 0.7
maxTokens = 200
suffix = "}" // The code should end with a closing bracket
}
val completion = client.fim(params, "function calculateArea(radius) {")
println(completion.choices.first().text)Types
Builder for creating FIMCompletionParams with standard (non-streaming) configuration.
Builder for creating FIMCompletionParams specifically configured for streaming responses.
Properties
Sent as frequency_penalty, ignored by the API.
The DeepSeek model to use. The reference documents only ChatModel.DEEPSEEK_V4_PRO, which is the default, but the endpoint also serves ChatModel.DEEPSEEK_FLASH
Sent as presence_penalty, ignored by the API.
Custom stop sequences that cause the model to stop generating further tokens.
Configuration options for streaming responses
Controls randomness in output generation (higher = more random). Expected range: 0.0..2.0.
Functions
Shortcut to chatCompletionParams, available on any existing DeepSeekParams.
Shortcut to chatCompletionStreamParams, available on any existing DeepSeekParams.
Creates a copy of these parameters with optional changes to specific properties.
Creates a FIMCompletionRequest from these parameters and the provided prompt.
Shortcut to fimCompletionParams, available on any existing DeepSeekParams.
Shortcut to fimCompletionStreamParams, available on any existing DeepSeekParams.