Created
December 17, 2023 17:09
-
-
Save mkm29/cb6e956921e038c22c3f77c08d86bf07 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unlock_bw_if_locked() { | |
if [[ -z $BW_SESSION ]] ; then | |
>&2 echo 'bw locked - unlocking into a new session' | |
export BW_SESSION="$(bw unlock --raw)" | |
fi | |
} | |
load_openai() { | |
unlock_bw_if_locked | |
# Note that this openai_api_key_id value will be different for you! | |
local -r openai_api_key_id='c19e0515-e89b-48c9-a3cd-b0db0116ad82' | |
local openai_api_key | |
openai_api_key="$(bw get notes $openai_api_key_id)" | |
export OPENAI_HOST="https://api.openai.com" | |
export OPENAI_USERNAME="mitch.murphy@gmail.com" | |
export OPENAI_API_KEY="$openai_api_key" | |
} | |
load_openai "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment