Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Externalize OPENAPI_API_KEY #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# credentials
OPENAI_API_KEY.js
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ The current few-shot prompt guides GPT-3 in accurately understanding the JSON fo
## Setup

1. Run `npm install` to download required dependencies (currently just [react-graph-vis](https://github.com/crubier/react-graph-vis)).
2. Enter your OPENAI_API_KEY in `src/App.js`.
3. Run `npm run start`. GraphGPT should open up in a new browser tab.
2. CREATE `src/OPENAI_API_KEY.js` using template in `src/OPENAI_API_KEY.template.js`.
3. Run `npm run start`. GraphGPT should open up in a new browser tab.
2 changes: 1 addition & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import './App.css';
import Graph from "react-graph-vis";
import React, { useState } from "react";

const OPENAI_API_KEY = "YOUR OPENAI API KEY";
import OPENAI_API_KEY from "./OPENAI_API_KEY.js";

const DEFAULT_PARAMS = {
"model": "text-davinci-003",
Expand Down
3 changes: 3 additions & 0 deletions src/OPENAI_API_KEY.template.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const OPENAI_API_KEY =
"<GET KEY FROM https://platform.openai.com/account/api-keys>";
export default OPENAI_API_KEY;