Skip to content

Commit

Permalink
Load up the environement in the command.
Browse files Browse the repository at this point in the history
Part of #1.
  • Loading branch information
jkomoros committed Jun 17, 2023
1 parent 76e8f83 commit b2c1c26
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
*.SECRET.*

src/**/*.js
src/**/*.d.ts
src/**/*.map
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# prompt-garden
A framework for gardening LLM prompts

### Using

Copy `environment.SAMPLE.json` to `environment.SECRET.json` and update the `openai_api_key` to be your key.

Run the command with `npm run main`

### Developing

Run `npm run serve`
3 changes: 3 additions & 0 deletions environment.SAMPLE.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"openai_api_key": "CHANGE_ME"
}
8 changes: 7 additions & 1 deletion tools/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@ import {
Garden
} from '../src/garden.js';

import * as fs from 'fs';

const ENVIRONMENT_PATH = 'environment.SECRET.json';

const main = () => {
const garden = new Garden({});
const data = fs.readFileSync(ENVIRONMENT_PATH).toString();
const env = JSON.parse(data);
const garden = new Garden(env);
console.log(garden);
};

Expand Down

0 comments on commit b2c1c26

Please sign in to comment.