Git Product home page Git Product logo

openai.jl's Introduction

OpenAI API wrapper for Julia (Unofficial)

Overview

Provides a community maintained Julia wrapper to the OpenAI API. For API functionality see reference documentation. Autogenerated documentation can be found here: https://juliaml.github.io/OpenAI.jl/dev/

Usage

using Pkg; Pkg.add("OpenAI")

Quick Start

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

  2. Create a secret API key

  3. Choose a model to interact with

โš ๏ธ We strongly suggest setting up your API key as an ENV variable.

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!

openai.jl's People

Contributors

roryl23 avatar algunion avatar logankilpatrick avatar jotas6 avatar nstiurca avatar thatcherc avatar gnadt avatar alex-s-gardner avatar carlolucibello avatar svilupp avatar moelf avatar chengchingwen avatar rexwzh avatar stefanjwojcik avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.