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

Add option --openai_key_file for loading API keys from text file #47

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ShenTengTu
Copy link

增加一個option --openai_key_file, 從檔案中載入多個API key, 每一行為一個API key。

test/.keys

sk-xxx
sk-yyy
...

命令

python make_book.py --book_name test_books/animal_farm.epub --openai_key_file test/.keys --test

Comment on lines 324 to 329
OPENAI_API_KEY = options.openai_key or env.get("OPENAI_API_KEY")
OPENAI_KEY_FILE = options.openai_key_file
if not OPENAI_API_KEY:
if OPENAI_KEY_FILE:
OPENAI_API_KEY = load_key_file(OPENAI_KEY_FILE)
RESUME = options.resume
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's decide which is the higher priority key arg or key-file?

@yihong0618
Copy link
Owner

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants