NOTE: the latest version is 3.0.0
Given a prompt, the model will return one or more predicted completions, and can also return the probabilities of alternative tokens at each position.
See https://beta.openai.com/docs/api-reference/completions
https://beta.openai.com/docs/api-reference/completions/create
create { model = OpenAI.ModelID.TextDavinci003 , prompt = "If I were a farmer's son" , suffix = Nothing , max_tokens = Nothing , temperature = Nothing , top_p = Nothing , n = Nothing , stream = Nothing , logprobs = Nothing , echo = Nothing , stop = Nothing , presence_penalty = Nothing , frequency_penalty = Nothing , best_of = Nothing , logit_bias = Nothing , user = Nothing } |> OpenAI.withConfig cfg |> Http.task --> Task.succeed --> { choices = --> [ { finish_reason = "length" --> , index = 0 --> , logprobs = Nothing --> , text = "\n\nIf I were a farmer's son --> , I would rise early each morning" --> } --> ] --> , created = Posix ... --> , id = "cmpl-..." --> , model = TextDavinci003 --> , object = "text_completion" --> , usage = --> { completion_tokens = 16 --> , prompt_tokens = 7 --> , total_tokens = 23 --> } --> }
https://beta.openai.com/docs/api-reference/completions/create