Provides a Julia wrapper to the OpenAI API. For API functionality see reference documentation.
using Pkg; Pkg.add("OpenAI")-
Create an OpenAI account, if you don't already have one
-
Create a secrete API key
-
Choose a model to interact with
secret_key = "PAST_YOUR_SECRETE_KEY_HERE"
model = "gpt-3.5-turbo"
prompt = "Say \"this is a test\""
r = create_chat(
secret_key,
model,
[Dict("role" => "user", "content"=> prompt)]
)
println(r.response[:choices][begin][:message][:content])returns
"This is a test."For more use cases see tests.
Feel free to open a PR, or file an issue if that's out of reach!