Skip to content

Commit e1c180b

Browse files
committed
Merge branch 'master' into dev
2 parents f5c705c + 930f35d commit e1c180b

File tree

5 files changed

+282
-211
lines changed

5 files changed

+282
-211
lines changed

addon/doc/uk/readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@
8181

8282
Ви можете перемикатися між цими двома режимами в будь-який момент під час сеансу.
8383

84-
#### Про поле "System".
84+
#### Про поле "Системна підказка".
8585

86-
Поле «System» призначене для точного налаштування поведінки та індивідуальності моделі ШІ відповідно до ваших конкретних очікувань.
86+
Поле «Системна підказка» призначене для точного налаштування поведінки та індивідуальності моделі ШІ відповідно до ваших конкретних очікувань.
8787

8888
- **Початкова підказка**: після інсталяції додаток містить готову до використання початкову системну підказку
8989
- **Налаштування**: у вас є свобода персоналізувати системну підказку, змінюючи текст безпосередньо в полі. Додаток запам’ятає останню системну підказку, яку ви використовували, і автоматично завантажить її під час наступного запуску діалогу. Цю поведінку можна вимкнути в налаштуваннях.

addon/globalPlugins/openai/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,10 @@ def onSave(self):
435435
conf["chatFeedback"][key] = item.GetValue()
436436

437437

438+
for key, item in self.chatFeedback.items():
439+
conf["chatFeedback"][key] = item.GetValue()
440+
441+
438442
class GlobalPlugin(globalPluginHandler.GlobalPlugin):
439443

440444
scriptCategory = "Open AI"

addon/globalPlugins/openai/maindialog.py

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,6 @@
5151
TTS_FILE_NAME = os.path.join(DATA_DIR, "tts.wav")
5252
DATA_JSON_FP = os.path.join(DATA_DIR, "data.json")
5353
URL_PATTERN = re.compile(r"^(?:http)s?://(?:[A-Z0-9-]+\.)+[A-Z]{2,6}(?::\d+)?(?:/?|[/?]\S+)$", re.IGNORECASE)
54-
RESP_AUDIO_FORMATS = ("json", "srt", "vtt")
55-
RESP_AUDIO_FORMATS_LABELS = (
56-
_("Text"),
57-
_("SubRip (SRT)"),
58-
_("Web Video Text Tracks (VTT)")
59-
)
6054
SND_CHAT_RESPONSE_PENDING = os.path.join(
6155
ADDON_DIR, "sounds", "chatResponsePending.wav"
6256
)
@@ -69,9 +63,14 @@
6963
SND_PROGRESS = os.path.join(
7064
ADDON_DIR, "sounds", "progress.wav"
7165
)
72-
7366
# Translators: This is a message emitted by the add-on when an operation is in progress.
7467
PROCESSING_MSG = _("Please wait...")
68+
RESP_AUDIO_FORMATS = ("json", "srt", "vtt")
69+
RESP_AUDIO_FORMATS_LABELS = (
70+
_("Text"),
71+
_("SubRip (SRT)"),
72+
_("Web Video Text Tracks (VTT)")
73+
)
7574

7675
addToSession = None
7776

@@ -670,15 +669,6 @@ def __init__(
670669
parent=self,
671670
min=0
672671
)
673-
self.whisperResponseFormatLabel = wx.StaticText(
674-
parent=self,
675-
label=_("&Whisper Response Format:")
676-
)
677-
self.whisperResponseFormatListBox = wx.Choice(
678-
parent=self,
679-
choices=RESP_AUDIO_FORMATS_LABELS
680-
)
681-
self.whisperResponseFormatListBox.SetSelection(0)
682672

683673
if conf["advancedMode"]:
684674
temperatureLabel = wx.StaticText(
@@ -700,6 +690,16 @@ def __init__(
700690
initial=conf["topP"]
701691
)
702692

693+
self.whisperResponseFormatLabel = wx.StaticText(
694+
parent=self,
695+
label=_("&Whisper Response Format:")
696+
)
697+
self.whisperResponseFormatListBox = wx.Choice(
698+
parent=self,
699+
choices=RESP_AUDIO_FORMATS_LABELS
700+
)
701+
self.whisperResponseFormatListBox.SetSelection(0)
702+
703703
self.streamModeCheckBox = wx.CheckBox(
704704
parent=self,
705705
label=_("Stream mode")
@@ -727,13 +727,13 @@ def __init__(
727727
sizer1.Add(self.modelListBox, 0, wx.ALL, 5)
728728
sizer1.Add(maxTokensLabel, 0, wx.ALL, 5)
729729
sizer1.Add(self.maxTokens, 0, wx.ALL, 5)
730-
sizer1.Add(self.whisperResponseFormatLabel, 0, wx.ALL, 5)
731-
sizer1.Add(self.whisperResponseFormatListBox, 0, wx.ALL, 5)
732730
if conf["advancedMode"]:
733731
sizer1.Add(temperatureLabel, 0, wx.ALL, 5)
734732
sizer1.Add(self.temperature, 0, wx.ALL, 5)
735733
sizer1.Add(topPLabel, 0, wx.ALL, 5)
736734
sizer1.Add(self.topP, 0, wx.ALL, 5)
735+
sizer1.Add(self.whisperResponseFormatLabel, 0, wx.ALL, 5)
736+
sizer1.Add(self.whisperResponseFormatListBox, 0, wx.ALL, 5)
737737
sizer1.Add(self.streamModeCheckBox, 0, wx.ALL, 5)
738738
sizer1.Add(self.debugModeCheckBox, 0, wx.ALL, 5)
739739

@@ -1851,12 +1851,12 @@ def onImageDescriptionFromScreenshot(self, evt):
18511851
)
18521852

18531853
def getWhisperResponseFormat(self):
1854-
choiceIndex = self.whisperResponseFormatListBox.GetSelection()
1854+
choiceIndex = 0
1855+
if self.conf["advancedMode"]:
1856+
choiceIndex = self.whisperResponseFormatListBox.GetSelection()
18551857
if choiceIndex == wx.NOT_FOUND:
18561858
choiceIndex = 0
1857-
return RESP_AUDIO_FORMATS[
1858-
choiceIndex
1859-
]
1859+
return RESP_AUDIO_FORMATS[choiceIndex]
18601860

18611861
def onRecord(self, evt):
18621862
if self.worker:
@@ -1938,6 +1938,7 @@ def disableButtons(self):
19381938
if self.conf["advancedMode"]:
19391939
self.temperature.Disable()
19401940
self.topP.Disable()
1941+
self.whisperResponseFormatListBox.Disable()
19411942
self.streamModeCheckBox.Disable()
19421943
self.debugModeCheckBox.Disable()
19431944

@@ -1952,10 +1953,10 @@ def enableButtons(self):
19521953
self.systemText.SetEditable(True)
19531954
self.promptText.SetEditable(True)
19541955
self.imageListCtrl.Enable()
1955-
self.whisperResponseFormatListBox.Enable()
19561956
if self.conf["advancedMode"]:
19571957
self.temperature.Enable()
19581958
self.topP.Enable()
1959+
self.whisperResponseFormatListBox.Enable()
19591960
self.streamModeCheckBox.Enable()
19601961
self.debugModeCheckBox.Enable()
19611962
self.updateImageList(False)

0 commit comments

Comments
 (0)