This package is NOT intended to be run on the browser since apiKey will be exposed. Call it from a server like elm-webapp or lamdera.com instead.
OpenAI.Edits.createEdits input
|> OpenAI.withConfig cfg
|> Http.taskhttps://platform.openai.com/docs/api-reference/making-requests
Add necessary headers to authorize a http request to OpenAI. This is a necessary step before calling Http.task.
create
{ model = OpenAI.ModelID.TextEmbeddingAda002
, input = "The food was delicious and the waiter..."
, user = Nothing
}
|> OpenAI.withConfig cfg
|> Http.task
https://platform.openai.com/docs/api-reference/authentication
In your index.js, pass these values as flags to your Elm app
In your server Main.elm, the values will be passed in as a
OpenAI.Configrecord