Skip to content

CompletionParameters

MarcoDotIO edited this page Dec 5, 2022 · 1 revision

CompletionParameters

Parameter struct used for creating GPT3 completions.

public struct CompletionParameters 

Initializers

init(model:prompt:suffix:maxTokens:temperature:topP:numberOfCompletions:stream:logprobs:maxLogprobs:echo:stop:presencePenalty:frequencyPenalty:bestOf:logitBias:user:)

public init(
        model: String,
        prompt: [String] = ["<|endoftext|>"],
        suffix: String? = nil,
        maxTokens: Int = 16,
        temperature: Double = 1.0,
        topP: Double = 1.0,
        @Clamped(range: 1...10) numberOfCompletions: Int = 1,
        stream: Bool = false,
        logprobs: Int? = nil,
        maxLogprobs: Int = 5,
        echo: Bool = false,
        stop: [String]? = nil,
        @Clamped(range: -2.0...2.0) presencePenalty: Double = 0.0,
        @Clamped(range: -2.0...2.0) frequencyPenalty: Double = 0.0,
        bestOf: Int = 1,
        logitBias: [String: Int]? = nil,
        user: String? = nil
    ) 

Properties

body

The body of the URL used for OpenAI API requests.

public var body: [String: Any] 
Types
Global Functions
Clone this wiki locally