diff --git a/ai-chat b/ai-chat index abded91..fc1ed79 100755 --- a/ai-chat +++ b/ai-chat @@ -2,6 +2,7 @@ conversation_file=$(mktemp) echo new conversation: "$conversation_file" +OPENAPI_TOKEN=$(pass openai/api-key) prompt="You are Mr.Helper. You are an assistant that lives in a floating terminal above my mac. I can summon you with the press of a button! Feel free to use ansii escape codes to add colors or other formatting to your responses." @@ -18,7 +19,7 @@ while read -rep '> ' prompt ; do out="$( http \ -A bearer \ - --auth "$(pass openai/api-key)" \ + --auth "$OPENAPI_TOKEN" \ https://api.openai.com/v1/chat/completions \ model=gpt-3.5-turbo \ messages:="$messages"