From 885c4b9679590da707d0643672f5f07d9290db23 Mon Sep 17 00:00:00 2001
From: end-4 <97237370+end-4@users.noreply.github.com>
Date: Sun, 6 Apr 2025 17:04:33 +0200
Subject: [PATCH] gpts: make provider indicator icon update
---
.config/ags/i18n/locales/Default.json | 2 +-
.config/ags/i18n/locales/fa_IR.json | 1 -
.config/ags/i18n/locales/fr_FR.json | 1 -
.config/ags/i18n/locales/it_IT.json | 1 -
.config/ags/i18n/locales/zh_CN.json | 1 -
.config/ags/modules/sideleft/apis/chatgpt.js | 7 +++++--
6 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/.config/ags/i18n/locales/Default.json b/.config/ags/i18n/locales/Default.json
index e6987ecb..b9c15503 100644
--- a/.config/ags/i18n/locales/Default.json
+++ b/.config/ags/i18n/locales/Default.json
@@ -23,7 +23,7 @@
"An API from Tornado Softwares\nPricing: Free: 100/day\nRequires you to join their Discord for a key": "An API from Tornado Softwares\nPricing: Free: 100/day\nRequires you to join their Discord for a key",
"An API from @zukixa on GitHub.\nNote: Keys are IP-locked so it's buggy sometimes\nPricing: Free: 10/min, 800/day.\nRequires you to join their Discord for a key": "An API from @zukixa on GitHub.\nNote: Keys are IP-locked so it's buggy sometimes\nPricing: Free: 10/min, 800/day.\nRequires you to join their Discord for a key",
"Provider shown above": "Provider shown above",
- "Uses gpt-3.5-turbo.\nNot affiliated, endorsed, or sponsored by OpenAI.\n\nPrivacy: OpenAI claims they do not use your data\nwhen you use their API. Idk about others.": "Uses gpt-3.5-turbo.\nNot affiliated, endorsed, or sponsored by OpenAI.\n\nPrivacy: OpenAI claims they do not use your data\nwhen you use their API. Idk about others.",
+ "Chat with models compatible with OpenAI's Chat Completions API.\nNot affiliated, endorsed, or sponsored by any of the providers.": "Chat with models compatible with OpenAI's Chat Completions API.\nNot affiliated, endorsed, or sponsored by any of the providers.",
"The model's temperature value.\n Precise = 0\n Balanced = 0.5\n Creative = 1": "The model's temperature value.\n Precise = 0\n Balanced = 0.5\n Creative = 1",
"An API key is required\nYou can grab one here, then enter it below": "An API key is required\nYou can grab one here, then enter it below",
"Tells the model:\n- It's a Linux sidebar assistant\n- Be brief and use bullet points": "Tells the model:\n- It's a Linux sidebar assistant\n- Be brief and use bullet points",
diff --git a/.config/ags/i18n/locales/fa_IR.json b/.config/ags/i18n/locales/fa_IR.json
index 1ae81a71..17a4e40b 100644
--- a/.config/ags/i18n/locales/fa_IR.json
+++ b/.config/ags/i18n/locales/fa_IR.json
@@ -23,7 +23,6 @@
"An API from Tornado Softwares\nPricing: Free: 100/day\nRequires you to join their Discord for a key": "API از Tornado Softwares\nقیمتگذاری: رایگان: 100 در روز\nنیاز به پیوستن به دیسکورد آنها برای دریافت کلید دارد",
"An API from @zukixa on GitHub.\nNote: Keys are IP-locked so it's buggy sometimes\nPricing: Free: 10/min, 800/day.\nRequires you to join their Discord for a key": "API از @zukixa در گیتهاب.\nتوجه: کلیدها قفل IP هستند بنابراین گاهی اوقات باگ دارند\nقیمتگذاری: رایگان: 10 در دقیقه، 800 در روز.\nنیاز به پیوستن به دیسکورد آنها برای دریافت کلید دارد",
"Provider shown above": "ارائهدهنده در بالا نشان داده شده است",
- "Uses gpt-3.5-turbo.\nNot affiliated, endorsed, or sponsored by OpenAI.\n\nPrivacy: OpenAI claims they do not use your data\nwhen you use their API. Idk about others.": "بکارگیری gpt-3.5-turbo.نا وابسته، تأیید شده یا حمایت شده توسط OpenAI.\n\nحریم خصوصی: OpenAI ادعا میکند که آنها دادههای شما را بکار نمیگیرند\nزمانی که API آنها را بکار میگیرید. نمیدانم درباره دیگران.",
"The model's temperature value.\n Precise = 0\n Balanced = 0.5\n Creative = 1": "مقدار دما در مدل.\n دقیق = 0\n متعادل = 0.5\n خلاق = 1",
"An API key is required\nYou can grab one here, then enter it below": "یک کلید API مورد نیاز است\nشما میتوانید یکی را اینجا بگیرید، سپس آن را پایین وارد کنید",
"Tells the model:\n- It's a Linux sidebar assistant\n- Be brief and use bullet points": "به مدل میگوید:\n- این یک دستیار نوار کناری لینوکس است\n- گزافهگو نباشید و نقاط فهرست بکار ببرید",
diff --git a/.config/ags/i18n/locales/fr_FR.json b/.config/ags/i18n/locales/fr_FR.json
index d5f444f4..9e42757a 100644
--- a/.config/ags/i18n/locales/fr_FR.json
+++ b/.config/ags/i18n/locales/fr_FR.json
@@ -23,7 +23,6 @@
"An API from Tornado Softwares\nPricing: Free: 100/day\nRequires you to join their Discord for a key": "Une API de Tornado Softwares\nTarification : Gratuit : 100 par jour\nNécessite de rejoindre leur Discord pour obtenir une clé",
"An API from @zukixa on GitHub.\nNote: Keys are IP-locked so it's buggy sometimes\nPricing: Free: 10/min, 800/day.\nRequires you to join their Discord for a key": "Une API de @zukixa sur GitHub.\nNote : Les clés sont verrouillées par IP, ce qui peut provoquer des bugs\nTarification : Gratuit : 10/min, 800/jour.\nNécessite de rejoindre leur Discord pour obtenir une clé",
"Provider shown above": "Fournisseur indiqué ci-dessus",
- "Uses gpt-3.5-turbo.\nNot affiliated, endorsed, or sponsored by OpenAI.\n\nPrivacy: OpenAI claims they do not use your data\nwhen you use their API. Idk about others.": "Utilise gpt-3.5-turbo.\nNon affilié, approuvé ou sponsorisé par OpenAI.\n\nConfidentialité : OpenAI affirme ne pas utiliser vos données\nlorsque vous utilisez leur API. Pour les autres, je ne sais pas.",
"The model's temperature value.\n Precise = 0\n Balanced = 0.5\n Creative = 1": "La valeur de température du modèle.\n Précis = 0\n Équilibré = 0.5\n Créatif = 1",
"An API key is required\nYou can grab one here, then enter it below": "Une clé API est requise\nVous pouvez en obtenir une ici, puis la saisir ci-dessous",
"Tells the model:\n- It's a Linux sidebar assistant\n- Be brief and use bullet points": "Indique au modèle :\n- C'est un assistant de barre latérale pour Linux\n- Sois concis et utilise des puces",
diff --git a/.config/ags/i18n/locales/it_IT.json b/.config/ags/i18n/locales/it_IT.json
index 055eef0e..79e8277e 100644
--- a/.config/ags/i18n/locales/it_IT.json
+++ b/.config/ags/i18n/locales/it_IT.json
@@ -23,7 +23,6 @@
"An API from Tornado Softwares\nPricing: Free: 100/day\nRequires you to join their Discord for a key": "Un'API di Tornado Softwares\nPrezzi: Gratuito: 100/giorno\nRichiede di unirsi al loro Discord per una chiave",
"An API from @zukixa on GitHub.\nNote: Keys are IP-locked so it's buggy sometimes\nPricing: Free: 10/min, 800/day.\nRequires you to join their Discord for a key": "Un'API di @zukixa su GitHub.\nNota: Le chiavi sono bloccate per IP, quindi a volte è instabile\nPrezzi: Gratuito: 10/min, 800/giorno.\nRichiede di unirsi al loro Discord per una chiave",
"Provider shown above": "Provider mostrato sopra",
- "Uses gpt-3.5-turbo.\nNot affiliated, endorsed, or sponsored by OpenAI.\n\nPrivacy: OpenAI claims they do not use your data\nwhen you use their API. Idk about others.": "Usa gpt-3.5-turbo.\nNon affiliato, approvato o sponsorizzato da OpenAI.\n\nPrivacy: OpenAI afferma di non utilizzare i tuoi dati\nquando usi la loro API. Non so per gli altri.",
"The model's temperature value.\n Precise = 0\n Balanced = 0.5\n Creative = 1": "Valore di temperatura del modello.\n Preciso = 0\n Bilanciato = 0.5\n Creativo = 1",
"An API key is required\nYou can grab one here, then enter it below": "È necessaria una chiave API\nPuoi ottenerne una qui, quindi inserirla qui sotto",
"Tells the model:\n- It's a Linux sidebar assistant\n- Be brief and use bullet points": "Dice al modello:\n- È un assistente laterale per Linux\n- Sii breve e usa punti elenco",
diff --git a/.config/ags/i18n/locales/zh_CN.json b/.config/ags/i18n/locales/zh_CN.json
index 79a060a9..5fadb11c 100644
--- a/.config/ags/i18n/locales/zh_CN.json
+++ b/.config/ags/i18n/locales/zh_CN.json
@@ -23,7 +23,6 @@
"An API from Tornado Softwares\nPricing: Free: 100/day\nRequires you to join their Discord for a key": "来自 Tornado Softwares 的 API\n定价:免费:每天 100 次请求\n需要加入他们的 Discord 以获取密钥",
"An API from @zukixa on GitHub.\nNote: Keys are IP-locked so it's buggy sometimes\nPricing: Free: 10/min, 800/day.\nRequires you to join their Discord for a key": "来自 GitHub 上的 @zukixa 的 API。\n注意:密钥与 IP 绑定,所以有时会出错。\n定价:免费:每分钟 10 次,每天 800 次。\n需要加入他们的 Discord 才能获得密钥。",
"Provider shown above": "上述显示的提供商",
- "Uses gpt-3.5-turbo.\nNot affiliated, endorsed, or sponsored by OpenAI.\n\nPrivacy: OpenAI claims they do not use your data\nwhen you use their API. Idk about others.": "使用 gpt-3.5-turbo。\n与 OpenAI 无关联,未获得其认可或赞助。\n\n隐私:OpenAI 声明,当您使用他们的 API 时,他们不会使用您的数据。\n我不清楚其他人的情况。",
"The model's temperature value.\n Precise = 0\n Balanced = 0.5\n Creative = 1": "模型的 temperature 值。\n 精确 = 0\n 平衡 = 0.5\n 创意 = 1",
"An API key is required\nYou can grab one here, then enter it below": "需要 API 密钥\n您可以在这里获取一个,然后在下面输入",
"Tells the model:\n- It's a Linux sidebar assistant\n- Be brief and use bullet points": "告诉模型:\n- 它是一个 Linux 侧边栏助手\n- 保持简洁并使用项目符号",
diff --git a/.config/ags/modules/sideleft/apis/chatgpt.js b/.config/ags/modules/sideleft/apis/chatgpt.js
index b3e578a1..2adc489a 100644
--- a/.config/ags/modules/sideleft/apis/chatgpt.js
+++ b/.config/ags/modules/sideleft/apis/chatgpt.js
@@ -59,7 +59,10 @@ const ProviderSwitcher = () => {
}
let indicatorIcon = Icon({
icon: GPTService.providers[userOptions.ai.defaultGPTProvider]['logo_name'],
- className: 'txt-large'
+ className: 'txt-large',
+ setup: (self) => self.hook(GPTService, (self) => {
+ self.icon = GPTService.providers[GPTService.providerID]['logo_name'];
+ }, 'providerChanged')
});
const indicatorChevron = MaterialIcon('expand_more', 'norm');
const indicatorButton = Button({
@@ -146,7 +149,7 @@ const GPTInfo = () => {
Button({
className: 'txt-subtext txt-norm icon-material',
label: 'info',
- tooltipText: getString('Uses gpt-3.5-turbo.\nNot affiliated, endorsed, or sponsored by OpenAI.\n\nPrivacy: OpenAI claims they do not use your data\nwhen you use their API. Idk about others.'),
+ tooltipText: getString("Chat with models compatible with OpenAI's Chat Completions API.\nNot affiliated, endorsed, or sponsored by any of the providers."),
setup: setupCursorHoverInfo,
}),
]