Skip to content

Commit

Permalink
chat: fix recording and api-key screen
Browse files Browse the repository at this point in the history
  • Loading branch information
rmackay9 committed Dec 11, 2023
1 parent 1cd4e89 commit ea538db
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions MAVProxy/modules/mavproxy_chat/chat_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __init__(self, mpstate):

# add api key input window
self.apikey_frame = wx.Frame(None, title="Input OpenAI API Key", size=(560, 50))
self.apikey_text_input = wx.TextCtrl(self.apikey_frame, id=-1, value="Input API Key here and press enter", pos=(10, 10), size=(450, -1), style = wx.TE_PROCESS_ENTER)
self.apikey_text_input = wx.TextCtrl(self.apikey_frame, id=-1, pos=(10, 10), size=(450, -1), style = wx.TE_PROCESS_ENTER)
self.apikey_set_button = wx.Button(self.apikey_frame, id=-1, label="Set", pos=(470, 10), size=(75, 25))
self.apikey_frame.Bind(wx.EVT_BUTTON, self.apikey_set_button_click, self.apikey_set_button)
self.apikey_frame.Bind(wx.EVT_TEXT_ENTER, self.apikey_set_button_click, self.apikey_text_input)
Expand Down Expand Up @@ -64,8 +64,6 @@ def __init__(self, mpstate):
# set size hints and add sizer to frame
self.vert_sizer.Add(self.horiz_sizer, proportion=0, flag=wx.EXPAND)
self.vert_sizer.Add(self.text_reply, proportion=1, flag=wx.EXPAND, border=5)
#self.horiz_sizer.SetSizeHints(self.frame)
#self.vert_sizer.SetSizeHints(self.frame)
self.frame.SetSizer(self.vert_sizer)

# show frame
Expand Down Expand Up @@ -127,7 +125,7 @@ def record_button_click_execute(self, event):
if text is None:
print("chat: audio to text conversion failed")
return
self.text_input.SetValue(text)
wx.CallAfter(self.text_input.SetValue(text))

# send text to assistant
self.send_text_to_assistant()
Expand Down

0 comments on commit ea538db

Please sign in to comment.