FIMCompletionRequest

@Serializable
class FIMCompletionRequest(val model: ChatModel, val prompt: String, val echo: Boolean? = null, val frequencyPenalty: Double? = null, val logprobs: Int? = null, val maxTokens: Int? = null, val presencePenalty: Double? = null, val stop: StopReason? = null, val stream: Boolean? = null, val streamOptions: StreamOptions? = null, val suffix: String? = null, val temperature: Double? = null, val topP: Double? = null)

Represents the FIM (Fill-In-the-Middle) Completion request

Constructors

Link copied to clipboard
constructor(model: ChatModel, prompt: String, echo: Boolean? = null, frequencyPenalty: Double? = null, logprobs: Int? = null, maxTokens: Int? = null, presencePenalty: Double? = null, stop: StopReason? = null, stream: Boolean? = null, streamOptions: StreamOptions? = null, suffix: String? = null, temperature: Double? = null, topP: Double? = null)

Types

Link copied to clipboard
class Builder
Link copied to clipboard
Link copied to clipboard

Properties

Link copied to clipboard
val echo: Boolean? = null

Echo back the prompt in addition to the completion

Link copied to clipboard

Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.

Link copied to clipboard
val logprobs: Int? = null

Include the log probabilities on the logprobs most likely output tokens, as well the chosen tokens. For example, if logprobs is 20, the API will return a list of the 20 most likely tokens. The API will always return the logprob of the sampled token, so there may be up to logprobs+1 elements in the response.

Link copied to clipboard
val maxTokens: Int? = null

The maximum number of tokens that can be generated in the completion.

Link copied to clipboard

ID of the model to use.

Link copied to clipboard
val presencePenalty: Double? = null

Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.

Link copied to clipboard

The prompt to generate completions for.

Link copied to clipboard
val stop: StopReason? = null

Up to 16 sequences where the API will stop generating further tokens.

Link copied to clipboard
val stream: Boolean? = null

Whether to stream back partial progress. If set, tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: DONE message.

Link copied to clipboard

Options for streaming response. Only set this when you set stream: true.

Link copied to clipboard
val suffix: String? = null

The suffix that comes after a completion of inserted text.

Link copied to clipboard
val temperature: Double? = null

What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.

Link copied to clipboard
val topP: Double? = null

An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String