Skip to content

Commit

Permalink
chat: improved API key settings
Browse files Browse the repository at this point in the history
  • Loading branch information
hfujikawa77 committed Dec 19, 2023
1 parent f99b4a8 commit 324e957
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions MAVProxy/modules/mavproxy_chat/chat_voice_to_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ def __init__(self):
self.client = None
self.assistant = None

# set the OpenAI API key
def set_api_key(self, api_key_str):
self.client = OpenAI(api_key = api_key_str)

# check connection to OpenAI assistant and connect if necessary
# returns True if connection is good, False if not
def check_connection(self):
Expand Down
1 change: 1 addition & 0 deletions MAVProxy/modules/mavproxy_chat/chat_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def menu_set_api_key_show(self, event):
# set API key set button clicked
def apikey_set_button_click(self, event):
self.chat_openai.set_api_key(self.apikey_text_input.GetValue())
self.chat_voice_to_text.set_api_key(self.apikey_text_input.GetValue())
self.apikey_frame.Hide()

# API key close button clicked
Expand Down

0 comments on commit 324e957

Please sign in to comment.