This Elixir library provides a simple wrapper around OpenAI's Completions API. The Completions API allows you to generate one or more predicted completions for a given prompt. You can also receive the probabilities of alternative tokens at each position.
This function creates a completion for the provided prompt and options.
Noizu.OpenAI.Api.Completion.completion(prompt, options)
prompt
: The prompt to generate completions for.options
: A keyword list or map with optional parameters.
Here's an example of how to use the completion/2
function:
prompt = "Say this is a test"
options = [
max_tokens: 7,
temperature: 0
]
response = Noizu.OpenAI.Api.Completion.completion(prompt, options)