Skip to content

Commit

Permalink
Fix the bug with gooseapi keys, plus stripping newlines from the end …
Browse files Browse the repository at this point in the history
…of all the api keys to make the input less annoying.
  • Loading branch information
FergusFettes committed Feb 25, 2023
1 parent a1862a2 commit 39d4667
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions components/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,7 @@ def body(self, master):
key_length = max(max(len(self.openai_api_key), len(self.ai21_api_key), len(self.gooseai_api_key)), 20)
self.openai_api_key_entry = Entry(master, master.grid_size()[1], "OpenAI API Key", self.openai_api_key, None, width=key_length)
self.ai21_api_key_entry = Entry(master, master.grid_size()[1], "AI21 API Key", self.ai21_api_key, None, width=key_length)
self.gooseai_api_key = Entry(master, master.grid_size()[1], "GooseAI API Key", self.gooseai_api_key, None, width=key_length)
self.gooseai_api_key_entry = Entry(master, master.grid_size()[1], "GooseAI API Key", self.gooseai_api_key, None, width=key_length)
models_list = self.available_models.keys()
self.model_label = ttk.Label(master, text="Model")
self.model_label.grid(row=master.grid_size()[1], column=0)
Expand All @@ -1204,8 +1204,8 @@ def apply(self):
self.state.update_frame(node=self.state.root(), update={'model_config': {'models': self.available_models}})
#'OPENAI_API_KEY': self.openai_api_key_entry.tk_variables.get(),
#'AI21_API_KEY': self.ai21_api_key_entry.tk_variables.get(),
self.state.OPENAI_API_KEY = self.openai_api_key_entry.tk_variables.get()
self.state.AI21_API_KEY = self.ai21_api_key_entry.tk_variables.get()
self.state.GOOSEAI_API_KEY = self.gooseai_api_key_entry.tk_variables.get()
self.state.OPENAI_API_KEY = self.openai_api_key_entry.tk_variables.get().strip()
self.state.AI21_API_KEY = self.ai21_api_key_entry.tk_variables.get().strip()
self.state.GOOSEAI_API_KEY = self.gooseai_api_key_entry.tk_variables.get().strip()
self.state.update_user_frame(update={'generation_settings': {'model': self.selected_model.get()}})

0 comments on commit 39d4667

Please sign in to comment.