Skip to content

Commit b17e7ab

Browse files
committed
Allow to read Manuals about updated LLMs through API Dialog
1 parent 3d1d6a9 commit b17e7ab

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

pyqt_openai/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ def move_updater():
109109
HOW_TO_GET_OPENAI_API_KEY_URL = 'https://medium.com/@yjg30737/how-to-get-your-openai-api-key-e2193850932e'
110110
HOW_TO_EXPORT_CHATGPT_CONVERSATION_HISTORY_URL = 'https://medium.com/@yjg30737/how-to-export-your-chatgpt-conversation-history-caa0946d6349'
111111
HOW_TO_REPLICATE = 'https://medium.com/@yjg30737/10a2cb983ceb'
112+
HOW_TO_GET_CLAUDE_API_KEY_URL = 'https://medium.com/@yjg30737/e771e42c182a'
113+
HOW_TO_GET_GEMINI_API_KEY_URL = 'https://medium.com/@yjg30737/e61a84d64c69'
114+
HOW_TO_GET_LLAMA_API_KEY_URL = 'https://medium.com/@yjg30737/0dc1900e3606'
112115

113116
COLUMN_TO_EXCLUDE_FROM_SHOW_HIDE_CHAT = ['id']
114117
COLUMN_TO_EXCLUDE_FROM_SHOW_HIDE_IMAGE = ['id', 'data']

pyqt_openai/apiDialog.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
from PySide6.QtWidgets import QVBoxLayout, QTableWidget, QHeaderView, QTableWidgetItem, QLabel, QLineEdit, QDialog, \
22
QDialogButtonBox
33

4+
from pyqt_openai import HOW_TO_GET_OPENAI_API_KEY_URL, HOW_TO_GET_CLAUDE_API_KEY_URL, HOW_TO_GET_GEMINI_API_KEY_URL, \
5+
HOW_TO_GET_LLAMA_API_KEY_URL
6+
from pyqt_openai.lang.translations import LangClass
7+
from pyqt_openai.widgets.linkLabel import LinkLabel
8+
49

510
# FIXME Are there any ways to get authentification from the claude, gemini?
611
# def is_api_key_valid(endpoint, api_key):
@@ -18,8 +23,20 @@ def __init__(self, api_keys: list, parent=None):
1823
def __initVal(self, api_keys):
1924
self.__api_keys = api_keys
2025

26+
# Set "get api key" here
27+
for i, obj in enumerate(self.__api_keys):
28+
obj['get_api_key'] = {
29+
'OpenAI': HOW_TO_GET_OPENAI_API_KEY_URL,
30+
'Claude': HOW_TO_GET_CLAUDE_API_KEY_URL,
31+
'Gemini': HOW_TO_GET_GEMINI_API_KEY_URL,
32+
'Llama': HOW_TO_GET_LLAMA_API_KEY_URL
33+
}[obj['display_name']]
34+
35+
2136
def __initUi(self):
22-
columns = ['Models', 'API Key']
37+
self.setWindowTitle('API Key')
38+
39+
columns = ['Platform', 'API Key', 'Get API Key']
2340
self.__tableWidget = QTableWidget()
2441
self.__tableWidget.setColumnCount(len(columns))
2542
self.__tableWidget.setHorizontalHeaderLabels(columns)
@@ -35,6 +52,11 @@ def __initUi(self):
3552
apiKeyLineEdit.setEchoMode(QLineEdit.EchoMode.Password)
3653
self.__tableWidget.setCellWidget(i, 1, apiKeyLineEdit)
3754

55+
getApiKeyLbl = LinkLabel()
56+
getApiKeyLbl.setText('Link')
57+
getApiKeyLbl.setUrl(obj['get_api_key'])
58+
self.__tableWidget.setCellWidget(i, 2, getApiKeyLbl)
59+
3860
# Dialog buttons
3961
buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
4062
buttonBox.accepted.connect(self.accept)

0 commit comments

Comments
 (0)