1
1
from PySide6 .QtCore import Qt
2
2
from PySide6 .QtGui import QFont
3
- from PySide6 .QtWidgets import QDialog , QLabel , QHBoxLayout , QTableWidget
3
+ from PySide6 .QtWidgets import QDialog , QLabel , QHBoxLayout
4
4
5
5
from pyqt_openai import SMALL_LABEL_PARAM
6
- from pyqt_openai .util .common import get_litellm_prefixes
7
6
8
7
9
8
class ModelInputManualDialog (QDialog ):
@@ -14,31 +13,27 @@ def __init__(self, parent=None):
14
13
15
14
def __initVal (self ):
16
15
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."
21
21
)
22
22
23
23
def __initUi (self ):
24
+ self .setWindowTitle ('Model Input Manual' )
24
25
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 )
27
30
self .__warningLbl .setFont (QFont (SMALL_LABEL_PARAM ))
28
- self .__warningLbl .setText (self .__warningMessage )
29
31
self .__warningLbl .setTextInteractionFlags (
30
- Qt .TextInteractionFlag .TextSelectableByMouse
32
+ Qt .TextInteractionFlag .TextBrowserInteraction
31
33
)
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.
40
36
41
37
lay = QHBoxLayout ()
42
38
lay .addWidget (self .__warningLbl )
43
- # lay.addWidget(prefixTable)
44
- self .setLayout (lay )
39
+ self .setLayout (lay )
0 commit comments