Skip to content

ThatcherC/OpenAI.jl

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenAI API wrapper for Julia

Overview

Provides a Julia wrapper to the OpenAI API. For API functionality see reference documentation.

Usage

using Pkg; Pkg.add("OpenAI")

Quick Start

  1. Create an OpenAI account, if you don't already have one

  2. Create a secrete API key

  3. 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.

Feature requests

Feel free to open a PR, or file an issue if that's out of reach!

About

OpenAI API wrapper for Julia

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Julia 100.0%