From d4193735152ed889fcae0c3d751e4646a6b87725 Mon Sep 17 00:00:00 2001 From: mic Date: Wed, 21 May 2025 22:35:36 +0200 Subject: [PATCH] OpenAI Comp services shorcut added. see #378 --- _locales/en/messages.json | 12 +++++++++ js/api/openai_comp_configs.js | 49 +++++++++++++++++++++++++++++++++++ options/mzta-options.html | 14 +++++++++- options/mzta-options.js | 44 +++++++++++++++++++++++++++++++ 4 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 js/api/openai_comp_configs.js diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 03cc3b0b..746ddff6 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1506,5 +1506,17 @@ "content": "$1" } } + }, + "prefs_OpenAIComp_AvailableServices": { + "message": "Available Services", + "description": "" + }, + "prefs_OpenAIComp_AvailableServices_Info": { + "message": "Choose one of the services available for the OpenAI Compatible API or insert one manually.", + "description": "" + }, + "Custom": { + "message": "Custom", + "description": "" } } \ No newline at end of file diff --git a/js/api/openai_comp_configs.js b/js/api/openai_comp_configs.js new file mode 100644 index 00000000..3bf312f8 --- /dev/null +++ b/js/api/openai_comp_configs.js @@ -0,0 +1,49 @@ +/* + * ThunderAI [https://micz.it/thunderbird-addon-thunderai/] + * Copyright (C) 2024 - 2025 Mic (m@micz.it) + + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/* Config properties for OpenAI API Comp + id: + name: + chat_name: + host: + use_v1: (keep "v1" path segment) +*/ + +export const openAICompConfigs = [ + { + id: 'custom', + name: browser.i18n.getMessage('Custom'), + chat_name: 'OpenAI Comp API', + host: '', + use_v1: true, + }, + { + id: 'grok', + name: 'Grok AI API', + chat_name: 'Grok AI', + host: 'https://api.x.ai', + use_v1: true, + }, + { + id: 'mistral', + name: 'Mistral AI API', + chat_name: 'Mistral AI', + host: 'https://api.mistral.ai', + use_v1: true, + }, +]; \ No newline at end of file diff --git a/options/mzta-options.html b/options/mzta-options.html index 7c3e85f9..3ac1fdc2 100644 --- a/options/mzta-options.html +++ b/options/mzta-options.html @@ -314,6 +314,18 @@ + + + + + +