Skip to content

Commit 7963285

Browse files
committed
Redesign modelInputManualDialog (will implement that next time, cause i'm exhausted)
1 parent 6b41be7 commit 7963285

File tree

2 files changed

+18
-20
lines changed

2 files changed

+18
-20
lines changed

pyqt_openai/widgets/APIInputButton.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77

88
class APIInputButton(QPushButton):
9+
"""
10+
Stylish button for opening the API settings dialog.
11+
"""
912
def __init__(self, base_color="#007BFF"):
1013
super().__init__()
1114
self.setObjectName("modernButton")
Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
from PySide6.QtCore import Qt
22
from PySide6.QtGui import QFont
3-
from PySide6.QtWidgets import QDialog, QLabel, QHBoxLayout, QTableWidget
3+
from PySide6.QtWidgets import QDialog, QLabel, QHBoxLayout
44

55
from pyqt_openai import SMALL_LABEL_PARAM
6-
from pyqt_openai.util.common import get_litellm_prefixes
76

87

98
class ModelInputManualDialog(QDialog):
@@ -14,31 +13,27 @@ def __init__(self, parent=None):
1413

1514
def __initVal(self):
1615
self.__warningMessage = (
17-
"💡 <b>Tip</b> For models other than OpenAI and Anthropic, enter the model name as `[ProviderName]/[ModelName]`.\n\n"
18-
"🔗 For details on `ProviderName` and `ModelName`, check out the "
19-
"<a href='https://docs.litellm.ai/docs/providers'>LiteLLM documentation</a>! 😊\n\n"
20-
"⚠️ Note: Some models may not support <b>JSON Mode</b> or <b>LlamaIndex</b> features."
16+
"💡 <b>Tip:</b> For models other than OpenAI and Anthropic, enter the model name as "
17+
"<code>[ProviderName]/[ModelName]</code>.<br><br>"
18+
"🔗 For details on <b>ProviderName</b> and <b>ModelName</b>, check out the "
19+
"<a href='https://docs.litellm.ai/docs/providers'>LiteLLM documentation</a>! 😊<br><br>"
20+
"⚠️ <b>Note:</b> Some models may not support <b>JSON Mode</b> or <b>LlamaIndex</b> features."
2121
)
2222

2323
def __initUi(self):
24+
self.setWindowTitle('Model Input Manual')
2425
self.__warningLbl = QLabel()
25-
self.__warningLbl.setStyleSheet("color: orange;")
26-
self.__warningLbl.setOpenExternalLinks(True)
26+
self.__warningLbl.setStyleSheet(
27+
"color: orange;"
28+
) # Text color remains orange for visibility.
29+
self.__warningLbl.setWordWrap(True)
2730
self.__warningLbl.setFont(QFont(SMALL_LABEL_PARAM))
28-
self.__warningLbl.setText(self.__warningMessage)
2931
self.__warningLbl.setTextInteractionFlags(
30-
Qt.TextInteractionFlag.TextSelectableByMouse
32+
Qt.TextInteractionFlag.TextBrowserInteraction
3133
)
32-
33-
# prefixTable = QTableWidget()
34-
# prefixes = get_litellm_prefixes()
35-
# prefixTable.setColumnCount(len(list(prefixes[0].keys())))
36-
# prefixTable.setHorizontalHeaderLabels(list(prefixes[0].keys()))
37-
# for prefix in prefixes:
38-
# prefixTable.insertRow(prefixTable.rowCount())
39-
# prefixTable.setItem(prefixTable.rowCount() - 1, 0, QLabel(prefix))
34+
self.__warningLbl.setOpenExternalLinks(True) # Enable hyperlink functionality.
35+
self.__warningLbl.setText(self.__warningMessage) # Ensure HTML is passed as text.
4036

4137
lay = QHBoxLayout()
4238
lay.addWidget(self.__warningLbl)
43-
# lay.addWidget(prefixTable)
44-
self.setLayout(lay)
39+
self.setLayout(lay)

0 commit comments

Comments
 (0)