Skip to content

Commit beb4e43

Browse files
Support OPENAI_API_KEY_LOCATION
* support locations of openai-api-key other than HOME * move toilet prompts into hub directory
1 parent bdd7dfb commit beb4e43

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

prompts/hub/figlet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ functions:
55

66
# Prompt user
77

8-
Run figlet on the message `Hey YOU`.
8+
Run figlet on the message `Docker`.
99

1010
# Result
1111

prompts/toilet/README.md renamed to prompts/hub/toilet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ functions:
66
# Prompt user
77

88
First run the man page for toilet.
9-
After that, run the toilet command with the font `future` and write the message "Hello from Docker"
9+
After that, run the toilet command with the font `helvetica` and write the message "Hello from Docker"
1010

1111
# Result
1212

prompts/qrencode/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ functions:
66

77
# Prompt user
88

9-
Run the man page for qrencode and then use the results to generate a QR code for the
10-
content `https://github.com/docker/labs-ai-tools-for-devs` and save it to `qrcode.png`.
11-
9+
Generate a QR code for the content `https://github.com/docker/labs-ai-tools-for-dev`. Save the generated image to `qrcode.png`.
10+
If the command fails, read the man page and try again.
11+
1212
# Result
1313

1414
This function generates a QR code for a URL. The QR code is saved as a PNG file.

src/openai.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
(defn openai-api-key []
1313
(try
14-
(string/trim (slurp (io/file (System/getenv "HOME") ".openai-api-key")))
14+
(string/trim (slurp (io/file (or (System/getenv "OPENAI_API_KEY_LOCATION") (System/getenv "HOME")) ".openai-api-key")))
1515
(catch Throwable _ nil)))
1616

1717
(defn openai

0 commit comments

Comments
 (0)