Package-level declarations

Types

Link copied to clipboard
@Serializable
data class Choice(val text: String, val index: Int, val logprobs: Logprobs? = null, val finishReason: FinishReason? = null)

A completion generated by GPT-3.

Link copied to clipboard
@Serializable
class CompletionRequest(val model: ModelId, val prompt: String? = null, val maxTokens: Int? = null, val temperature: Double? = null, val topP: Double? = null, val n: Int? = null, val logprobs: Int? = null, val echo: Boolean? = null, val stop: List<String>? = null, val presencePenalty: Double? = null, val frequencyPenalty: Double? = null, val bestOf: Int? = null, val logitBias: Map<String, Int>? = null, val user: String? = null, val suffix: String? = null)

A request for OpenAI to generate a predicted completion for a prompt. All fields are Optional.

Link copied to clipboard

Builder of CompletionRequest instances.

Link copied to clipboard
@Serializable
data class Logprobs(val tokens: List<String>, val tokenLogprobs: List<Double>, val topLogprobs: List<Map<String, Double>>, val textOffset: List<Int>)

Log probabilities of different token options? Returned if CompletionRequest.logprobs is greater than zero.

Link copied to clipboard
@Serializable
data class TextCompletion(val id: String, val created: Long, val model: ModelId, val choices: List<Choice>, val usage: Usage? = null)

An object containing a response from the completion api.

Functions

Link copied to clipboard

A request for OpenAI to generate a predicted completion for a prompt. All fields are Optional.