Skip to content

Commit

Permalink
Rename CHAT_GPT_API_KEY to OPENAI_API_KEY
Browse files Browse the repository at this point in the history
This is really pretty standard across most OpenAI apps. Since this is
common its nice to only have set it once and use it for multiple apps.
  • Loading branch information
sixlive committed Mar 13, 2024
1 parent b592019 commit 724b6ef
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ My first ever terminal UI! Everything is stored locally on sqlite and written in

## Installation

Please make sure that you expose a `CHAT_GPT_API_KEY` inside of your environment; we require it to make api calls!
Please make sure that you expose a `OPENAI_API_KEY` inside of your environment; we require it to make api calls!

Set up your [api key](https://platform.openai.com/api-keys)

```bash
export CHAT_GPT_API_KEY="some-key" # you would want to export this in your .zshrc
export OPENAI_API_KEY="some-key" # you would want to export this in your .zshrc
brew tap tearingitup786/tearingitup786
brew install chatgpt-tui
chatgpt-tui
Expand Down
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,10 +379,10 @@ func main() {
}
defer f.Close()

apiKey := os.Getenv("CHAT_GPT_API_KEY")
apiKey := os.Getenv("OPENAI_API_KEY")
if "" == apiKey {
fmt.Println("CHAT_GPT_API_KEY not set; set it in your profile")
fmt.Printf("export CHAT_GPT_API_KEY=your_key in the config for :%v \n", os.Getenv("SHELL"))
fmt.Println("OPENAI_API_KEY not set; set it in your profile")
fmt.Printf("export OPENAI_API_KEY=your_key in the config for :%v \n", os.Getenv("SHELL"))
fmt.Println("Exiting...")
os.Exit(1)
}
Expand Down
2 changes: 1 addition & 1 deletion sessions/message-stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (m Model) constructJsonBody() ([]byte, error) {
}

func (m *Model) CallChatGpt(resultChan chan ProcessResult) tea.Cmd {
apiKey := os.Getenv("CHAT_GPT_API_KEY")
apiKey := os.Getenv("OPENAI_API_KEY")
processResultID := 0 // Initialize a counter for ProcessResult IDs

return func() tea.Msg {
Expand Down

0 comments on commit 724b6ef

Please sign in to comment.