Git Product home page Git Product logo

lemur's Introduction

lemur

Lifecycle: experimental R-CMD-check

lemur is an R package that provides a wrapper for the OpenAI GPT API. It is a repackaging of code I originally developed for the GPTscreenR package. I created this package for my personal use and it is not planned to ever be released to CRAN.

Installation

You can install the development version of lemur from GitHub with:

# install.packages("devtools")
devtools::install_github("wilkox/lemur")

OpenAI API key

Using lemur requires an OpenAI API key, which you must store in an R environmental variable called OPENAI_API_KEY. OpenAI charges fees to use their API. To obtain and set up an API key:

  1. Create an OpenAI account, if you don’t have one already.
  2. Once you have created and signed in to your account, go to the View API Keys page.
  3. Click on the ‘Create new secret key’ button.
  4. Give your new key a name, for example ‘lemur’, and click ‘Create secret key’.
  5. The page will display your new secret API key. You must copy the key now, as it will never be displayed again.
  6. Store your API key in an R environmental variable by adding the following line to your .Renviron file: OPENAI_API_KEY=<your secret API key goes here>. There are a few different ways to edit this file:
    1. On any operating system, you can use the function usethis::edit_r_environ() from the usethis package to open and edit your .Renviron file.
    2. On macOS or Linux, you can create or edit a file in your home directory called ~/.Renviron.
    3. You can also make an .Renviron file for a particular project. I strongly recommend that you do not check this file into a version control system like git, as this means other people with access to the repository (including the public, if the repository is publicly accessible) can see your secret key.

To check that you have set the environmental variable successfully, open a new R session and load lemur with library(lemur). You should see the following message:

✔ The `OPENAI_API_KEY` environmental variable is set

If instead you see:

✖ The `OPENAI_API_KEY` environmental variable is not set

this means the environmental variable has not been set correctly. Note that this does not check whether or not you have stored a valid key.

lemur's People

Contributors

wilkox avatar

Watchers

 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.