OpenAI.Completions (openai_client v0.5.3)

Given a prompt, the model will return one or more predicted completions, and can also return the probabilities of alternative tokens at each position.

https://platform.openai.com/docs/api-reference/completions

Link to this section Summary

Functions

Creates a completion for the provided prompt and parameters

Link to this section Types

Link to this type

create_params()

@type create_params() :: %{
  :model => String.t(),
  optional(:prompt) => String.t() | [String.t()],
  optional(:suffix) => String.t(),
  optional(:max_tokens) => integer(),
  optional(:temperature) => float(),
  optional(:top_p) => float(),
  optional(:n) => integer(),
  optional(:stream) => boolean(),
  optional(:logprobs) => integer(),
  optional(:echo) => boolean(),
  optional(:stop) => String.t() | [String.t()],
  optional(:presence_penalty) => float(),
  optional(:frequency_penalty) => float(),
  optional(:best_of) => integer(),
  optional(:logit_bias) => %{required(String.t()) => float()},
  optional(:user) => String.t()
}

Link to this section Functions

Link to this function

create(client, params, opts \\ [])

Creates a completion for the provided prompt and parameters